How sachinparulkar270886/sezzle_home_assessment works
Sezzle Weather Service is a FastAPI application for current-city weather lookups. A browser or API client submits a city; the API validates it and calls the weather service, which checks Redis, queries Open-Meteo on a miss, normalizes the result, and records successful responses in MySQL. The service also provides health/readiness checks, request protections, structured logs, and Prometheus metrics. The graph reflects the shown source and README; some startup wiring and operational details are documented but not fully excerpted.
Main entry points: main.py FastAPI Routes · weather.py Weather Service · cache.py Weather Cache · database.py Weather Repository
Components 12
HTTP API
- FastAPI Routes
app/main.py - Service Settings
app/config.py
Weather Lookup
- Weather Service
app/weather.py - Weather Models
app/schemas.py - Open-Meteo
Persistence
- Weather Cache
app/cache.py - Redis
- Weather Repository
app/database.py - MySQL Logs
Operations
- Metrics and Logging
app/observability.py
Other components
- Browser / Client
- Prometheus
Connections 17
- Browser / Client → FastAPI Routes: requests weather
README.md - FastAPI Routes → Service Settings: uses settings
app/main.py - FastAPI Routes → Weather Service: requests lookup
app/main.py - FastAPI Routes → Weather Models: validates response
app/main.py - FastAPI Routes → Weather Cache: checks readiness
app/main.py - FastAPI Routes → Weather Repository: checks readiness
app/main.py - FastAPI Routes → Metrics and Logging: installs request metrics
app/main.py - Weather Service → Weather Cache: reads and writes
app/weather.py - Weather Cache → Redis: stores entries
app/cache.py - Weather Service → Open-Meteo: fetches conditions
app/weather.py - Weather Service → Weather Models: builds response
app/weather.py - Weather Service → Weather Repository: records result
app/weather.py - Weather Repository → MySQL Logs: persists response
README.md - Weather Cache → Metrics and Logging: records cache events
app/cache.py - Weather Service → Metrics and Logging: records provider events
app/weather.py - Weather Repository → Metrics and Logging: records DB events
app/database.py - Prometheus → FastAPI Routes: scrapes metrics
README.md