# kumartatikonda1119/chitram architecture

> Architecture diagram of the GitHub repository kumartatikonda1119/chitram, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumartatikonda1119/chitram
- Repository: https://github.com/kumartatikonda1119/chitram

## Overview

Chitram is a cinema and TV discovery product: visitors explore or search TMDB media, open detailed title/person pages, and registered users build personalized recommendations through tracked activity. Its broader product includes favorites, lists, reviews, social community features, authentication, and notifications. The graph combines README-documented capabilities with evidenced backend calls and routing; unsampled frontend pages and controllers are represented by their exact paths, but their internal call relationships are not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/App.jsx) (Web application), [`backend/controllers/search.controller.js`](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/search.controller.js) (Search controller), [`backend/controllers/auth.controller.js`](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/auth.controller.js) (Authentication controller), [`backend/server.js`](https://github.com/kumartatikonda1119/chitram/blob/main/backend/server.js) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Discovery experience"]
  node_app["Web application<br/>[App.jsx]"]
  node_home["Discovery home<br/>[Index.jsx]"]
  node_explore["Explore feeds<br/>[Explore.jsx]"]
  node_searchui["Search experience<br/>[Search.jsx]"]
end

subgraph group_media["Media exploration"]
  node_details["Media and person details<br/>[MovieDetail.jsx]"]
  node_series["Series and episode details<br/>[SeriesDetail.jsx]"]
end

subgraph group_accounts["Accounts and personalization"]
  node_tracking["Interaction tracking"]
  node_recommendations["Recommendation engine"]
  node_recommendui["Recommendations view<br/>[Recommend.jsx]"]
  node_authui["Sign-in and registration<br/>[AuthContext.jsx]"]
  node_lists["Favorites and lists<br/>[list.controller.js]"]
  node_profile["Member profiles<br/>[Profile.jsx]"]
end

subgraph group_social["Community features"]
  node_community["Community and social<br/>[Community.jsx]"]
  node_posts["Posts and comments<br/>[post.controller.js]"]
  node_follows["Following"]
  node_reviews["Reviews"]
end

subgraph group_platform["Backend services"]
  node_searchapi["Search controller"]
  node_ai["Semantic query rewrite<br/>[ai.service.js]"]
  node_auth["Authentication controller<br/>[auth.controller.js]"]
  node_mail["OTP email delivery<br/>[mail.service.js]"]
  node_redis[("Redis cache<br/>[redis.service.js]")]
  node_server["Express API<br/>[server.js]"]
  node_routes["API route modules"]
end

node_visitor(("Visitor or member"))
node_tmdb{{"TMDB catalog"}}
node_mongodb[("MongoDB")]
node_emailprovider{{"Resend or SMTP"}}

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_searchui
node_app -->|"routes to"| node_recommendui
node_app -->|"routes to"| node_details
node_visitor -->|"browses"| node_explore
node_searchui -->|"searches via"| node_searchapi
node_server -->|"mounts routes"| node_routes
node_routes -->|"dispatches"| node_searchapi
node_searchapi -->|"rewrites query"| node_ai
node_ai -->|"reads and writes"| node_redis
node_searchapi -->|"queries catalog"| node_tmdb
node_details -->|"shows media data"| node_tmdb
node_series -->|"shows media data"| node_tmdb
node_searchapi -->|"tracks searches"| node_tracking
node_visitor -->|"registers or signs in"| node_authui
node_authui -->|"authenticates via"| node_auth
node_server -->|"serves API"| node_auth
node_auth -->|"sends OTP"| node_mail
node_mail -->|"delivers email"| node_emailprovider
node_auth -->|"reads and writes"| node_mongodb
node_auth -->|"checks cooldown"| node_redis
node_visitor -->|"views suggestions"| node_recommendui
node_recommendui -->|"requests recommendations"| node_recommendations
node_recommendations -->|"combines catalog sources"| node_tmdb
node_recommendations -->|"caches results"| node_redis
node_tracking -->|"stores interactions"| node_mongodb
node_visitor -->|"manages favorites and lists"| node_lists
node_lists -->|"persists lists"| node_mongodb
node_visitor -->|"views profile"| node_profile
node_visitor -->|"participates"| node_community
node_community -->|"uses community posts"| node_posts
node_visitor -->|"follows members"| node_follows
node_follows -->|"persists follows"| node_mongodb
node_visitor -->|"writes reviews"| node_reviews
node_reviews -->|"persists reviews"| node_mongodb
node_server -->|"connects database"| node_mongodb

click node_app "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Index.jsx"
click node_explore "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Explore.jsx"
click node_searchui "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Search.jsx"
click node_searchapi "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/search.controller.js"
click node_ai "https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/ai.service.js"
click node_details "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/MovieDetail.jsx"
click node_series "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/SeriesDetail.jsx"
click node_tracking "https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/interaction.service.js"
click node_recommendations "https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/recommendation.service.js"
click node_recommendui "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Recommend.jsx"
click node_authui "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/contexts/AuthContext.jsx"
click node_auth "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/auth.controller.js"
click node_mail "https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/mail.service.js"
click node_redis "https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/redis.service.js"
click node_lists "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/list.controller.js"
click node_profile "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Profile.jsx"
click node_community "https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Community.jsx"
click node_posts "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/post.controller.js"
click node_follows "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/follow.controller.js"
click node_reviews "https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/review.controller.js"
click node_server "https://github.com/kumartatikonda1119/chitram/blob/main/backend/server.js"
click node_routes "https://github.com/kumartatikonda1119/chitram/tree/main/backend/routes"

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_explore,node_searchui toneBlue
class node_details,node_series,node_mongodb toneAmber
class node_tracking,node_recommendations,node_recommendui,node_authui,node_lists,node_profile toneMint
class node_community,node_posts,node_follows,node_reviews toneRose
class node_searchapi,node_ai,node_auth,node_mail,node_redis,node_server,node_routes,node_visitor,node_tmdb,node_emailprovider toneIndigo
```

## Components

### Discovery experience

- [Web application](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Discovery home](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Index.jsx): `frontend/src/pages/Index.jsx`
- [Explore feeds](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Explore.jsx): `frontend/src/pages/Explore.jsx`
- [Search experience](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Search.jsx): `frontend/src/pages/Search.jsx`

### Media exploration

- [Media and person details](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/MovieDetail.jsx): `frontend/src/pages/MovieDetail.jsx`
- [Series and episode details](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/SeriesDetail.jsx): `frontend/src/pages/SeriesDetail.jsx`

### Accounts and personalization

- [Interaction tracking](https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/interaction.service.js): `backend/services/interaction.service.js`
- [Recommendation engine](https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/recommendation.service.js): `backend/services/recommendation.service.js`
- [Recommendations view](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Recommend.jsx): `frontend/src/pages/Recommend.jsx`
- [Sign-in and registration](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [Favorites and lists](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/list.controller.js): `backend/controllers/list.controller.js`
- [Member profiles](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`

### Community features

- [Community and social](https://github.com/kumartatikonda1119/chitram/blob/main/frontend/src/pages/Community.jsx): `frontend/src/pages/Community.jsx`
- [Posts and comments](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/post.controller.js): `backend/controllers/post.controller.js`
- [Following](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/follow.controller.js): `backend/controllers/follow.controller.js`
- [Reviews](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/review.controller.js): `backend/controllers/review.controller.js`

### Backend services

- [Search controller](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/search.controller.js): `backend/controllers/search.controller.js`
- [Semantic query rewrite](https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/ai.service.js): `backend/services/ai.service.js`
- [Authentication controller](https://github.com/kumartatikonda1119/chitram/blob/main/backend/controllers/auth.controller.js): `backend/controllers/auth.controller.js`
- [OTP email delivery](https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/mail.service.js): `backend/services/mail.service.js`
- [Redis cache](https://github.com/kumartatikonda1119/chitram/blob/main/backend/services/redis.service.js): `backend/services/redis.service.js`
- [Express API](https://github.com/kumartatikonda1119/chitram/blob/main/backend/server.js): `backend/server.js`
- [API route modules](https://github.com/kumartatikonda1119/chitram/tree/main/backend/routes): `backend/routes`

### Other components

- **Visitor or member**
- **TMDB catalog**
- **MongoDB**
- **Resend or SMTP**

## Connections

- Visitor or member → Web application: uses (evidence: `README.md`)
- Web application → Discovery home: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Search experience: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Recommendations view: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Media and person details: routes to (evidence: `frontend/src/App.jsx`)
- Visitor or member → Explore feeds: browses (evidence: `README.md`)
- Search experience → Search controller: searches via (evidence: `README.md`)
- Express API → API route modules: mounts routes (evidence: `backend/server.js`)
- API route modules → Search controller: dispatches (evidence: `backend/routes/search.route.js`)
- Search controller → Semantic query rewrite: rewrites query (evidence: `backend/controllers/search.controller.js`)
- Semantic query rewrite → Redis cache: reads and writes (evidence: `backend/services/ai.service.js`)
- Search controller → TMDB catalog: queries catalog (evidence: `backend/controllers/search.controller.js`)
- Media and person details → TMDB catalog: shows media data (evidence: `README.md`)
- Series and episode details → TMDB catalog: shows media data (evidence: `README.md`)
- Search controller → Interaction tracking: tracks searches (evidence: `backend/controllers/search.controller.js`)
- Visitor or member → Sign-in and registration: registers or signs in (evidence: `README.md`)
- Sign-in and registration → Authentication controller: authenticates via (evidence: `README.md`)
- Express API → Authentication controller: serves API (evidence: `backend/server.js`)
- Authentication controller → OTP email delivery: sends OTP (evidence: `backend/controllers/auth.controller.js`)
- OTP email delivery → Resend or SMTP: delivers email (evidence: `backend/services/mail.service.js`)
- Authentication controller → MongoDB: reads and writes (evidence: `backend/controllers/auth.controller.js`)
- Authentication controller → Redis cache: checks cooldown (evidence: `backend/controllers/auth.controller.js`)
- Visitor or member → Recommendations view: views suggestions (evidence: `README.md`)
- Recommendations view → Recommendation engine: requests recommendations (evidence: `README.md`)
- Recommendation engine → TMDB catalog: combines catalog sources (evidence: `README.md`)
- Recommendation engine → Redis cache: caches results (evidence: `backend/services/recommendation.service.js`)
- Interaction tracking → MongoDB: stores interactions (evidence: `backend/services/interaction.service.js`)
- Visitor or member → Favorites and lists: manages favorites and lists (evidence: `README.md`)
- Favorites and lists → MongoDB: persists lists (evidence: `backend/controllers/list.controller.js`)
- Visitor or member → Member profiles: views profile (evidence: `README.md`)
- Visitor or member → Community and social: participates (evidence: `README.md`)
- Community and social → Posts and comments: uses community posts (evidence: `README.md`)
- Visitor or member → Following: follows members (evidence: `README.md`)
- Following → MongoDB: persists follows (evidence: `backend/controllers/follow.controller.js`)
- Visitor or member → Reviews: writes reviews (evidence: `README.md`)
- Reviews → MongoDB: persists reviews (evidence: `backend/controllers/review.controller.js`)
- Express API → MongoDB: connects database (evidence: `backend/server.js`)
