A CLI tool to bootstrap your project with ease. Create a new project using this boilerplate in seconds.
This is the boiler plate code for nodejs with MySQL database connection, middlewares like Json Web Token, Multer and security features like CORS, CSRF, Helmet, API rate limiting for Dos and DDoS Attacks, Input Size Limitation, CSP, etc. and also implemented logger using winston.
- Pre-configured boilerplate to get started quickly.
- Organized file structure.
- Easy setup and usage.
You don’t need to install it globally! Use it with npx
:
npx create-node-app-mongodb
Example:
npx create-node-mysql-app my-node-project
- Run the command to create a new project:
npx create-node-mysql-app <project-name>
- Navigate to your newly created project:
cd <project-name>
- Install dependencies:
npm install or npm i
- Run Migrations:
npm run migrate
- Create or generate Migrations
npm run generate --migrations-path src/migrations --name
- Start building your project!
- For Production
- Run migration using below command:
npm run migrate_production
After running the command, the project structure will look like this:
<project-name>/
├── src/
│ ├── config/ # Example config
│ ├── controllers/ # Example controllers
│ ├── middlewares/ # Example middlewares
│ ├── migrations/ # Example migrations
│ ├── models/ # Example models
│ ├── routes/ # Example routes
│ ├── services/ # Example services
│ ├── templates/ # Example templates
│ ├── utils/ # Example utils
│ ├── index.js # Main entry point
├── .env.examples # Example Environment Variables file
├── package.json # Project metadata
└── README.md # Project documentation
npx create-node-mysql-app my-new-app
cd my-new-app
npm install
npm run dev
If you want to contribute or test locally:
-
Clone this repository:
git clone https://github.com/aminronak007/node-mysql-boilerplate.git
-
Install dependencies:
npm install
-
Link the package locally:
npm link
-
Run the CLI command locally:
npm i create-node-mysql-app my-local-app
This project is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or queries, please let me know.
It generates a pre-configured project structure, so you can skip the boilerplate setup.
No! Just use create-node-mysql-app
to get started.
Yes, modify the files as needed after creation.
Made with ❤️ by Ronak Amin
# **Steps to Include README in Your npm Package**
1. Save the above content in a `README.md` file in the root directory of your project.
2. npm will automatically include this file when you publish the package.
When users view your package on npm, this README.md will appear as the documentation.