This is a monorepo template using Turborepo to manage a full-stack application with a NestJS backend and an Angular frontend. It is designed to streamline development, building, and deployment processes with modern tooling and best practices.
- Monorepo Structure: Managed with Turborepo for efficient task orchestration across multiple apps.
- Backend: NestJS application with TypeScript, ESLint, Prettier, and Jest for testing.
- Frontend: Angular application with server-side rendering (SSR), TypeScript, ESLint, and Karma for testing.
- Docker Support: Dockerized services for both frontend and backend with a
docker-compose.ymlfor easy setup. - Code Quality: Prettier for code formatting and ESLint for linting across both apps.
- Dependency Management: Uses PNPM for fast and efficient package management.
- CI/CD: Configured with Dependabot for automated dependency updates.
msaeedsaeedi-turborepo-template/
├── apps/
│ ├── backend/ # NestJS backend application
│ └── frontend/ # Angular frontend application
├── .github/
│ └── dependabot.yml # Dependabot configuration for dependency updates
├── docker-compose.yml # Docker Compose configuration for running services
├── package.json # Root package.json with monorepo scripts
├── pnpm-workspace.yaml # PNPM workspace configuration
├── turbo.json # Turborepo configuration
├── .dockerignore # Docker ignore file
├── .prettierignore # Prettier ignore file
├── .prettierrc # Prettier configuration
-
Clone the repository:
git clone https://github.com/msaeedsaeedi/turborepo-template.git cd turborepo-template -
Install dependencies using PNPM:
pnpm install
Run both the frontend and backend in development mode:
pnpm dev- Frontend: Runs on
http://localhost:4200 - Backend: Runs on
http://localhost:3000
Build both apps for production:
pnpm buildBuild and start the services using Docker Compose:
pnpm docker:build
pnpm docker:startStop the services:
pnpm docker:stopClean up Docker resources:
pnpm docker:pruneRun linting across all apps:
pnpm lintFormat code using Prettier:
pnpm formatRun tests for the backend:
cd apps/backend
pnpm test # Unit tests
pnpm test:e2e # End-to-end tests
pnpm test:cov # Test coverageRun tests for the frontend:
cd apps/frontend
pnpm test # Unit testsClean build artifacts and node_modules:
pnpm clean- Backend: Follow the NestJS deployment documentation or use NestJS Mau for AWS deployment.
- Frontend: Built artifacts are optimized for production and served via Nginx. Use the provided
nginx.conffor routing configuration.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- For NestJS-related questions, visit the NestJS Discord or documentation.
- For Angular-related questions, check the Angular CLI documentation or Angular DevTools.
- For general issues, open a ticket on the GitHub repository.