feat: scaffold monorepo with Turborepo + NestJS + Next.js

- Turborepo monorepo with pnpm workspaces
- apps/api: NestJS 11.x with CQRS module
- apps/web: Next.js 14 App Router + TailwindCSS
- src/modules/shared: base entities, Result pattern, value objects
- TypeScript 5.7+ strict mode, shared tsconfig base
- Build pipeline: dev, build, lint, test, typecheck

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-07 23:52:33 +07:00
commit e1e5fa6252
52 changed files with 6110 additions and 0 deletions

86
docs/dev-environment.md Normal file
View File

@@ -0,0 +1,86 @@
# Development Environment
## Prerequisites
- Docker Engine 24+ & Docker Compose v2
- Node.js 22 LTS (for running app services locally)
## Quick Start
```bash
# 1. Copy environment variables
cp .env.example .env
# 2. Start all infrastructure services
docker compose up -d
# 3. Verify all services are healthy
docker compose ps
```
## Services
| Service | Port(s) | Description | Dashboard/UI |
| ---------- | ------------ | ------------------------------ | ------------------------------- |
| PostgreSQL | 5432 | Database with PostGIS | — |
| Redis | 6379 | Cache, sessions, queue | — |
| Typesense | 8108 | Full-text search engine | http://localhost:8108/health |
| MinIO | 9000 / 9001 | S3-compatible object storage | http://localhost:9001 (console) |
## Common Commands
```bash
# Start services
docker compose up -d
# View logs (all or specific service)
docker compose logs -f
docker compose logs -f postgres
# Stop services (data preserved in volumes)
docker compose down
# Stop and remove all data
docker compose down -v
# Restart a single service
docker compose restart redis
# Check service health
docker compose ps
```
## Connecting to Services
### PostgreSQL
```bash
# Via psql
psql postgresql://goodgo:goodgo_secret@localhost:5432/goodgo
# Verify PostGIS
psql postgresql://goodgo:goodgo_secret@localhost:5432/goodgo -c "SELECT PostGIS_Version();"
```
### Redis
```bash
redis-cli -p 6379 ping
```
### Typesense
```bash
curl http://localhost:8108/health
```
### MinIO
- API: `http://localhost:9000`
- Console: `http://localhost:9001` (login: minioadmin / minioadmin_secret)
## Troubleshooting
- **Port conflict**: Change ports in `.env` (e.g., `DB_PORT=5433`)
- **Permission issues**: Run `docker compose down -v` and restart
- **PostGIS not available**: Ensure using `postgis/postgis:16-3.4` image