This repository provides a scalable and efficient monorepo setup using Turborepo. It includes NestJS for backend services and NextJS for frontend applications, with a suite of tools and libraries configured for seamless development and deployment.
- NestJS backend
- NextJS (v15) frontend
- SWC for fast TypeScript and JavaScript transpilation
- pnpm for efficient dependency management
- JWT Access Token & Refresh Token Authentication for secure API access
- PostgreSQL database with TypeORM
- Nodemailer for email services
- Linting and Formatting pre-configured for code quality
- Micro-Frontend Support with Turborepo
- Shadcn/UI integration for styled components
- Installation
- Getting Started
- Project Structure
- Scripts
- Contributing
- License
Clone the repository:
git clone https://github.com/devaungphyo/turborepo.git
Navigate to the project directory:
cd turborepo
Install dependencies using pnpm:
pnpm install
Getting Started To start the development server, run:
pnpm dev
This will start both the NestJS backend and the Next.js frontend in development mode.
Project Structure The repository is organized into the following structure:
turborepo
├── .husky # Git hooks
├── apps
│ ├── api # NestJS application
│ └── web # NextJS application
├── packages
│ ├── ui # ui/UI component library
│ ├── ts-config # Shared typescript configuration files
│ ├── eslint-config # Shared eslint configuration files
│ └── utils # Shared utility functions
└── turbo.json # Turborepo configuration
The backend is powered by NestJS, with TypeORM configured to use PostgreSQL. JWT access token and refresh token authentication is implemented for secure API access. Nodemailer is used to handle email services.
The frontend is built with NextJS v15, styled with shadcn/UI components. It is optimized for server-side rendering and frontend authentication. Micro-Frontend with Turborepo Using Turborepo, the project supports a micro-frontend architecture, enabling shared libraries and configurations across apps.
- pnpm add:api - Adds a package specifically to the api workspace.
- pnpm add:web - Adds a package specifically to the web workspace.
- pnpm build - Builds both the backend and frontend for production using TurboRepo.
- pnpm changeset - Creates a new changeset for versioning updates.
- pnpm clear:modules - Clears all node_modules in the project using npkill.
- pnpm commit - Opens an interactive commit message interface using Commitizen (cz).
- pnpm dev - Starts both the backend and frontend in development mode using TurboRepo.
- pnpm dev:api - Starts the backend (api) in development mode.
- pnpm dev:web - Starts the frontend (web) in development mode.
- pnpm format - Formats the codebase according to the pre-configured Prettier rules.
- pnpm format:check - Checks the codebase formatting against Prettier rules without modifying files.
- pnpm lint - Lints all code in the repository using TurboRepo.
- pnpm prepare - Runs Husky to set up Git hooks.
- pnpm prod - Starts both the backend and frontend in production mode.
- pnpm test - Runs all tests defined in the repository using TurboRepo.
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.