How nikolas452/crypto-tracker works
This repository is the Stage 0 foundation of a Crypto Tracker API: it starts an Express service, validates configuration, connects MongoDB, and exposes liveness/readiness checks with consistent request logging and error handling. The documented future polling, crypto-data, authentication, watchlist, and alert features are explicitly not part of this stage, so they are omitted. Readiness behavior is documented, but its implementation was not sampled; the graph shows only the supported relationship to its health module.
Main entry points: app.ts Express app · server.ts Process entrypoint · errorHandler.ts Error handler · logger.ts Application logger
Components 15
Startup and config
- Process entrypoint
src/server.ts - Validated config
src/config/env.ts
HTTP service
- Express app
src/app.ts - Health routes
src/routes/health.routes.ts - Request IDs
src/middlewares/requestId.ts - Request logging
src/middlewares/requestLogger.ts - Not-found handler
src/middlewares/notFoundHandler.ts - Error handler
src/middlewares/errorHandler.ts
Infrastructure support
- Readiness checks
src/lib/health.ts - Error types
src/lib/errors.ts - Application logger
src/lib/logger.ts - Mongo connection
src/db/connect.ts
Other components
- Runtime environment
- HTTP client
- MongoDB
Connections 20
- Runtime environment → Validated config: provides environment
- Process entrypoint → Validated config: reads config
- Process entrypoint → Application logger: logs lifecycle
- Process entrypoint → Mongo connection: connects / disconnects
- Mongo connection → MongoDB: connects
- Process entrypoint → Express app: creates after connect
- Process entrypoint → HTTP client: listens for requests
- HTTP client → Process entrypoint: sends HTTP requests
- Express app → Request IDs: registers middleware
- Express app → Request logging: registers middleware
- Express app → Health routes: mounts routes
- Express app → Not-found handler: registers fallback
- Express app → Error handler: registers last
- Health routes → Readiness checks: runs readiness checks
- Readiness checks → MongoDB: checks connectivity
- Error handler → Error types: handles app errors
- Error handler → Request IDs: reads request ID
- Error handler → Application logger: logs failures
- Request logging → Application logger: logs requests
- Not-found handler → Error types: creates not-found error