How gw-dg/to-all-the-films works
Project type and purpose
• This is a full-stack web application (“To All The Films I Love”) providing AI-powered, personalized movie recommendations and an AI chatbot interface.
• The frontend is a React single-page app built with Vite, Tailwind CSS, and deployed to Vercel.
• The backend is a Node.js/Express API server handling user management, movie data retrieval, rating storage, and AI/ML integrations.
File structure
• Top-level folders:
• /frontend – React/Vite/Tailwind code, UI components, routing and static assets.
• /backend – Express.js server, route handlers, data models, config for database and Firebase Admin.
• backend/config contains db.js (database connection, likely MongoDB) and firebaseAdmin.js (Firebase Authentication/Authorization).
• backend/models defines User and Review schemas.
• backend/routes organizes all REST endpoints: authentication (loginRoutes), profile, search, titleDetail, recommendations, AI-powered genre or trending routes, GenAI chatbot (genAIRoutes).
• notebook.ipynb suggests local experimentation or prototyping of ML embeddings.
Extract README insights
• Uses TMDb API for movie metadata.
• Embeddings generated via baai/bge-m3 model and stored in Pinecone (vector database) for similarity search.
• AI chatbot powered by GroqCloud Llama 3.3-70B model.
• Future plan to add caching, social mashups, UI refactor.
Main components
a. Frontend SPA (React/Vite/Tailwind)
b. Backend API (Node.js + Express)
c. Primary database (e.g., MongoDB or relational DB) for user profiles, reviews, ratings
d. Firebase Authentication service for user login and token verification
e. Pinecone vector database for embedding storage and similarity queries
f. External APIs:
• TMDb API for film metadata
• GroqCloud API (Llama 3.3-70B) for GenAI chatbot
g. ML pipeline (offline/service) generating embeddings via baai/bge-m3, storing to Pinecone
h. Deployment platforms: Vercel (frontend + backend)
Relationships and data flows
• User’s browser ↔︎ Frontend React SPA
• SPA sends HTTP(S) to Backend Express API
• Backend authenticates via Firebase Admin
• Backend reads/writes to primary DB for user data and reviews
• For recommendations:
• Backend retrieves user’s rated titles from DB
• Generates or fetches embeddings (via Pinecone)
• Queries Pinecone for nearest neighbors
• Optionally calls TMDb API for metadata enrichment
• For GenAI chatbot: Backend routes user messages to GroqCloud API, returns responses to frontend
Architectural patterns and design principles
• Layered architecture: Presentation (UI) → API Layer → Data Services → External Services.
• Separation of concerns:
• UI components vs. business logic vs. data access
• Authentication as a separate cross-cutting concern (Firebase Admin)
• Micro-service-esque modules within the API (each route file = one domain service)
• Eventual consistency in recommendations powered by vector DB