How mohit9339/yourmoviebuddy works
Project type and purpose
• From the file tree and README, “YourMovieBuddy” is a full-stack movie discovery and list-management web application.
• The frontend is delivered as static HTML/CSS/JS (under public/) and built with Tailwind via Vite.
• The backend is a Node.js/Express server (backend/), with user management, session handling, and a small scraper for IMDb ratings.
• Data is persisted in MongoDB Atlas; some sample JSON (top_movies.json, directors.json) live under public/data.
File structure
Top-level:
• README.md, vite.config.js, package.json (root)
• backend/
– server.js (Express setup, API routes, static-file serving)
– imdbScraper.js (external IMDb scraping module)
– models/user.js (Mongoose schema or similar)
– .env (DB credentials, secret keys)
– users.json (fallback or seed data)
• public/
– HTML views (index.html, login.html, dashboard.html, …)
– CSS (style.css)
– JS controllers (auth.js, search.js, dashboard.js, etc.)
– data (top_movies.json, other static data)
README for additional insights
• Confirms use of MongoDB Atlas, Tailwind CSS, session-based auth (Signup & Login).
• Core features: search by title, filter by genre/language/director, personal lists (Favorites/Watched), director filmographies, IMDb ratings.
Main components & their relationships
a. Frontend (Client Browser)
• Static assets (HTML/CSS/JS) served by Vite/Express
• UI built with Tailwind, vanilla JS modules under public/js
• Invokes RESTful endpoints (XHR/fetch calls) to backend
b. Backend (Node.js + Express)
• Serves static files + API routes (/api/auth, /api/movies, /api/user, …)
• Orchestrates business logic: authentication, list management, movie lookups
• Uses imdbScraper.js to fetch external rating data from IMDb
c. Database (MongoDB Atlas)
• Stores User documents (credentials, Favorites, Watched lists)
• Potentially caches movie metadata or sessions
d. External Service (IMDb)
• Accessed via imdbScraper for live ratings
e. (Optional) Static JSON Data
• public/data/top_movies.json for client-side “most popular” list
Interactions:
Client → HTTP(S) → Backend API
Backend → MongoDB Atlas (via Mongoose or Mongo client)
Backend → imdbScraper → external IMDb pages
Backend → Client (serves HTML, assets & JSON responses)
Architectural patterns & design principles
• MVC-inspired separation:
• Models (backend/models)
• Controllers/Routes (server.js)
• Views (public/*.html) + client-side JS (public/js)
• RESTful HTTP API between frontend and backend
• Single-page-app-style modular JS, but delivered as multiple HTML entry points
• External integration layer (imdbScraper) decoupled from core business logic
• Environment configuration via .env