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 (v11)backendNextJS (v15)frontendSWCfor fast TypeScript and JavaScript transpilationpnpmfor efficient dependency managementJWTAccess Token & Refresh Token Authentication for secure API accessPostgreSQLdatabase with TypeORMNodemailerfor email servicesLintingandFormattingpre-configured for code qualityMicro-FrontendSupport with TurborepoShadcn/UIintegration for styled componentsTailwindcss(v4)integration in@repo/shadcn
- Installation
- Getting Started
- Project Structure
- Scripts
- Contributing
- License
Clone the repository:
git clone https://github.com/devaungphyo/turbo-npn.gitNavigate to the project directory:
cd turbo-npnInstall dependencies using pnpm:
pnpm installGetting Started To start the development server, run:
pnpm devThis 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
├── assets # Assets folder for media assets
├── packages
│ ├── shadcn # shadcn/UI component library
│ ├── ts-config # Shared typescript configuration files
│ ├── eslint-config # Shared eslint configuration files
│ ├── utils # Shared utils functions
└── turbo.json # Turborepo configurationThe 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.
cd packages/shadcnThen run the following command:
pnpm dlx shadcn@latest addThis will add the latest version of shadcn to the UI package.
If you got an error in the UI package, change the import path
// form
import { cn } from '@repo/lib/utils';
// to
import { cn } from '@repo/shadcn/lib/utils';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.

