How socheatathai/express-api works
This is a domain-neutral Express API foundation, currently implementing a health-check endpoint rather than business workflows. A request reaches the versioned router, is dispatched to the health handler, and returns a status and timestamp; unmatched requests and errors pass through app-level middleware. The starter also exposes Swagger documentation and includes a Prisma/PostgreSQL foundation plus an Nginx deployment proxy. Database use by an application feature is not shown, so the graph does not connect persistence to the health workflow.
Main entry points: app.ts Express app · index.ts API v1 router · health.routes.ts Health route · server.ts Server startup
Components 13
HTTP API
- Server startup
src/server.ts - Express app
src/app.ts - API v1 router
src/routes/v1/index.ts - Health route
src/routes/v1/health.routes.ts - Health handler
src/controllers/health.controller.ts - Not-found middleware
src/middleware/not-found.ts - Error handler
src/middleware/error-handler.ts - Swagger documentation
src/docs/openapi.ts
Data Foundation
- Prisma client
src/lib/prisma.ts - Database schema
prisma/schema.prisma - PostgreSQL
Deployment
- Nginx proxy
nginx/default.conf
Other components
- API client
Connections 10
- API client → Express app: sends requests
README.md - Server startup → Express app: starts
src/server.ts - Express app → API v1 router: mounts
src/app.ts - API v1 router → Health route: mounts
src/routes/v1/index.ts - Health route → Health handler: dispatches
src/routes/v1/health.routes.ts - Express app → Not-found middleware: installs
src/app.ts - Express app → Error handler: installs
src/app.ts - Express app → Swagger documentation: serves docs
src/app.ts - Prisma client → PostgreSQL: connects to
src/lib/prisma.ts - Nginx proxy → Express app: forwards traffic
README.md