How kena-at/fpl_lens works
FPL Lens is a Fantasy Premier League backend API. Its visible workflows include account registration and sign-in, authenticated access to FPL team data, and projection generation and publication; the repository also contains FPL data ingestion and squad optimization capabilities. The README provides no additional product detail, and several route and service implementations were not sampled, so links to those subsystems are limited to relationships visible in the application wiring or source index.
Main entry points: app.py API application · models.py Application database · service.py Projection persistence · auth.py Authentication routes
Components 23
API and identity
- API application
src/fpl_lens/api/app.py - Authentication routes
src/fpl_lens/api/routes/auth.py - Request dependencies
src/fpl_lens/api/deps.py
FPL data
- FPL proxy routes
src/fpl_lens/api/routes/fpl_proxy.py - Internal job routes
src/fpl_lens/api/routes/internal_jobs.py - FPL ingestion
src/fpl_lens/services/ingestion.py - FPL API client
src/fpl_lens/services/fpl_client.py
Projection engine
- Projection routes
src/fpl_lens/api/routes/projections.py - Squad routes
src/fpl_lens/api/routes/squads.py - Projection persistence
src/fpl_lens/engine/service.py - Projection model
src/fpl_lens/engine/projection.py - Playing-time model
src/fpl_lens/engine/playing_time.py - Layer 1 v2
src/fpl_lens/engine/layer1_v2/projection_v2.py - V2 playing time
src/fpl_lens/engine/layer1_v2/playing_time_v2.py - Squad optimizer
src/fpl_lens/engine/optimiser.py
Persistence and services
- Application database
src/fpl_lens/db/models.py - Database session
src/fpl_lens/db/session.py - FPL response cache
src/fpl_lens/services/cache.py - Rate limiter
src/fpl_lens/services/rate_limiter.py - Token service
src/fpl_lens/services/token.py - User backup
src/fpl_lens/services/backup.py
Other components
- API client
- FPL service
Connections 27
- API client → API application: sends requests
- API application → Authentication routes: registers routes
src/fpl_lens/api/app.py - API application → FPL proxy routes: registers routes
src/fpl_lens/api/app.py - API application → Projection routes: registers routes
src/fpl_lens/api/app.py - API application → Squad routes: registers routes
src/fpl_lens/api/app.py - API application → Internal job routes: registers routes
src/fpl_lens/api/app.py - Authentication routes → Request dependencies: uses dependencies
src/fpl_lens/api/routes/auth.py - Authentication routes → Application database: reads and writes
src/fpl_lens/api/routes/auth.py - Authentication routes → Token service: uses tokens
src/fpl_lens/api/routes/auth.py - Request dependencies → Database session: gets sessions
src/fpl_lens/api/deps.py - Request dependencies → Application database: loads users
src/fpl_lens/api/deps.py - Request dependencies → Token service: decodes tokens
src/fpl_lens/api/deps.py - FPL proxy routes → FPL API client: fetches FPL data
src/fpl_lens/api/routes/fpl_proxy.py - FPL proxy routes → FPL response cache: reads and writes
src/fpl_lens/api/routes/fpl_proxy.py - FPL proxy routes → Application database: enriches picks
src/fpl_lens/api/routes/fpl_proxy.py - FPL API client → FPL service: requests data
src/fpl_lens/services/fpl_client.py - FPL API client → Rate limiter: throttles requests
src/fpl_lens/services/fpl_client.py - FPL ingestion → FPL API client: fetches source data
src/fpl_lens/services/ingestion.py - FPL ingestion → Application database: writes FPL data
src/fpl_lens/services/ingestion.py - FPL ingestion → Projection persistence: invokes engine
src/fpl_lens/services/ingestion.py - Internal job routes → Projection persistence: triggers projection job
- Projection persistence → Application database: loads and publishes
src/fpl_lens/engine/service.py - Projection persistence → Projection model: uses model
src/fpl_lens/engine/service.py - Layer 1 v2 → V2 playing time: computes playing time
src/fpl_lens/engine/layer1_v2/projection_v2.py - Projection routes → Projection persistence: requests projections
- Squad routes → Squad optimizer: requests optimization
- User backup → Application database: backs up user data