How rootfish-io/discountsforsteam works
Discounts For Steam presents Steam game deals from a PostgreSQL-backed API. The main user workflow loads paginated games in the React app, fetches them from the FastAPI endpoint, and renders the results. A separate ingestion path fetches deal pages from CheapShark and upserts them into the database; the scheduler invokes that updater, though the backend lifespan currently leaves its scheduler task commented out. The README is empty, so capabilities and links here are limited to the provided tree and source excerpts.
Main entry points: App.tsx Page state · database.py Database pool · GameList.tsx Game list · main.py FastAPI service
Components 16
Web interface
- React entry
frontend/src/main.tsx - Page state
frontend/src/App.tsx - Brand header
frontend/src/components/Header.tsx - Search controls
frontend/src/components/SearchGame.tsx - Pagination
frontend/src/components/Pagination.tsx - Loading view
frontend/src/components/GameSkeleton.tsx - Game list
frontend/src/components/GameList.tsx - Deal card
frontend/src/components/GameItem.tsx - Game types
frontend/src/types/game.ts
API service
- FastAPI service
backend/main.py
Deal ingestion
- Update scheduler
backend/tasks/scheduler.py - Deal updater
backend/tasks/update_games.py
Data storage
- Database pool
backend/database.py
Other components
- Visitor
- PostgreSQL
- CheapShark API
Connections 19
- Visitor → React entry: opens app
frontend/src/main.tsx - React entry → Page state: renders
frontend/src/main.tsx - Page state → Brand header: renders
frontend/src/App.tsx - Page state → Search controls: renders
frontend/src/App.tsx - Page state → Pagination: renders
frontend/src/App.tsx - Page state → Loading view: renders
frontend/src/App.tsx - Page state → Game list: renders
frontend/src/App.tsx - Pagination → Page state: calls callback
frontend/src/components/Pagination.tsx - Game list → Deal card: renders
frontend/src/components/GameList.tsx - Page state → Game types: uses types
frontend/src/App.tsx - Game list → Game types: uses types
frontend/src/components/GameList.tsx - Deal card → Game types: uses types
frontend/src/components/GameItem.tsx - Page state → FastAPI service: fetches games
frontend/src/App.tsx - FastAPI service → Database pool: queries pool
backend/main.py - FastAPI service → Database pool: connects and closes
backend/main.py - Database pool → PostgreSQL: opens pool
backend/database.py - Update scheduler → Deal updater: runs update
backend/tasks/scheduler.py - Deal updater → CheapShark API: fetches deals
backend/tasks/update_games.py - Deal updater → Database pool: upserts and prunes
backend/tasks/update_games.py