A pnpm monorepo with shared Zod validation between frontend and backend.
├── apps/
│ ├── client/ # Next.js + shadcn
│ └── server/ # NestJS + TypeORM
└── packages/
└── shared/ # Zod schemas + types
Make sure you have docker installed on your system. Run the following command
docker-compose up -d --build- Client should be up at http://localhost:3000
- Server should be up at http://localhost:3001
- PgAdmin should be up at http://localhost:5051
Step 1: open http://localhost:5051 in your web browser and login using the following credentials:
Username: admin@admin.com
password: adminStep 2: once the login is done, the dashboard appears with server group. Right click the server group and click Register -> Server. A popup appears.
In the General tab of the popup:
in the name section insert "monorepo"
Then go to Connection tab and insert the following fields:
Hostname/Address = #retrieval given below
Username = devuser
password = devuserpasswordStep 1: To retrieve the Hostname/Address, go to Docker Desktop and expand the server, click on the monorepo-postgres .
Now click Save, you will see the DB Dashboard.
- Shared Validation: Zod schemas work on both frontend and backend
- Type Safety: Types inferred from schemas - single source of truth
- Swagger/OpenAPI: Auto-generated from Zod schemas
- Form Validation: react-hook-form with Zod resolver
| Package | Description |
|---|---|
@repo/shared |
Zod schemas and inferred types |
@repo/client |
Next.js frontend with shadcn/ui |
@repo/server |
NestJS backend with TypeORM |