New Project — Tạo dự án mới

Scaffold dự án SaaS hoàn chỉnh với monorepo structure, CI/CD pipelines, database setup, authentication, và monitoring.

Cú pháp

/new-project                       # Interactive wizard
/new-project "e-commerce platform" # Scaffold với description

Luồng hoạt động

1

Bước 1: Chọn tech stack

Interactive wizard: frontend framework, backend, database, auth method. Default: Next.js + NestJS + PostgreSQL + JWT (theo CLAUDE.md).
2

Bước 2: Scaffold monorepo

Tạo cấu trúc:
project/
├── apps/web/          # Next.js frontend
├── apps/api/          # NestJS backend
├── packages/shared/   # Shared types, utils
├── infra/             # Docker, CI/CD
└── docs/              # Documentation
3

Bước 3: Setup infrastructure

  • Docker Compose (PostgreSQL + Redis)
  • GitHub Actions (lint, test, build)
  • Environment templates (.env.example)
4

Bước 4: Bootstrap code

  • Auth module (JWT + refresh tokens)
  • Database schema + first migration
  • API health endpoint
  • Frontend layout + auth pages
5

Bước 5: Documentation

  • README với setup instructions
  • CLAUDE.md cho project-specific rules
  • API spec template

Output Structure

my-saas/
├── apps/
│   ├── web/                    # Next.js 14+ App Router
│   │   ├── src/app/
│   │   ├── src/components/
│   │   ├── src/lib/
│   │   └── package.json
│   └── api/                    # NestJS
│       ├── src/modules/
│       ├── src/common/
│       ├── prisma/schema.prisma
│       └── package.json
├── packages/
│   └── shared/                 # Shared types, validations
├── infra/
│   ├── docker-compose.yml
│   └── .github/workflows/
├── docs/
│   └── README.md
├── CLAUDE.md
├── .env.example
└── package.json                # Monorepo root

So sánh: /new-project vs /bootstrap

Tiêu chí/new-project/bootstrap
AudiencePM/Lead — high-level setupDev — hands-on scaffold
CustomizationInteractive wizardDirect implementation
OutputFull monorepo structureAny project type
Includes CI/CDCó (GitHub Actions)Tùy chọn
Includes docsCó (README, CLAUDE.md)

Khi nào dùng / không dùng

DùngKhông dùng
Bắt đầu product mớiThêm feature vào project có sẵn
Cần monorepo SaaS structureProject nhỏ, single-page app
PM setup project cho teamDev muốn scaffold nhanh (dùng /bootstrap)