How ua-academy-projects/push-and-pray works
Oil Price Tracker collects WTI, Brent, and RBOB prices on a UTC schedule, persists them through a durable queue, and presents saved market data and interactive analysis in a browser. The principal path is Fetcher → PGMQ → History → PostgreSQL; browser reads and preferences pass through the UI Service. The README documents chart controls, retry/idempotency behavior, and session expiry. History’s consumer implementation was not sampled, so its documented queue and persistence actions are shown without inferring internal call details.
Main entry points: main.py UI Service · migrations PostgreSQL · compose_project Compose deployment · service.go Collection service
Components 18
Price collection
- UTC schedule
services/fetcher/internal/schedule/schedule.go - Fetcher runtime
services/fetcher/cmd/fetcher/main.go - Collection service
services/fetcher/internal/service/service.go - Price provider
services/fetcher/internal/provider/provider.go - PGMQ publisher
services/fetcher/internal/pgmq/publisher.go
History and storage
- PGMQ queue
database/migrations/004_create_pgmq_queue.sql - History consumer
services/history/src/history_service/messaging.py - History API
services/history/src/history_service/main.py - Observation repository
services/history/src/history_service/repository.py - PostgreSQL
database/migrations
Browser experience
- UI Service
services/ui/backend/src/ui_service/main.py - Session store
services/ui/backend/src/ui_service/session_store.py - React application
services/ui/frontend/src/App.tsx - Frontend API client
services/ui/frontend/src/api.ts - Interactive charts
services/ui/frontend/src/ChartPanel.tsx
Runtime infrastructure
- Compose deployment
infrastructure/ansible/oilscope/platform/roles/compose_project
Other components
- OilPriceAPI
- Research user
Connections 21
- Fetcher runtime → UTC schedule: selects slots
- Fetcher runtime → Collection service: runs collection
- Collection service → Price provider: fetches prices
- Price provider → OilPriceAPI: requests batch
- Collection service → PGMQ publisher: publishes observations
- PGMQ publisher → PostgreSQL: claims event key
- PGMQ publisher → PGMQ queue: sends event
- PGMQ queue → History consumer: delivers messages
- History consumer → PostgreSQL: persists and archives
- History API → Observation repository: queries observations
- Observation repository → PostgreSQL: reads and writes
- Research user → React application: uses analysis
- React application → Frontend API client: loads and saves
- Frontend API client → UI Service: requests data
- UI Service → History API: proxies reads
- UI Service → Session store: manages preferences
- Session store → PostgreSQL: reads and writes sessions
- React application → Interactive charts: renders series
- Compose deployment → Fetcher runtime: deploys service
- Compose deployment → History API: deploys service
- Compose deployment → UI Service: deploys service