790 B
790 B
ADR-002: TypeScript + Express for API
Status
Accepted
Context
The API server needs to be fast to develop, type-safe, and maintainable.
Decision
Use TypeScript with Express.js, Drizzle ORM, and PostgreSQL.
Rationale
- TypeScript provides end-to-end type safety when shared with the frontend
- Express is mature, well-documented, and sufficient for a REST API
- Drizzle ORM is lightweight, type-safe, and generates SQL directly
- Zod provides runtime request validation that aligns with TypeScript types
- bcrypt for password hashing, JWT for auth tokens
Consequences
- API and web share the
@fleetforge/sharedpackage - Drizzle migrations are SQL-based, version-controlled in
infrastructure/migrations/ - No ORM overhead from heavier alternatives (Prisma, TypeORM)