# Node Project Gen โก
> **Lightning-fast Node.js backend scaffolding CLI built in Rust.**
Node Project Gen allows you to generate production-ready, scalable, and secure Node.js backends in seconds. It bridges the gap between simple boilerplate and complex enterprise frameworks by providing opinionated architectural patterns and modern best practices out of the box.



---
## ๐ Speed Demo
Node Project Gen scaffolds a complete project with authentication, database integration, logging, validation, and Docker support in **less than 1 second**.
## โจ Features
- **Blazing Fast**: Compiled Rust binary for near-instant execution.
- **Multiple Architectures**: Clean Architecture, MVC, Modular, Hexagonal, and Microservices.
- **Framework Support**: Express, Fastify, and NestJS.
- **Database Ready**: PostgreSQL, MongoDB, MySQL, and SQLite (Prisma, Mongoose, Sequelize, TypeORM).
- **Batteries Included Auth**: JWT, Sessions, OAuth (Google/GitHub), and Firebase.
- **Production Grade**:
- ๐ก๏ธ **Security**: Helmet, HPP, Rate-limiting.
- ๐ **Logging**: Winston or Pino.
- โ
**Validation**: Zod or Joi.
- ๐งช **Testing**: Jest or Vitest.
- ๐ณ **DevOps**: Docker, Docker Compose, and GitHub Actions CI/CD.
- ๐ **API Docs**: Swagger (OpenAPI 3.0) integration.
---
## ๐ฆ Installation
### Via Cargo
```bash
cargo install node-project-gen
```
### Via NPM
```bash
npx node-project-gen create my-api
```
---
## ๐ Usage
### Create a New Project
The `create` command is the main entry point for scaffolding.
```bash
# Basic project
node-project-gen create my-api
# Custom project with specific stack
node-project-gen create my-api \
--arch clean \
--framework express \
--db postgres \
--auth jwt \
--test vitest
```
**Options:**
- `--arch`: `clean`, `mvc`, `modular`, `hexagonal`, `microservice`
- `--framework`: `express`, `fastify`, `nest`
- `--db`: `postgres`, `mongodb`, `mysql`, `sqlite`
- `--auth`: `jwt`, `session`, `oauth`, `firebase`
- `--test`: `jest`, `vitest`
- `--validation`: `zod`, `joi`
- `--logger`: `winston`, `pino`
- `--skip-install`: Skip automatic `npm install`
- `--git`: Initialize git repository (default: true)
### Generate Modules
Generate new resources or components in an existing project.
```bash
# Generate a full CRUD module
node-project-gen generate module users --crud
# Generate middleware
node-project-gen generate middleware auth
```
### Add Features
Easily add complex configurations to an existing project.
```bash
node-project-gen add docker
node-project-gen add swagger
node-project-gen add cicd
node-project-gen add websocket
```
---
## ๐ Architecture Overview
Node Project Gen supports multiple patterns. For example, the **Clean Architecture** layout:
```text
src/
โโโ domain/ # Entities & Business Rules
โโโ application/ # Use Cases & Services
โโโ infrastructure/ # DB, Repositories, External Services
โโโ presentation/ # Controllers, Routes, Validators
โโโ core/ # Shared interfaces & global errors
```
While the **Modular** layout organizes by domain:
```text
src/
โโโ modules/
โ โโโ auth/ # Controllers, Services, Routes for Auth
โ โโโ user/ # Controllers, Services, Routes for User
โ โโโ health/ # Health check module
โโโ shared/ # Shared utils & middleware
โโโ core/ # Core configs
```
---
## ๐ Built With
- [Clap](https://clap.rs/) - Command Line Argument Parser
- [Serde](https://serde.rs/) - Serialization/Deserialization
- [Colored](https://github.com/mackwic/colored) (via ANSI) - ANSI Escape Codes for UI
- [Tokio](https://tokio.rs/) (Logic-only) - Optional Async features
---
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Generated with โค๏ธ by [Acrocoder](https://github.com/Naimish-Kumar/nodegen-cli)