Skip to content

Nader-SH/create-flex-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-stack-cli

A comprehensive CLI tool for generating fullstack TypeScript boilerplates with VMC (View, Model, Controller) architecture.

⚡ Quick Start

npx create-stack-cli my-app

That's it! No installation needed. The CLI will guide you through the setup process.

🚀 Features

Backend Frameworks

  • ExpressJS (Fully Implemented)
  • ⏳ NestJS (Stub - Coming Soon)
  • ⏳ Fastify (Stub - Coming Soon)
  • ⏳ Hono (Stub - Coming Soon)
  • ⏳ Koa (Stub - Coming Soon)
  • ⏳ AdonisJS (Stub - Coming Soon)
  • ⏳ tRPC (Stub - Coming Soon)
  • ⏳ Apollo GraphQL (Stub - Coming Soon)

Databases

  • PostgreSQL ⭐ (Default)
  • MySQL
  • MariaDB
  • SQLite
  • SQL Server
  • MongoDB
  • Firestore
  • DynamoDB
  • CouchDB
  • SurrealDB
  • EdgeDB
  • FaunaDB
  • Redis (Cache)

ORMs

  • Prisma ⭐ (Default for SQL)
  • Sequelize
  • TypeORM
  • Drizzle ORM
  • Knex.js
  • Mongoose ⭐ (MongoDB)

Frontend Frameworks

  • React (Fully Implemented)
  • ⏳ Next.js (Stub)
  • ⏳ Vue 3 (Stub)
  • ⏳ Nuxt 3 (Stub)
  • ⏳ Angular (Stub)

UI Libraries

  • shadcn/ui ⭐ (React/Next.js)
  • Material UI
  • Chakra UI
  • Ant Design
  • TailwindCSS ⭐
  • Mantine
  • Radix UI
  • Vuetify ⭐ (Vue/Nuxt)
  • Naive UI
  • Element Plus
  • Angular Material ⭐

State Management

  • Zustand ⭐ (React)
  • Redux Toolkit
  • Jotai
  • Recoil
  • Pinia ⭐ (Vue)
  • Vuex
  • NgRx (Angular)

Validation Libraries

  • Zod ⭐ (Default)
  • Yup
  • Joi
  • Valibot
  • Ajv
  • class-validator (NestJS)

Features

  • ✅ User Module
  • ✅ Auth Module (JWT + Refresh Tokens)
  • ✅ File Upload Module
  • ✅ Rate Limiting
  • ✅ Caching Layer (Redis)
  • ✅ RBAC / ACL
  • ✅ Swagger Documentation
  • ✅ Docker + docker-compose
  • ✅ Testing Setup (Jest)
  • ⏳ CI/CD (GitHub Actions) - Coming Soon

📦 Installation

⚠️ Important: This is a CLI tool, not a regular npm package. Do NOT use npm i create-stack-cli (it won't work).

Option 1: Using npx (Recommended) ⭐

No installation needed! Just run:

npx create-stack-cli my-app

This is the recommended way - it downloads and runs the CLI without installing anything.

Option 2: Global Installation

If you plan to use it frequently, install globally:

npm install -g create-stack-cli

Then use it from anywhere:

create-stack-cli my-app

❌ Don't Use

# ❌ This won't work - don't use this!
npm i create-stack-cli

This installs the package locally but won't make the CLI command available. Use npx or global installation instead.

🎯 Usage

npx create-stack-cli my-app

The CLI will guide you through:

  1. Backend framework selection
  2. Database selection
  3. ORM selection
  4. Frontend framework selection (optional)
  5. UI library selection
  6. State management selection
  7. Additional features configuration

📁 Generated Project Structure

my-app/
├── backend/
│   ├── src/
│   │   ├── controller/     # Request handlers
│   │   ├── modal/          # Business logic + ORM
│   │   ├── view/           # DTO transformations
│   │   ├── routes/         # Route definitions
│   │   ├── middleware/     # Custom middleware
│   │   ├── config/         # Configuration files
│   │   └── validation/     # Validation schemas
│   ├── prisma/             # Prisma schema (if using Prisma)
│   ├── package.json
│   ├── tsconfig.json
│   └── .env.example
├── frontend/               # Frontend application
├── docker-compose.yml      # Docker configuration
└── README.md

🏗️ Architecture

The generated backend follows VMC Architecture:

  • View Layer: Transforms data models to DTOs for API responses
  • Model Layer: Handles business logic and database operations
  • Controller Layer: Handles HTTP requests, validation, and responses

🛠️ Development

Backend

cd my-app/backend
npm install
npm run dev

Frontend

cd my-app/frontend
npm install
npm run dev

Database Migrations (Prisma)

cd my-app/backend
npx prisma migrate dev
npx prisma studio  # Open Prisma Studio

📚 API Documentation

If Swagger is enabled, access documentation at:

http://localhost:3000/docs

🐳 Docker

docker-compose up -d

✅ What's Fully Implemented

  1. Express Backend Generator

    • Complete VMC architecture
    • Prisma/Mongoose/TypeORM/Sequelize/Drizzle/Knex support
    • User & Auth modules
    • File upload, rate limiting, caching, RBAC
    • Swagger documentation
    • Jest testing setup
  2. React Frontend Generator

    • Vite setup
    • TailwindCSS integration
    • Router setup
    • State management integration (Zustand/Redux)
  3. Docker Support

    • docker-compose.yml
    • Backend Dockerfile
    • Frontend Dockerfile (for React)
  4. Project Configuration

    • Root README generation
    • .gitignore
    • Environment variable templates

🚧 Coming Soon

  • Full implementation for other backend frameworks
  • Next.js, Vue 3, Nuxt 3, Angular frontend generators
  • CI/CD templates (GitHub Actions)
  • More comprehensive testing examples
  • Additional feature modules

📝 License

MIT

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

create-flex-stack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published