This repository demonstrates a modern Turborepo monorepo setup with full-stack TypeScript, Prisma, Next.js, and shared tooling.
Clone the repo and install dependencies:
git clone https://github.com/AnassAb/monorepo_example.git
cd monorepo_example
npm install
apps/api
)Create a file at apps/api/.env
with the following variables:
DATABASE_URL=your_postgres_connection_string
PORT=8080 [or whatever port you want]
DATABASE_URL
: Your PostgreSQL connection string for Prisma.PORT
: The port your API server will run on (default: 8080).apps/web
)Create a file at apps/web/.env
with the following variable:
NEXT_PUBLIC_API_URL=http://localhost:8080
NEXT_PUBLIC_API_URL
: The URL where your API server is running..env
file as shown above and set your DATABASE_URL
.npx prisma migrate dev --name "your_migration_name" [this will migrate your db and generate a prisma client for you]
To start all apps and packages in development mode:
npm run dev
apps/
api/ # NestJS + tRPC + Prisma API
web/ # Next.js frontend
packages/
types/ # Shared TypeScript types and Zod schemas
eslint-config/ # Shared ESLint config
typescript-config/ # Shared tsconfig.json
Script | Description |
---|---|
npm run dev |
Run all apps/packages in dev mode |
npm run build |
Build all apps/packages |
npm run lint |
Lint all code |
npm run format |
Format all code with Prettier |
npm run generate |
Generate Prisma client |
npm run check-types |
Type-check all packages |
MIT