How mostikov/express-typescript-boilerplate works
This is a minimal Express/TypeScript server scaffold. Its visible request workflow configures middleware, dispatches /public-api/health-check to a controller, and handles unmatched routes and errors. Startup also initializes a service vault containing a Redis service. The health-check implementation, Redis implementation, and entrypoint wiring were not sampled, so their internal behavior and connections are not inferred.
Main entry points: app.ts Express app · services/index.ts Service initializer · public-api/index.ts Public router · healthCheck.ts Health controller
Components 14
HTTP server
- Express app
src/app.ts - CORS middleware
src/app.ts - JSON parser
src/app.ts - Public router
src/routes/public-api/index.ts - Health controller
src/controllers/public/healthCheck.ts - Not-found route
src/routes/routeNotFound.ts
Service registry
- Service initializer
src/services/index.ts - Service vault
src/services/servicesVault.ts - Service contract
src/types/baseService.ts - Redis service
src/services/redis.service.ts
Shared infrastructure
- Error handler
src/middlewares/errorHandler.middleware.ts - Application errors
src/types/errors.types.ts
Other components
- HTTP client
- HTTP response
Connections 13
- HTTP client → Express app: sends request
- Express app → CORS middleware: applies
- Express app → JSON parser: parses JSON
- Express app → Public router: mounts
- Public router → Health controller: dispatches
- Health controller → HTTP response: sends health result
- Express app → Not-found route: falls through
- Express app → Error handler: handles errors
- Error handler → Application errors: checks
- Express app → Service initializer: initializes services
- Service initializer → Service vault: creates
- Service initializer → Redis service: registers
- Service vault → Service contract: stores contract