# nidhi-kumari10/movie-recommendation-system architecture

> Architecture diagram of the GitHub repository nidhi-kumari10/movie-recommendation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nidhi-kumari10/movie-recommendation-system
- Repository: https://github.com/nidhi-kumari10/movie-recommendation-system

## Overview

This is a full-stack movie discovery and recommendation application. Users browse popular or filtered titles, inspect details, save movies and record likes, ratings, and reviews; those interactions support personalized recommendations, with genre-based fallback when similarity data is unavailable. The frontend routes these experiences, while Express routes requests to authentication, movie, and user controllers. MongoDB-backed user state and the local movie catalog support the service; TMDB supplies poster images. Frontend-to-API calls are not shown in the excerpts, so those links are marked unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/App.jsx) (Route app), [`backend/routes/userRoutes.js`](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/userRoutes.js) (User endpoints), [`backend/server.js`](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/server.js) (Express server), [`backend/controllers/userController.js`](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/userController.js) (Preferences and recommendations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Route app<br/>[App.jsx]"]
  node_home["Browse home<br/>[Home.jsx]"]
  node_detail["Movie details<br/>[MovieDetail.jsx]"]
  node_recommend_ui["Recommendations view<br/>[Recommend.jsx]"]
  node_wishlist_ui["Wishlist view<br/>[Wishlist.jsx]"]
  node_profile_ui["Profile view<br/>[Profile.jsx]"]
  node_auth_ui["Authentication views<br/>[Auth.jsx]"]
  node_login_ui["Login view<br/>[Login.jsx]"]
  node_movie_card["Movie card<br/>[MovieCard.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
end

subgraph group_api["API and domain"]
  node_movie_api["Movie endpoints<br/>[movieRoutes.js]"]
  node_movie_logic["Catalog and recommendations<br/>[movieController.js]"]
  node_user_api["User endpoints<br/>[userRoutes.js]"]
  node_user_logic["Preferences and recommendations<br/>[userController.js]"]
  node_server["Express server<br/>[server.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_api["Auth endpoints<br/>[authRoutes.js]"]
  node_auth_logic["Signup and login<br/>[authController.js]"]
  node_guard["JWT guard<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistence and media"]
  node_user_model[("User document<br/>[User.js]")]
  node_catalog["Movie catalog<br/>[movies.json]"]
  node_poster_helper["Poster lookup<br/>[tmdb.js]"]
  node_db_config["Database connection<br/>[db.js]"]
end

node_viewer(("Movie viewer"))
node_tmdb["TMDB service"]
node_database[("MongoDB")]

node_viewer -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_recommend_ui
node_app -->|"routes to"| node_wishlist_ui
node_app -->|"routes to"| node_profile_ui
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_login_ui
node_app -->|"renders"| node_navbar
node_home -->|"renders"| node_movie_card
node_recommend_ui -->|"renders"| node_movie_card
node_profile_ui -->|"renders"| node_movie_card
node_movie_card -.->|"posts preferences"| node_user_api
node_recommend_ui -.->|"requests recommendations"| node_user_api
node_wishlist_ui -.->|"requests wishlist"| node_user_api
node_profile_ui -.->|"requests profile"| node_user_api
node_auth_ui -.->|"submits credentials"| node_auth_api
node_login_ui -.->|"submits credentials"| node_auth_api
node_server -->|"mounts"| node_movie_api
node_server -->|"mounts"| node_user_api
node_server -->|"mounts"| node_auth_api
node_movie_api -->|"dispatches"| node_movie_logic
node_user_api -->|"dispatches"| node_user_logic
node_user_api -->|"protects routes"| node_guard
node_auth_api -->|"dispatches"| node_auth_logic
node_movie_logic -->|"reads"| node_catalog
node_movie_logic -->|"requests posters"| node_poster_helper
node_user_logic -->|"reads"| node_catalog
node_user_logic -->|"requests posters"| node_poster_helper
node_poster_helper -->|"searches titles"| node_tmdb
node_user_logic -->|"reads and updates"| node_user_model
node_auth_logic -->|"creates and reads"| node_user_model
node_server -->|"connects"| node_db_config
node_db_config -.->|"connects to"| node_database

click node_app "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Home.jsx"
click node_detail "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/MovieDetail.jsx"
click node_recommend_ui "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Recommend.jsx"
click node_wishlist_ui "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Wishlist.jsx"
click node_profile_ui "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Profile.jsx"
click node_auth_ui "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Auth.jsx"
click node_login_ui "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Login.jsx"
click node_movie_card "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/components/MovieCard.jsx"
click node_navbar "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/components/Navbar.jsx"
click node_movie_api "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/movieRoutes.js"
click node_movie_logic "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/movieController.js"
click node_user_api "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/userRoutes.js"
click node_user_logic "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/userController.js"
click node_auth_api "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/authRoutes.js"
click node_auth_logic "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/authController.js"
click node_guard "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/middleware/authMiddleware.js"
click node_user_model "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/models/User.js"
click node_catalog "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/data/movies.json"
click node_poster_helper "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/utils/tmdb.js"
click node_server "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/server.js"
click node_db_config "https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/config/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_detail,node_recommend_ui,node_wishlist_ui,node_profile_ui,node_auth_ui,node_login_ui,node_movie_card,node_navbar,node_viewer toneBlue
class node_movie_api,node_movie_logic,node_user_api,node_user_logic,node_server,node_database toneAmber
class node_auth_api,node_auth_logic,node_guard toneMint
class node_user_model,node_catalog,node_poster_helper,node_db_config toneRose
class node_tmdb toneIndigo
```

## Components

### Web experience

- [Route app](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Browse home](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Movie details](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/MovieDetail.jsx): `frontend/src/pages/MovieDetail.jsx`
- [Recommendations view](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Recommend.jsx): `frontend/src/pages/Recommend.jsx`
- [Wishlist view](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Wishlist.jsx): `frontend/src/pages/Wishlist.jsx`
- [Profile view](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Authentication views](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Auth.jsx): `frontend/src/pages/Auth.jsx`
- [Login view](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Movie card](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/components/MovieCard.jsx): `frontend/src/components/MovieCard.jsx`
- [Navigation bar](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`

### API and domain

- [Movie endpoints](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/movieRoutes.js): `backend/routes/movieRoutes.js`
- [Catalog and recommendations](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/movieController.js): `backend/controllers/movieController.js`
- [User endpoints](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Preferences and recommendations](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Express server](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/server.js): `backend/server.js`

### Identity and profiles

- [Auth endpoints](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Signup and login](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT guard](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Persistence and media

- [User document](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/models/User.js): `backend/models/User.js`
- [Movie catalog](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/data/movies.json): `backend/data/movies.json`
- [Poster lookup](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/utils/tmdb.js): `backend/utils/tmdb.js`
- [Database connection](https://github.com/nidhi-kumari10/movie-recommendation-system/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **Movie viewer**
- **TMDB service**
- **MongoDB**

## Connections

- Movie viewer → Route app: uses
- Route app → Browse home: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Movie details: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Recommendations view: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Wishlist view: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Profile view: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Authentication views: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Login view: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- Browse home → Movie card: renders (evidence: `frontend/src/pages/Home.jsx`)
- Recommendations view → Movie card: renders (evidence: `frontend/src/pages/Recommend.jsx`)
- Profile view → Movie card: renders (evidence: `frontend/src/pages/Profile.jsx`)
- Movie card → User endpoints: posts preferences
- Recommendations view → User endpoints: requests recommendations
- Wishlist view → User endpoints: requests wishlist
- Profile view → User endpoints: requests profile
- Authentication views → Auth endpoints: submits credentials
- Login view → Auth endpoints: submits credentials
- Express server → Movie endpoints: mounts (evidence: `backend/server.js`)
- Express server → User endpoints: mounts (evidence: `backend/server.js`)
- Express server → Auth endpoints: mounts (evidence: `backend/server.js`)
- Movie endpoints → Catalog and recommendations: dispatches (evidence: `backend/routes/movieRoutes.js`)
- User endpoints → Preferences and recommendations: dispatches (evidence: `backend/routes/userRoutes.js`)
- User endpoints → JWT guard: protects routes (evidence: `backend/routes/userRoutes.js`)
- Auth endpoints → Signup and login: dispatches (evidence: `backend/routes/authRoutes.js`)
- Catalog and recommendations → Movie catalog: reads (evidence: `backend/controllers/movieController.js`)
- Catalog and recommendations → Poster lookup: requests posters (evidence: `backend/controllers/movieController.js`)
- Preferences and recommendations → Movie catalog: reads (evidence: `backend/controllers/userController.js`)
- Preferences and recommendations → Poster lookup: requests posters (evidence: `backend/controllers/userController.js`)
- Poster lookup → TMDB service: searches titles (evidence: `backend/utils/tmdb.js`)
- Preferences and recommendations → User document: reads and updates (evidence: `backend/controllers/userController.js`)
- Signup and login → User document: creates and reads (evidence: `backend/controllers/authController.js`)
- Express server → Database connection: connects (evidence: `backend/server.js`)
- Database connection → MongoDB: connects to
