UNPKG

@excli/express

Version:

A cli tool for creating Express.js applications, supporting both JavaScript and TypeScript.

156 lines (110 loc) • 3.11 kB
# šŸ”„ Expressjs CLI Tool A powerful, interactive CLI tool for creating Express.js applications with TypeScript/JavaScript support, Docker integration, and essential development tools setup. [![npm version](https://badge.fury.io/js/%40excli%2Fexpress.svg)](https://badge.fury.io/js/%40excli%2Fexpress) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) ## šŸš€ Quick Start ### Using npx (Recommended) ```bash npx @excli/express ``` ### Global Installation ```bash npm install -g @excli/express excli ``` ## šŸ“‹ Prerequisites - **Node.js** >= 20.0.0 - **npm** / **yarn** / **pnpm** (your choice) - **Git** (optional, for version control) - **Docker** (optional, for containerization) ## šŸŽÆ Getting Started 1. **Create your project:** ```bash npx @excli/express ``` 2. **Navigate to your project:** ```bash cd my-awesome-app ``` 3. **Start development:** **Linux/macOS:** ```bash npm run dev # or yarn dev # or pnpm dev ``` **Windows (TypeScript projects only):** _Open first terminal:_ ```bash npm run build -- --watch ``` _Open second terminal:_ ```bash npm run win:dev ``` _For JavaScript projects on Windows and Linux/MacOs:_ ```bash npm run dev # or yarn dev # or pnpm dev ``` 4. **Open your browser:** Navigate to `http://localhost:3000` šŸŽ‰ > **Note:** The default port is 3000, but you can change it by setting `PORT=6969` in your `.env` ## 🐳 Docker Usage If you selected Docker during setup: ```bash # Start services with Docker Compose npm run db:start # Stop services npm run db:stop ``` Your application will be available at `http://localhost:3000` with the database automatically configured. ## šŸ“ Project Structure ``` my-awesome-app/ ā”œā”€ā”€ node_modules/ ā”œā”€ā”€ public/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ controllers/ │ ā”œā”€ā”€ db/ │ ā”œā”€ā”€ middlewares/ │ ā”œā”€ā”€ models/ │ ā”œā”€ā”€ routes/ │ ā”œā”€ā”€ services/ │ ā”œā”€ā”€ types/ (if typescript) │ ā”œā”€ā”€ utils/ │ ā”œā”€ā”€ app.ts │ ā”œā”€ā”€ constant.ts │ └── main.ts ā”œā”€ā”€ .dockerignore ā”œā”€ā”€ .env ā”œā”€ā”€ .env.example ā”œā”€ā”€ .gitignore ā”œā”€ā”€ .prettierignore ā”œā”€ā”€ .prettierrc ā”œā”€ā”€ compose.yaml ā”œā”€ā”€ Dockerfile ā”œā”€ā”€ package.json └── tsconfig.json (if typescript) ``` ## šŸ› ļø Available Scripts - `npm run dev` - Start development server on Linux/MacOs - `npm run build` - Build for production - `npm run start` - Start production server - `npm run win:dev` - Start development server on Windows (TypeScript) ## šŸ“ License This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details. ## šŸ‘¤ Author **Noman** - šŸ“§ Email: pxycknomdictator@gmail.com - šŸ™ GitHub: [@pxycknomdictator](https://github.com/pxycknomdictator) --- <div align="center" style="margin-top: 20px;"> **šŸš€ Happy Coding! Build something amazing! ⚔** _Made with ā¤ļø by [Noman](https://github.com/pxycknomdictator)_ </div>