How bunhourlong/lern works
Lern is a small mobile-and-API starter: the mobile app currently renders a React Native starter screen, while the API exposes a health check. The principal API workflow is an HTTP health request routed to a controller, which asks a service to probe PostgreSQL and Redis and returns a shared health result. The API also has boot-time configuration and infrastructure wiring. The tree and excerpts show no mobile-to-API feature workflow; unsampled contracts and migration details are represented only where their paths and connections are supported.
Main entry points: app.module.ts App composition · health.controller.ts Health endpoint · health.service.ts Dependency probes · health.module.ts Health module
Components 16
Mobile app
- Starter screen
apps/mobile/App.tsx
API runtime
- API bootstrap
apps/api/src/main.ts - App composition
apps/api/src/app.module.ts - Environment config
apps/api/src/shared/config/env.ts - Request IDs
apps/api/src/shared/logging/request-id.ts - Database setup
apps/api/src/shared/database/database.ts - Redis client
apps/api/src/shared/redis/redis.module.ts
Health check
- Health module
apps/api/src/health/health.module.ts - Health endpoint
apps/api/src/health/health.controller.ts - Dependency probes
apps/api/src/health/health.service.ts - Health DTO
apps/api/src/health/dto/health.dto.ts
Shared contracts
- Health contract
packages/contracts/src/health.schema.ts
Other components
- Mobile user
- Health requester
- PostgreSQL
- Redis
Connections 18
- Mobile user → Starter screen: views
- API bootstrap → Environment config: parses
apps/api/src/main.ts - API bootstrap → App composition: creates
apps/api/src/main.ts - App composition → Database setup: configures
apps/api/src/app.module.ts - App composition → Redis client: registers
apps/api/src/app.module.ts - App composition → Health module: registers
apps/api/src/app.module.ts - App composition → Request IDs: configures
apps/api/src/app.module.ts - Database setup → PostgreSQL: configures
apps/api/src/shared/database/database.ts - Redis client → Redis: connects
apps/api/src/shared/redis/redis.module.ts - Health requester → Health endpoint: requests
- Health module → Health endpoint: registers
apps/api/src/health/health.module.ts - Health module → Dependency probes: provides
apps/api/src/health/health.module.ts - Health endpoint → Dependency probes: checks
apps/api/src/health/health.controller.ts - Dependency probes → PostgreSQL: probes
apps/api/src/health/health.service.ts - Dependency probes → Redis: pings
apps/api/src/health/health.service.ts - Health endpoint → Health DTO: serializes with
apps/api/src/health/health.controller.ts - Health endpoint → Health contract: types result
apps/api/src/health/health.controller.ts - Dependency probes → Health contract: returns shape
apps/api/src/health/health.service.ts