Production-ready full-stack monorepo with Turborepo, React, Node.js, oRPC, Prisma, Redis, and WebSocket.
# Clone and install (Automated Prisma client generation)
pnpm install
# Setup environment
cp .env.example .env
# Edit .env with your values
# Start databases (requires Docker)
pnpm docker:up
# Run database migrations
pnpm db:migrate
# Seed database
pnpm db:seed
# Start development
pnpm dev# Setup environment
cp .env.example .env
# Start everything in Docker with hot reload
pnpm docker:dev
# Or rebuild and start
pnpm docker:dev:buildFeatures:
- β Hot reload for apps AND packages
- β No local Node.js installation needed
- β Consistent environment across team
- β Changes reflected in 1-3 seconds
Verify Configuration:
# Windows
.\verify-hot-reload.ps1
# Linux/Mac
./verify-hot-reload.shSee README_HOT_RELOAD.md for complete guide.
Open:
- Frontend: http://localhost:5173
- API: http://localhost:3001
- API Health: http://localhost:3001/health
- Prisma Studio: http://localhost:5555
/
βββ apps/
β βββ api/ # Backend API (Hono + Prisma + Redis)
β βββ web/ # Frontend (Vite + React + React Query)
βββ packages/
β βββ types/ # Shared TypeScript types & Zod schemas
β βββ db/ # Shared Database layer (Prisma)
β βββ utils/ # Shared utilities (env, logger)
β βββ ui/ # Shared UI components (shadcn)
βββ docker-compose.yml
βββ turbo.json
βββ pnpm-workspace.yaml
βββ .github/workflows # CI/CD configurations| Layer | Technology |
|---|---|
| Monorepo | Turborepo + pnpm workspaces |
| Frontend | Vite, React 18, TypeScript, React Query, Zustand |
| UI | Tailwind CSS, shadcn/ui, Radix UI |
| Backend | Node.js, Hono, TypeScript |
| RPC | oRPC (type-safe), ArkType validation |
| Database | PostgreSQL, Prisma ORM |
| Cache | Redis (caching, rate limiting, sessions) |
| Auth | JWT, bcrypt, role-based access |
| Realtime | WebSocket with Redis pub/sub |
| Container | Docker, Docker Compose |
| CI/CD | GitHub Actions (Standardized Pipeline) |
| Code Quality | ESLint, Prettier, Commitlint, Lefthook |
# Development
pnpm dev # Start all apps in dev mode
pnpm build # Build all packages and apps (with automated Prisma generation)
pnpm lint # Run linting
pnpm typecheck # Type checking
# Database
pnpm db:generate # Generate Prisma client (triggered automatically on install)
pnpm db:migrate # Run migrations
pnpm db:seed # Seed database
pnpm db:studio # Open Prisma Studio
# Docker
pnpm docker:up # Start all containers
pnpm docker:down # Stop all containers
pnpm docker:build # Build production Docker imagesDefault seeded users:
| Password | Role | |
|---|---|---|
| admin@example.com | admin123 | Admin |
| user@example.com | user1234 | User |
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/auth/me- Get current userPOST /api/auth/logout- LogoutPOST /api/auth/refresh- Refresh token
GET /api/tasks- List tasksGET /api/tasks/:id- Get taskPOST /api/tasks- Create taskPATCH /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
POST /api/upload- Upload fileGET /api/files- List filesDELETE /api/files/:id- Delete file
GET /api/admin/users- List users (admin only)GET /api/admin/users/:id- Get user (admin only)DELETE /api/admin/users/:id- Delete user (admin only)
GET /health- Health checkGET /ready- Readiness check
The project uses multi-stage Docker builds for optimized production images.
# Build and run with Docker Compose
pnpm docker:build
pnpm docker:up
# View logs
docker-compose logs -f apiWe provide a separate, standalone Docker environment for development that includes hot-reloading for both the API and Web applications.
# Start the development environment
pnpm docker:dev
# Rebuild containers (if dependencies change)
pnpm docker:dev:buildAccess services at:
- Web: http://localhost:5173
- API: http://localhost:3001
- Prisma Studio: http://localhost:5555
The pipeline (.github/workflows/ci.yml) automatically:
- Installs dependencies with cached pnpm.
- Generates Prisma client types.
- Runs type-checking across the monorepo.
- Executes linting.
- Builds production Docker images on push to
main.
We use @commitlint/config-conventional with relaxed rules for subjects:
- Type:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. - Scope: Required (e.g.,
feat(api): ...). - Subject: Automated case validation is disabled to support acronyms and technical terms. Max length increased to 200 characters.
| Event | Direction | Description |
|---|---|---|
task.created |
Server β Client | Task created |
task.updated |
Server β Client | Task updated |
task.deleted |
Server β Client | Task deleted |
user.online |
Server β Client | User came online |
user.offline |
Server β Client | User went offline |
presence.list |
Server β Client | Online users list |
See .env.example for all variables. Key ones:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/myorg
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key-min-32-charsSee README_BUN_DENO.md for Bun and Deno support.
# Bun
bun run --filter @myorg/api dev:bun
# Deno
deno run --allow-all apps/api/src/index.deno.ts- Task cache invalidated on create/update/delete
- User cache invalidated on update/delete
- Pattern-based invalidation for lists
- Redis pub/sub for multi-server deployments
- Heartbeat for connection health
- Automatic reconnection on client
- β JWT with configurable expiry
- β Password hashing with bcrypt
- β Role-based access control
- β Rate limiting per IP/user
- β Token blacklist for logout
- β CORS configuration
- β Helmet-like security headers
MIT