How besteaydogan/recoengine works
RecoEngine streams product-view events into PostgreSQL, then serves user history, personalized recommendations, and ETL-calculated bestsellers through FastAPI to a React dashboard. The graph includes event ingestion, scheduled bestseller computation, API/cache and frontend layers. Some wiring—especially simulator-to-producer and frontend HTTP calls—is documented at a high level; unsampled details are not inferred beyond that evidence.
Main entry points: endpoints.py HTTP endpoints · database.py Async DB access · consumer.py Event consumer · etl.py Bestseller ETL
Components 20
Event ingestion
- Kafka producer
kafka_stream/producer.py - Kafka broker
- Event consumer
kafka_stream/consumer.py
Persistence and ETL
- Async DB access
database.py - ORM entities
api/orm_models.py - PostgreSQL
- ETL scheduler
scheduler.py - Bestseller ETL
batch/etl.py
API and caching
- FastAPI app
main.py - HTTP endpoints
api/endpoints.py - Domain queries
api/crud.py - Bestseller cache
cache.py - Redis
React dashboard
- Dashboard app
frontend2/src/App.jsx - Dashboard panels
frontend2/src/components/dashboard - Query hooks
frontend2/src/hooks/useRecoQueries.js - API client
frontend2/src/api/recoApi.js - UI state
frontend2/src/store/useAppStore.js
Other components
- Event simulator
- Dashboard user
Connections 22
- Event simulator → Kafka producer: supplies events
README.md - Kafka producer → Kafka broker: publishes events
README.md - Kafka broker → Event consumer: delivers events
README.md - Event consumer → Async DB access: stores events
kafka_stream/consumer.py - Async DB access → PostgreSQL: connects to
database.py - Event consumer → ORM entities: uses entities
kafka_stream/consumer.py - ETL scheduler → Bestseller ETL: runs job
scheduler.py - Bestseller ETL → Async DB access: writes bestseller data
batch/etl.py - Bestseller ETL → Redis: invalidates cache
batch/etl.py - FastAPI app → HTTP endpoints: mounts routes
main.py - HTTP endpoints → Domain queries: calls queries
api/endpoints.py - HTTP endpoints → Async DB access: injects sessions
api/endpoints.py - Domain queries → ORM entities: queries entities
api/crud.py - HTTP endpoints → Bestseller cache: reads and writes
api/endpoints.py - Bestseller cache → Redis: uses cache store
cache.py - Dashboard user → Dashboard app: uses dashboard
- Dashboard app → Dashboard panels: renders panels
frontend2/src/App.jsx - Dashboard panels → Query hooks: uses queries
frontend2/src/components/dashboard/UserRecommendationPanel.jsx - Query hooks → API client: calls API client
frontend2/src/hooks/useRecoQueries.js - API client → FastAPI app: requests data
README.md - Dashboard panels → UI state: reads UI state
frontend2/src/components/dashboard/UserRecommendationPanel.jsx - Dashboard app → FastAPI app: fetches bestsellers
README.md