# NPX Backend Project Setup
A command-line tool for quickly creating and setting up a Node.js and Express backend project with various functionalities.
## Features
- **Node.js & Express**: Bootstraps a Node.js server with the Express framework, providing a robust foundation for building your backend.
- **Middleware**: Includes essential middleware for request parsing, error handling, and CORS.
- **Authentication**: Implements user authentication and authorization using JSON Web Tokens (JWT) for secure endpoints.
- **Database**: Integrates MongoDB as the database to store and manage your data.
- **Image Service**: Sets up image handling capabilities using the popular `multer` middleware and file storage in the `uploads` directory.
- **Email Service**: Configures an email service using Nodemailer for sending transactional emails.
## Usage
To create a new backend project with this tool, follow these steps:
1. Ensure you have Node.js and npm installed on your system.
2. Open your terminal and run the following command:
```bash
npx create-master-backend my-backend-project
```
Replace my-backend-project
with your desired project name.
-
Follow the on-screen prompts to configure your project:
- Choose the functionalities you want to include (e.g., authentication, database, image service, email service).
- Provide database connection details.
- Configure email service settings.
-
Start your Node.js server:
npm start
-
Your backend project is now up and running. You can start building your application by adding routes, controllers, and more.
my-backend-project/
├── server.js # Express application configuration
├── controllers/ # Controller logic for handling requests
├── routes/ # API route definitions
├── middleware/ # Custom middleware functions
├── models/ # Database models and schemas (if selected)
├── uploads/ # Directory for uploaded files (if selected)
├── config/ # Configuration files (e.g., database, email)
├── utils/ # Utility functions
├── .env # Environment variables (configure your secrets here)
├── package.json
└── .gitignore
You can customize your project's configuration by editing the .env
file and the corresponding configuration files in the config/
directory.
Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.
- Built with ❤️ by Abhinav Jha
For any questions or issues, please open an issue.