Monorepo containing NestJS API backend and Angular frontend.
📚 See LEARNING.md for a detailed list of concepts and features demonstrated in this project.
├── apps/
│ ├── api/ # NestJS backend API
│ └── web/ # Angular frontend
- Node.js (see
.node-version) - pnpm 9.0.0+
- Install dependencies:
pnpm install- Set up environment variables for the API:
cd apps/api
# Create .env file with your configurationRequired environment variables:
DATABASE_URL- SQLite database file path (e.g.,file:./dev.db)JWT_SECRET- Secret key for JWT token signing
Optional environment variables:
JWT_EXPIRES_IN- JWT access token expiration (default:15m)REFRESH_TOKEN_SECRET- Secret key for refresh token signing (defaults toJWT_SECRETif not set)REFRESH_TOKEN_EXPIRES_IN- Refresh token expiration (default:7d)FRONTEND_URL- Frontend URL for CORS (default:http://localhost:4200)PORT- Server port (default:3000)NODE_ENV- Environment mode (development,production, ortest)
- Generate Prisma Client:
cd apps/api
npx prisma generate- (Optional) Push database schema:
cd apps/api
npx prisma db pushpnpm start:api
# or
pnpm --filter @nest-projects/api start:devpnpm start:web
# or
pnpm --filter @nest-projects/web start# Terminal 1
pnpm start:api
# Terminal 2
pnpm start:webpnpm test:apipnpm test:api:e2epnpm test:web# Install Playwright browsers (first time only)
pnpm test:e2e:install
# Run E2E tests
pnpm test:e2e
# Run E2E tests with UI mode
pnpm test:e2e:uiNote: Make sure both the API (pnpm start:api) and Angular app (pnpm start:web) are running before executing Playwright E2E tests.
pnpm build:apipnpm build:webpnpm build:allOnce the API is running, Swagger documentation is available at: