Monorepo & Self-Contained App Structure
ClauseShield uses npm workspaces ("workspaces": ["apps/*"]) in the root package.json.
Why Each App Is Self-Contained
Rather than maintaining a separate packages/shared build step, each app owns its own src/shared/ directory:
apps/api/src/shared/(brand.ts,types.ts,index.ts)apps/web/src/shared/(brand.ts,types.ts,seo-data.ts,index.ts)apps/admin/src/shared/(brand.ts,types.ts,index.ts)
This ensures:
- Zero cross-package build failures on Vercel, AWS Amplify, or AWS SAM.
- Independent deployments — you can deploy
apps/apito AWS Lambda without bundling frontend code. - Single-file rebranding — update
BRANDinbrand.tsto rename the product or switch domains.
Root Scripts
| Command | Description |
|---|---|
npm run dev | Starts api (4000), web (3000), admin (3001), and docs (3002) concurrently |
npm run dev:api | Runs NestJS backend in watch mode |
npm run dev:web | Runs User Next.js frontend |
npm run dev:admin | Runs Admin Next.js panel |
npm run dev:docs | Runs Docusaurus documentation server |
npm run build | Builds all 4 workspaces |