A monorepo containing the BWL platform built with Nx, featuring a Next.js frontend and NestJS backend.
- Framework: Next.js 15 (App Router)
- Language: TypeScript 5.x
- Styling: Tailwind CSS
- UI Components: HeroUI v3
- State Management: TanStack Query
- Testing: Vitest + React Testing Library
- Framework: NestJS 10.x
- Language: TypeScript 5.x
- ORM: TypeORM with PostgreSQL
- Authentication: Passport.js (JWT + OTP)
- API Documentation: Swagger
- Job Queue: BullMQ
- Email: Nodemailer with Handlebars
- Testing: Jest + TestingModule
- Monorepo Tool: Nx 22.x
- Package Manager: pnpm 10.x
- Linting: ESLint + Prettier
bwl-v2/
├── apps/
│ ├── web/ # Next.js frontend
│ │ ├── src/
│ │ │ ├── app/ # App router pages
│ │ │ ├── components/ # React components
│ │ │ ├── hooks/ # Custom hooks
│ │ │ ├── services/ # API services
│ │ │ ├── stores/ # State stores
│ │ │ ├── schemas/ # Zod schemas
│ │ │ ├── types/ # TypeScript types
│ │ │ └── utils/ # Utilities
│ │ └── ...
│ └── server/ # NestJS backend
│ ├── src/
│ │ ├── base/ # Shared utilities
│ │ ├── configs/ # Configuration
│ │ ├── constants/ # Global constants
│ │ ├── enums/ # Global enums
│ │ ├── migrations/ # TypeORM migrations
│ │ ├── modules/ # Feature modules
│ │ └── templates/ # Email templates
│ └── ...
├── libs/
│ └── utils/ # Shared utilities library
├── docs/ # Documentation
│ ├── BWLV2_SERVER.MD # Server documentation
│ └── BWLV2_WEB.MD # Web documentation
├── .agents/
│ ├── rules/ # Project rules
│ └── skills/ # Project skills
├── nx.json # Nx configuration
├── package.json # Root package.json
└── tsconfig.base.json # Base TypeScript config
- Node.js 18+
- pnpm 10.x
- PostgreSQL (for server)
- Redis (for job queues)
# Install dependencies
pnpm install
# Copy environment files
cp apps/web/.env.example apps/web/.env
cp apps/server/.env.example apps/server/.env# Run both apps in development mode
pnpm dev
# Run only web (frontend)
pnpm dev:web
# Run only server (backend)
pnpm dev:server
# Run server with migration
pnpm migration:run# Build all apps
pnpm build
# Build only web
pnpm build:web
# Build only server
pnpm build:server# Run all tests
pnpm test
# Run web tests only
pnpm test:web
# Run server tests only
pnpm test:server
# Run web tests in watch mode
pnpm test:web:watch# Lint all apps
pnpm lint
# Type check all apps
pnpm type-check# Run pending migrations
pnpm migration:run
# Generate a new migration
pnpm migration:generate src/migrations/MigrationName
# Revert last migration
pnpm migration:revert- Server Documentation - Backend API, entities, services, patterns
- Web Documentation - Frontend components, hooks, state management
- Server Rules - Server conventions
- Server Skill - Server development guide
- Web Rules - Web conventions
- Web Skill - Web development guide
When the server is running, Swagger documentation is available at:
http://localhost:3000/api/docs
NEXT_PUBLIC_API_URL=http://localhost:3000/api
NEXT_PUBLIC_APP_URL=http://localhost:3001# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=password
DATABASE_NAME=bwl
# JWT
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=7d
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# Mail
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USER=user
MAIL_PASSWORD=password| Script | Description |
|---|---|
pnpm dev |
Run both apps in dev mode |
pnpm build |
Build all apps |
pnpm test |
Run all tests |
pnpm lint |
Lint all apps |
pnpm type-check |
Type check all apps |
pnpm migration:run |
Run database migrations |
pnpm clean |
Remove build artifacts |
MIT