How yashusinghal69/leaguelens works
Project type and purpose
• This is a full-stack web application for delivering cricket statistics and AI-driven live commentary.
• The frontend is built with Next.js (TypeScript) and Tailwind CSS, serving UI components and API routes at port 3000.
• The backend is a Python FastAPI service (port 8051) that ingests cricket data, powers an AI chat/commentary pipeline, and persists/query data via CSV/SQL.
File structure
• Top-level:
• docker-compose.yml + Dockerfiles orchestrate two containers (frontend & backend).
• src/ holds Next.js app (pages, components, contexts).
• public/ contains static assets.
• backend/ contains FastAPI app.py and submodules under chat/, sql_with_pathway/, vector_updater.py, plus data files, logs, and scripts.
• Patterns:
• Frontend uses the Next.js “app” directory with client/server components.
• Backend is organized by feature: chat pipeline, SQL setup, vector store microservice, data-updater scripts.
Additional insights from README
• Two services launched via Docker Compose:
• Frontend (localhost:3000)
• Backend API (localhost:8051)
• Manual start scripts for development: start_app.sh, docker-setup.sh.
• Data update workflow: jsonfileupdate.py, vector_updater.py, and SQL setup scripts.
Elements
• Labels: name each container and sub-service (e.g. “Next.js Frontend”, “FastAPI Chat Service”).
• Green for backend services.
• Orange for data storage.
• Gray for external services.
Detail without overcomplication
• Backend feature modules as sub-components.
• Orchestration sequence for chat queries.
• Offline batch/update processes.