create-node-mysql-app v1.0.5
create-node-mysql-app
A CLI tool to bootstrap your project with ease. Create a new project using this boilerplate in seconds.
DESCRIPTION
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.
π Features
- Pre-configured boilerplate to get started quickly.
- Organized file structure.
- Easy setup and usage.
π¦ Installation
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π How to Use
- 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!
π Important Note
- For Production
- Run migration using below command:
npm run migrate_production
ποΈ Project Structure
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β¨ Example
npx create-node-mysql-app my-new-app
cd my-new-app
npm install
npm run devπ οΈ Development
If you want to contribute or test locally:
Clone this repository:
git clone https://github.com/aminronak007/node-mysql-boilerplate.gitInstall dependencies:
npm installLink the package locally:
npm linkRun the CLI command locally:
npm i create-node-mysql-app my-local-app
π Related
π License
This project is licensed under the MIT License. See the LICENSE file for details.
π FAQ
If you have any questions or queries, please let me know.
What does this tool do?
It generates a pre-configured project structure, so you can skip the boilerplate setup.
Do I need to install this globally?
No! Just use create-node-mysql-app to get started.
Can I customize the generated boilerplate?
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.