How phuwanat48/massiveapi works
This NestJS API accepts a validated movers-calculation request, checks stored price history, fetches prices from Polygon/Massive when history is incomplete, computes and ranks movers, persists the latest results, and returns them. The graph follows the sampled controller, service, repository, and API-client calls. Storage entity paths and app registration are visible in the excerpts; Swagger and migration details are documented or present in the tree but their runtime wiring is not fully sampled.
Main entry points: movers.service.ts Calculation and ranking · movers.repository.ts Price and result access · movers.controller.ts Calculate endpoint · app.module.ts Application registration
Components 13
API entry
- Calculate endpoint
src/modules/movers/movers.controller.ts - Request validation
src/modules/movers/dto/calculate-movers.dto.ts - Application registration
src/app.module.ts - Swagger UI
src/main.ts - Root endpoint
src/app.controller.ts - Root greeting
src/app.service.ts
Mover calculation
- Calculation and ranking
src/modules/movers/movers.service.ts
Market data
- Price and result access
src/modules/movers/repositories/movers.repository.ts - Polygon price client
src/modules/movers/services/movers-massive-api.service.ts - Stock price history
src/modules/movers/entities/stock-price.entity.ts - Saved mover results
src/modules/movers/entities/mover-result.entity.ts
Other components
- API client
- Polygon API
Connections 15
- API client → Calculate endpoint: POST calculate
README.md - Calculate endpoint → Request validation: validates body
src/modules/movers/movers.controller.ts - Calculate endpoint → Calculation and ranking: calls calculate
src/modules/movers/movers.controller.ts - Calculation and ranking → Price and result access: checks history
src/modules/movers/movers.service.ts - Calculation and ranking → Polygon price client: fetches if incomplete
src/modules/movers/movers.service.ts - Polygon price client → Polygon API: requests prices
src/modules/movers/services/movers-massive-api.service.ts - Calculation and ranking → Price and result access: upserts fetched prices
src/modules/movers/movers.service.ts - Price and result access → Stock price history: reads and writes
src/modules/movers/repositories/movers.repository.ts - Calculation and ranking → Price and result access: loads comparisons
src/modules/movers/movers.service.ts - Calculation and ranking → Price and result access: saves ranked results
src/modules/movers/movers.service.ts - Price and result access → Saved mover results: replaces latest results
src/modules/movers/repositories/movers.repository.ts - Application registration → Calculate endpoint: registers module
src/app.module.ts - Application registration → Root endpoint: registers controller
src/app.module.ts - Root endpoint → Root greeting: calls greeting
src/app.controller.ts - API client → Swagger UI: opens API docs
README.md