create-node-mysql-app

1.0.5 • Public • Published

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

  1. Run the command to create a new project:
    npx create-node-mysql-app <project-name>
  2. Navigate to your newly created project:
    cd <project-name>
  3. Install dependencies:
    npm install or npm i
  4. Run Migrations:
    npm run migrate
  5. Create or generate Migrations
    npm run generate --migrations-path src/migrations --name
  6. Start building your project!

📝 Important Note

  • For Production
  1. 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:

  1. Clone this repository:

    git clone https://github.com/aminronak007/node-mysql-boilerplate.git
  2. Install dependencies:

    npm install
  3. Link the package locally:

    npm link
  4. Run 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.

Readme

Keywords

none

Package Sidebar

Install

npm i create-node-mysql-app

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

35.7 kB

Total Files

31

Last publish

Collaborators

  • aminronak007