How shashishekhar-m/ai-movie-recommender works
Project type and purpose
• This is a full-stack web application:
• Frontend: delivers a modern, interactive UI for browsing and filtering movie recommendations.
• Backend: a Python/Flask service exposing REST endpoints, handling NLP search, “Surprise Me,” and querying a MySQL database.
• Data: IMDb datasets stored in MySQL, filtered by genre, language, year, duration.
File structure
• Original (static) layout:
• app.py & db_config.py → Flask app + DB connection
• index.html, script.js, style.css → static frontend
• If using Next.js instead of static files, you would replace index.html, script.js, style.css with a Next.js project structure:
• pages/ → React/SSR routes (e.g., pages/index.js, pages/api/*)
• components/ → UI components
• public/ → static assets (CSS, images)
• next.config.js, package.json → build & deployment config
README for additional insights
• The system filters IMDb data by multiple criteria and offers NLP-based search.
• Key features: “Surprise Me” (randomized recommendation), modern UI for engagement.
a. Main components
• Next.js Frontend (React, SSR/CSR)
• Flask API Server (Python, Flask)
• MySQL Database (IMDb data)
• Optional: External IMDb data source (if data ingested dynamically)
b. Relationships & interactions
• User → Next.js Frontend (HTTP/HTTPS)
• Next.js → Flask API (REST calls)
• Flask API → MySQL (SQL queries)
• Flask NLP modules → process query inputs
• “Surprise Me” routine → random selection logic in Flask
c. Architectural patterns & design principles
• Separation of concerns: frontend UI vs. backend logic
• API-driven architecture: frontend consumes RESTful endpoints
• SSR/CSR hybrid (Next.js): SEO & performance
• Modularization: distinct layers for routing, business logic, data access
d. Relevant technologies
• Next.js (React, SSR, API routes)
• Flask (WSGI server, Blueprints for routes)
• MySQL (InnoDB tables for movies)
• Python NLP libraries (e.g., NLTK or spaCy)
• Docker or CI/CD scripts (if present)
Essential elements
• Layers: UI, API, business logic, data store
• Functional grouping: filtering module, search module, randomizer
• Keep it readable: group related components, avoid over-cluttering