A production-grade REST API built with tRPC, Express, and TypeScript following Contract-Driven Development (CDD) principles.
- ✅ Type-safe API with tRPC
- ✅ OpenAPI documentation generation
- ✅ Contract-driven development
- ✅ Express.js HTTP server
- ✅ TypeScript for type safety
- ✅ Zod schema validation
- Node.js 18+
- pnpm (recommended) or npm
# Install dependencies
pnpm install
# Copy environment variables template (if exists)
cp .env.example .env# Start development server with auto-reload
pnpm run devThe server will start on http://localhost:3000
# Build the project
pnpm run build
# Start production server
pnpm run startsrc/
├── index.ts # Entry point
└── server/
├── context.ts # tRPC context
├── index.ts # Router setup
├── trpc.ts # tRPC initialization
└── routes/ # API route handlers
└── todo/
├── models.ts
└── todo.routes.ts
Once running, OpenAPI/Swagger documentation is available at:
http://localhost:3000/api-docs
pnpm run dev- Start development serverpnpm run build- Build for productionpnpm run start- Start production server
- tRPC - Type-safe RPC framework
- Express.js - Web server
- TypeScript - Type safety
- Zod - Schema validation
- OpenAPI - API documentation
MIT