How gael-gautho/youtube-player-and-analytics works
Project type and purpose
• This is a full-stack web application for embedding a YouTube player and collecting analytics about video watch sessions and events.
• Next.js (React) powers the frontend UI. FastAPI (Python) provides the backend REST API. Data is persisted in a relational database via SQLAlchemy.
File structure
• Top level:
• fastapi_backend/ – Python backend, Dockerized, with API routers under src/api/video_events and src/api/watch_sessions, database session in src/api/db, and main.py entrypoint.
• nextjs_frontend/ – React/Next.js application, organized under src/app (pages + layouts), src/components (UI widgets), src/hooks (custom hooks), and src/lib (utility).
• Docker‐related files in fastapi_backend: Dockerfile.web, compose.yaml, and boot/docker-run.sh for orchestrating containers.
• Backend follows a modular API router pattern. Frontend uses Next.js file‐based routing and React hooks for data fetching.