A production-ready starter template for building full-stack web applications with NestJS backend and Angular frontend. Includes authentication, user management, and common infrastructure patterns.
-
Backend (NestJS)
- JWT-based authentication with refresh tokens
- Role-based access control (Admin, Manager, Regular)
- MongoDB integration with Mongoose
- RESTful API with validation and error handling
- Task scheduling system
- Notifications and alerts
- Circuit breakers and utility services
- Rate limiting and security guards
- Shared contracts library (DTOs, Commands, Queries, Enums)
-
Frontend (Angular 20)
- Admin UI with Angular Material components
- User UI (public-facing application)
- Signals-based state management with local storage
- Tailwind CSS configured
- Shared common UI library
- JWT authentication interceptors
- Node.js (v18 or higher)
- MongoDB (running locally or connection string)
- npm or yarn
-
Install dependencies:
npm install cd frontend && npm install cd ../backend && npm install
-
Configure MongoDB: Update
backend/config/development.tswith your MongoDB connection string:mongoUri: "mongodb://localhost/nest-angular-starter";
-
Initialize database:
cd backend npm run init-db:devThis creates the database and seeds users for each role (Admin, Manager, Regular).
-
Start development servers:
# From project root npm run devOr run individually:
- Backend:
cd backend && npm run start:debug(port 8200) - Admin UI:
cd frontend && npm run start:admin(port 5100) - User UI:
cd frontend && npm run start:user(port 5200)
- Backend:
├── backend/ # NestJS backend (monorepo)
│ ├── src/ # Application modules
│ ├── libs/ # Shared libraries (contracts)
│ └── config/ # Environment configurations
├── frontend/ # Angular workspace
│ ├── projects/
│ │ ├── admin-ui/ # Admin dashboard (Material UI)
│ │ ├── user-ui/ # Public-facing app
│ │ └── common-ui/ # Shared components & services
└── package.json # Root scripts
- Backend config:
backend/config/development.ts(orproduction.ts,stage.ts) - Frontend config: Environment files in
frontend/projects/*/src/environments/ - Shared contracts:
backend/libs/contracts/src/(automatically available in frontend via TypeScript path alias)
Root:
npm run dev- Start all services in development modenpm run dev:admin- Start backend + admin UInpm run dev:user- Start backend + user UInpm run build-prod- Build all for productionnpm run build-stage- Build all for staging
Backend:
npm run start:dev- Development with watch modenpm run start:debug- Development with debuggernpm run init-db:dev- Initialize and seed database
Frontend:
npm run start:admin- Serve admin UInpm run start:user- Serve user UInpm run build-prod:admin- Build admin UI for productionnpm run build-prod:user- Build user UI for production
MIT