create-6pp-app
Official CLI for Creating Express Apps with Production-Level Folder Structure
This command-line interface (CLI) streamlines the creation of new Express.js applications with a well-organized folder structure optimized for production environments.
Key Features:
Production-Ready Structure: Enforces a clear separation of concerns, promoting maintainability and scalability.
Express.js Integration: Sets up a basic Express application with essential configurations.
Simplified Project Setup: Saves you time by automating the initial project creation process.
Installation: Bash
npm install create-6pp-app -g
Usage:
Open your terminal or command prompt.
Navigate to the directory where you want to create your new Express project.
Run the following command:
Bash
create-6pp-app <project-name>
Replace <project-name> with the desired name for your application.
Generated Folder Structure:
your-project-name/ ├── app/ # Main application directory │ ├── controllers/ # Controllers for handling application logic │ ├── models/ # Data models │ ├── routes/ # Routing definitions │ ├── views/ # HTML templates (if using view engine) │ └── index.js # Main application entry point ├── public/ # Static assets (e.g., CSS, JavaScript, images) ├── config/ # Configuration files (e.g., database connection, server settings) ├── .gitignore # Default Git ignore file ├── package.json # Project dependencies ├── README.md # This file (you're reading it!) └── server.js # Main server file
Getting Started:
After creating your project, navigate to the project directory: Bash
cd your-project-name
Install required dependencies:
Bash
npm install
Start your development server: Bash
npm start # (or yarn start if using yarn)
This will typically start your server on port 3000 (http://localhost:3000).
Customization:
The default port and other configuration options can be adjusted in config/server.js.
You can further customize the folder structure to fit your specific needs.