Skip to main content

Project Structure

NestForge Pro is a Turborepo monorepo with two applications and several shared packages.

Directory layout

nestforge-pro/
├── apps/
│ ├── api/ # NestJS backend
│ │ ├── src/
│ │ │ ├── modules/ # Domain modules (auth, billing, teams, etc.)
│ │ │ ├── common/ # Guards, decorators, filters, interceptors, pipes
│ │ │ ├── config/ # Environment config with Zod validation
│ │ │ ├── database/ # Prisma service and connection management
│ │ │ └── main.ts # Application entrypoint
│ │ ├── test/ # E2E tests
│ │ └── prisma/
│ │ ├── schema.prisma # Database schema
│ │ └── seed.ts # Seed script
│ └── web/ # React frontend (Vite)
│ └── src/
│ ├── pages/ # Route pages (landing, auth, dashboard, admin, billing, settings)
│ ├── components/ # UI components (shadcn/ui, layout, shared)
│ ├── lib/ # API client, auth hooks, utilities
│ └── styles/ # Tailwind CSS styles
├── packages/
│ ├── shared/ # Shared types, constants, and utility functions
│ ├── email-templates/ # React Email templates for transactional email
│ └── config/ # Shared ESLint, TypeScript, and Prettier configs
├── infra/ # AWS CDK infrastructure-as-code
│ ├── lib/ # Stack definitions (VPC, RDS, ECS, S3, monitoring)
│ └── bin/app.ts # CDK app entrypoint
├── .github/workflows/ # CI/CD (lint, test, build, deploy)
├── turbo.json # Turborepo pipeline config
├── package.json # Root package.json with workspaces
└── CLAUDE.md # AI coding context (for Claude Code, Cursor, etc.)

Applications

apps/api -- NestJS Backend

The API is a NestJS 11 application using TypeScript in strict mode. Each domain concern lives in its own module under src/modules/:

  • auth -- JWT authentication, Google OAuth, magic link login
  • users -- User CRUD, profile management, avatar upload
  • billing -- Stripe integration, subscription management, webhook handling
  • teams -- Multi-tenancy with organizations, member invitations, role management
  • admin -- Admin panel API, user management, metrics, impersonation
  • email -- Transactional email via Resend
  • storage -- File uploads with S3 presigned URLs
  • ai -- AI integration layer (optional, uses Vercel AI SDK)
  • health -- Health check endpoints

The src/common/ directory contains cross-cutting concerns: auth guards, role guards, throttle guards, custom decorators (@CurrentUser(), @Roles()), exception filters, and validation pipes.

apps/web -- React Frontend

A React 19 single-page application built with Vite 6. Uses Tailwind CSS v4 for styling and shadcn/ui for the component library. Routing is handled by React Router v7. Server state is managed with TanStack Query.

Shared Packages

PackagePurpose
packages/sharedTypeScript types for API contracts, shared constants (roles, plan tiers), utility functions
packages/email-templatesReact Email templates used by the email module
packages/configShared ESLint, TypeScript, and Prettier configurations

Infrastructure

The infra/ directory contains AWS CDK stacks that deploy the full production environment:

  • VPC -- Networking with public and private subnets
  • Database -- RDS PostgreSQL 16 in a private subnet
  • API -- ECS Fargate behind an Application Load Balancer
  • Storage -- S3 bucket with CloudFront distribution
  • Monitoring -- CloudWatch alarms and dashboards

Tech Stack

LayerTechnology
BackendNestJS 11, TypeScript 5.x (strict)
FrontendReact 19, Vite 6, TypeScript
StylingTailwind CSS v4, shadcn/ui
DatabasePostgreSQL 16, Prisma 6
AuthJWT + Passport.js (email, Google OAuth, magic link)
PaymentsStripe
EmailResend
QueueBullMQ + Redis
InfraAWS CDK (ECS Fargate, RDS, S3, CloudFront)
MonorepoTurborepo
TestingJest, Supertest