A monorepo containing the Nestjs Seed system built with NestJS and Turborepo. This project provides a scalable architecture for handling data triggers and database operations.
This monorepo contains the following applications and packages:
- api - Main Seed NestJS application
- @rumsan/prisma - Shared database package with Prisma integration and NestJS modules
- @workspace/eslint-config - Shared ESLint configurations
- @workspace/typescript-config - Shared TypeScript configurations
Before running this project, make sure you have the following installed:
- Node.js (version 18 or higher)
- pnpm (recommended package manager)
- PostgreSQL database
-
Clone the repository
git clone git@github.com:dipesh-rumsan/turbo-setup.git cd turbo-setup -
Install dependencies
pnpm install
-
Set up environment variables
Copy the environment example files and configure them:
cp apps/api/.env.example apps/api/.env
Update the database configuration in the
.envfile. See the.env.examplefile for required variables. -
Set up the database
# Generate Prisma client pnpm --filter @rumsan/prisma db:generate # Run database migrations pnpm --filter @rumsan/prisma db:migrate
-
Build all packages
pnpm build
-
Start the development server
pnpm dev
The triggers application will be available at http://localhost:8000/v1 with Swagger documentation at http://localhost:8000/swagger.
# Build all packages and apps
pnpm build
# Build specific package
pnpm --filter @rumsan/prisma build
pnpm --filter triggers build# Start all apps in development mode
pnpm dev
# Start specific app
pnpm --filter api dev# Generate Prisma client
pnpm --filter @rumsan/prisma db:generate
# Run migrations
pnpm --filter @rumsan/prisma db:migrate
# Deploy migrations (production)
pnpm --filter @rumsan/prisma db:deploy# Run tests for all packages
pnpm test
# Run tests for specific package
pnpm --filter api testThe project follows a modular architecture with shared packages:
- Database Layer: Centralized database operations using Prisma ORM
- API Layer: RESTful APIs built with NestJS
- Shared Utilities: Common functionality across packages
- Configuration: Centralized ESLint and TypeScript configurations
- Type Safety: Full TypeScript support across all packages
- Database Integration: Prisma ORM with PostgreSQL
- Exception Handling: Comprehensive error handling for database operations
- API Documentation: Auto-generated Swagger documentation
- Logging: Structured logging with Winston
- Development Tools: Hot reload, debugging support, and comprehensive tooling
The packages have the following dependency relationships:
apiapp depends on@rumsan/prisma@rumsan/prismais a standalone package that can be used by multiple applications- Configuration packages are shared across all applications
If you encounter database connection problems:
- Verify your database is running
- Check the environment variables in your
.envfile - Ensure the database URL format is correct
- Run database migrations if needed
If builds fail:
- Clear node_modules and reinstall:
pnpm cleanorrm -rf node_modules && pnpm install - Clear Turborepo cache:
pnpm turbo clean - Rebuild all packages:
pnpm build
If the default port (3000) is in use:
- Update the
PORTenvironment variable in your.envfile - Restart the development server
This project is licensed under the MIT License.