# shreeshanth99/animatch architecture

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

- Interactive diagram: https://gitdiagram.com/shreeshanth99/animatch
- Repository: https://github.com/shreeshanth99/animatch

## Overview

AniMatch is a personalized anime hub. Users enter through the React app, authenticate, discover anime or open details, then manage a library, get recommendations, or participate in community discussions. The Node/Express service handles account, library and social APIs; a separate Python service provides recommendation inference. The README also describes profile management, trending/top-anime browsing and image fallbacks. Edges reflect shown code, indexed references or README statements; unsampled feature internals and some frontend-to-backend calls are not asserted.

Main entry points: [`backend/server.js`](https://github.com/shreeshanth99/animatch/blob/main/backend/server.js) (Express and sockets), [`src/App.jsx`](https://github.com/shreeshanth99/animatch/blob/main/src/App.jsx) (Route app), [`src/utils/api.js`](https://github.com/shreeshanth99/animatch/blob/main/src/utils/api.js) (API client), [`backend/recommendation_system/api.py`](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/api.py) (Recommendation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["Route app<br/>[App.jsx]"]
end

subgraph group_identity["Identity and API"]
  node_authui["Auth context<br/>[AuthContext.jsx]"]
  node_supabase["Google auth<br/>[supabase.client.js]"]
  node_api["API client<br/>[api.js]"]
  node_express["Express and sockets<br/>[server.js]"]
  node_authroutes["Auth endpoints<br/>[authRoutes.js]"]
  node_authlogic["Account handlers<br/>[authController.js]"]
  node_authguard["JWT guard<br/>[authMiddlesware.js]"]
  node_users[("User records<br/>[User.models.js]")]
  node_profile["User profile<br/>[ProfilePage2.jsx]"]
end

subgraph group_anime["Anime discovery"]
  node_discover["Anime discovery<br/>[Discover.jsx]"]
  node_details["Anime details<br/>[AnimeDetails.jsx]"]
  node_browse["Top and trending<br/>[TopAnime.jsx]"]
end

subgraph group_recommend["Recommendations"]
  node_recommendui["Recommendation pages"]
  node_similar["Similar anime<br/>[SimilarAnime.jsx]"]
  node_recapi["Recommendation API<br/>[api.py]"]
  node_model["Scoring model<br/>[model.py]"]
  node_preprocess["Text preprocessing<br/>[preprocess.py]"]
  node_recommender["Recommendation logic<br/>[recommender.py]"]
  node_profilemodel["User profiling<br/>[user_profile.py]"]
end

subgraph group_community["Library and community"]
  node_libraryui["Personal library<br/>[Library.jsx]"]
  node_libraryroutes["Library endpoints<br/>[libraryRoutes.js]"]
  node_librarylogic["Library handlers"]
  node_librarydata[("Library records")]
  node_communityui["Community<br/>[Community.jsx]"]
  node_socketui["Socket context<br/>[SocketContext.jsx]"]
  node_postroutes["Post endpoints<br/>[postRoutes.js]"]
  node_posts[("Posts<br/>[post.js]")]
  node_groups[("Discussion groups<br/>[Group.js]")]
  node_notifications["Notification helper"]
end

node_visitor(("Anime fan"))
node_externalanime["Jikan API"]

node_visitor -->|"opens"| node_app
node_app -->|"reads auth"| node_authui
node_app -->|"routes"| node_discover
node_app -->|"routes"| node_details
node_app -->|"routes"| node_recommendui
node_app -->|"routes"| node_libraryui
node_app -->|"routes"| node_communityui
node_authui -->|"uses"| node_supabase
node_authui -->|"exchanges token"| node_express
node_authui -.->|"loads profile"| node_users
node_express -->|"mounts"| node_authroutes
node_express -->|"mounts"| node_libraryroutes
node_express -->|"mounts"| node_postroutes
node_authroutes -->|"calls"| node_authlogic
node_authlogic -->|"reads and writes"| node_users
node_libraryroutes -->|"guards"| node_authguard
node_libraryroutes -->|"dispatches"| node_librarylogic
node_librarylogic -->|"reads and writes"| node_librarydata
node_api -.->|"sends requests"| node_express
node_discover -.->|"uses"| node_api
node_details -->|"requests data"| node_api
node_details -->|"renders"| node_similar
node_similar -->|"requests data"| node_api
node_recommendui -.->|"fetches suggestions"| node_recapi
node_recapi -->|"uses"| node_preprocess
node_recapi -->|"uses"| node_model
node_recapi -->|"uses"| node_recommender
node_recapi -->|"uses"| node_profilemodel
node_model -->|"transforms features"| node_preprocess
node_recommender -->|"uses"| node_model
node_recommender -->|"uses"| node_preprocess
node_recommender -->|"uses"| node_profilemodel
node_details -.->|"image fallback"| node_externalanime
node_communityui -->|"reads identity"| node_authui
node_communityui -->|"uses events"| node_socketui
node_socketui -->|"connects socket"| node_express
node_express -->|"joins rooms"| node_groups
node_communityui -.->|"uses"| node_api
node_postroutes -->|"guards"| node_authguard
node_postroutes -->|"reads and writes"| node_posts
node_postroutes -->|"checks membership"| node_groups
node_postroutes -->|"uses"| node_notifications
node_express -->|"cleans old alerts"| node_notifications
node_libraryui -.->|"uses"| node_api
node_profile -->|"requests profile"| node_api
node_browse -.->|"loads listings"| node_api

click node_app "https://github.com/shreeshanth99/animatch/blob/main/src/App.jsx"
click node_authui "https://github.com/shreeshanth99/animatch/blob/main/src/context/AuthContext.jsx"
click node_supabase "https://github.com/shreeshanth99/animatch/blob/main/src/utils/supabase.client.js"
click node_api "https://github.com/shreeshanth99/animatch/blob/main/src/utils/api.js"
click node_express "https://github.com/shreeshanth99/animatch/blob/main/backend/server.js"
click node_authroutes "https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/authRoutes.js"
click node_authlogic "https://github.com/shreeshanth99/animatch/blob/main/backend/src/controllers/authController.js"
click node_authguard "https://github.com/shreeshanth99/animatch/blob/main/backend/src/middleware/authMiddlesware.js"
click node_users "https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/User.models.js"
click node_discover "https://github.com/shreeshanth99/animatch/blob/main/src/pages/Discover.jsx"
click node_details "https://github.com/shreeshanth99/animatch/blob/main/src/pages/AnimeDetails.jsx"
click node_browse "https://github.com/shreeshanth99/animatch/blob/main/src/pages/TopAnime.jsx"
click node_recommendui "https://github.com/shreeshanth99/animatch/blob/main/src/pages/AIRecommendations.jsx"
click node_similar "https://github.com/shreeshanth99/animatch/blob/main/src/components/Recommendations/SimilarAnime.jsx"
click node_recapi "https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/api.py"
click node_model "https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/model.py"
click node_preprocess "https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/preprocess.py"
click node_recommender "https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/recommender.py"
click node_profilemodel "https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/user_profile.py"
click node_libraryui "https://github.com/shreeshanth99/animatch/blob/main/src/pages/Library.jsx"
click node_libraryroutes "https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/libraryRoutes.js"
click node_librarylogic "https://github.com/shreeshanth99/animatch/blob/main/backend/src/controllers/libraryController.js"
click node_librarydata "https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/libraryItem.model.js"
click node_profile "https://github.com/shreeshanth99/animatch/blob/main/src/pages/ProfilePage2.jsx"
click node_communityui "https://github.com/shreeshanth99/animatch/blob/main/src/pages/Community.jsx"
click node_socketui "https://github.com/shreeshanth99/animatch/blob/main/src/context/SocketContext.jsx"
click node_postroutes "https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/postRoutes.js"
click node_posts "https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/post.js"
click node_groups "https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/Group.js"
click node_notifications "https://github.com/shreeshanth99/animatch/blob/main/backend/src/utils/NotificationHelper.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 toneBlue
class node_authui,node_supabase,node_api,node_express,node_authroutes,node_authlogic,node_authguard,node_users,node_profile toneAmber
class node_discover,node_details,node_browse,node_externalanime toneMint
class node_recommendui,node_similar,node_recapi,node_model,node_preprocess,node_recommender,node_profilemodel toneRose
class node_libraryui,node_libraryroutes,node_librarylogic,node_librarydata,node_communityui,node_socketui,node_postroutes,node_posts,node_groups,node_notifications,node_visitor toneIndigo
```

## Components

### Web experience

- [Route app](https://github.com/shreeshanth99/animatch/blob/main/src/App.jsx): `src/App.jsx`

### Identity and API

- [Auth context](https://github.com/shreeshanth99/animatch/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Google auth](https://github.com/shreeshanth99/animatch/blob/main/src/utils/supabase.client.js): `src/utils/supabase.client.js`
- [API client](https://github.com/shreeshanth99/animatch/blob/main/src/utils/api.js): `src/utils/api.js`
- [Express and sockets](https://github.com/shreeshanth99/animatch/blob/main/backend/server.js): `backend/server.js`
- [Auth endpoints](https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Account handlers](https://github.com/shreeshanth99/animatch/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [JWT guard](https://github.com/shreeshanth99/animatch/blob/main/backend/src/middleware/authMiddlesware.js): `backend/src/middleware/authMiddlesware.js`
- [User records](https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/User.models.js): `backend/src/models/User.models.js`
- [User profile](https://github.com/shreeshanth99/animatch/blob/main/src/pages/ProfilePage2.jsx): `src/pages/ProfilePage2.jsx`

### Anime discovery

- [Anime discovery](https://github.com/shreeshanth99/animatch/blob/main/src/pages/Discover.jsx): `src/pages/Discover.jsx`
- [Anime details](https://github.com/shreeshanth99/animatch/blob/main/src/pages/AnimeDetails.jsx): `src/pages/AnimeDetails.jsx`
- [Top and trending](https://github.com/shreeshanth99/animatch/blob/main/src/pages/TopAnime.jsx): `src/pages/TopAnime.jsx`

### Recommendations

- [Recommendation pages](https://github.com/shreeshanth99/animatch/blob/main/src/pages/AIRecommendations.jsx): `src/pages/AIRecommendations.jsx`
- [Similar anime](https://github.com/shreeshanth99/animatch/blob/main/src/components/Recommendations/SimilarAnime.jsx): `src/components/Recommendations/SimilarAnime.jsx`
- [Recommendation API](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/api.py): `backend/recommendation_system/api.py`
- [Scoring model](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/model.py): `backend/recommendation_system/model.py`
- [Text preprocessing](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/preprocess.py): `backend/recommendation_system/preprocess.py`
- [Recommendation logic](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/recommender.py): `backend/recommendation_system/recommender.py`
- [User profiling](https://github.com/shreeshanth99/animatch/blob/main/backend/recommendation_system/user_profile.py): `backend/recommendation_system/user_profile.py`

### Library and community

- [Personal library](https://github.com/shreeshanth99/animatch/blob/main/src/pages/Library.jsx): `src/pages/Library.jsx`
- [Library endpoints](https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/libraryRoutes.js): `backend/src/routes/libraryRoutes.js`
- [Library handlers](https://github.com/shreeshanth99/animatch/blob/main/backend/src/controllers/libraryController.js): `backend/src/controllers/libraryController.js`
- [Library records](https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/libraryItem.model.js): `backend/src/models/libraryItem.model.js`
- [Community](https://github.com/shreeshanth99/animatch/blob/main/src/pages/Community.jsx): `src/pages/Community.jsx`
- [Socket context](https://github.com/shreeshanth99/animatch/blob/main/src/context/SocketContext.jsx): `src/context/SocketContext.jsx`
- [Post endpoints](https://github.com/shreeshanth99/animatch/blob/main/backend/src/routes/postRoutes.js): `backend/src/routes/postRoutes.js`
- [Posts](https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/post.js): `backend/src/models/post.js`
- [Discussion groups](https://github.com/shreeshanth99/animatch/blob/main/backend/src/models/Group.js): `backend/src/models/Group.js`
- [Notification helper](https://github.com/shreeshanth99/animatch/blob/main/backend/src/utils/NotificationHelper.js): `backend/src/utils/NotificationHelper.js`

### Other components

- **Anime fan**
- **Jikan API**

## Connections

- Anime fan → Route app: opens (evidence: `src/App.jsx`)
- Route app → Auth context: reads auth (evidence: `src/App.jsx`)
- Route app → Anime discovery: routes (evidence: `src/App.jsx`)
- Route app → Anime details: routes (evidence: `src/App.jsx`)
- Route app → Recommendation pages: routes (evidence: `src/App.jsx`)
- Route app → Personal library: routes (evidence: `src/App.jsx`)
- Route app → Community: routes (evidence: `src/App.jsx`)
- Auth context → Google auth: uses (evidence: `src/context/AuthContext.jsx`)
- Auth context → Express and sockets: exchanges token (evidence: `src/context/AuthContext.jsx`)
- Auth context → User records: loads profile
- Express and sockets → Auth endpoints: mounts (evidence: `backend/server.js`)
- Express and sockets → Library endpoints: mounts (evidence: `backend/server.js`)
- Express and sockets → Post endpoints: mounts (evidence: `backend/server.js`)
- Auth endpoints → Account handlers: calls (evidence: `backend/src/routes/authRoutes.js`)
- Account handlers → User records: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Library endpoints → JWT guard: guards (evidence: `backend/src/routes/libraryRoutes.js`)
- Library endpoints → Library handlers: dispatches (evidence: `backend/src/routes/libraryRoutes.js`)
- Library handlers → Library records: reads and writes (evidence: `backend/src/controllers/libraryController.js`)
- API client → Express and sockets: sends requests
- Anime discovery → API client: uses
- Anime details → API client: requests data (evidence: `src/pages/AnimeDetails.jsx`)
- Anime details → Similar anime: renders (evidence: `src/pages/AnimeDetails.jsx`)
- Similar anime → API client: requests data (evidence: `src/components/Recommendations/SimilarAnime.jsx`)
- Recommendation pages → Recommendation API: fetches suggestions
- Recommendation API → Text preprocessing: uses (evidence: `backend/recommendation_system/api.py`)
- Recommendation API → Scoring model: uses (evidence: `backend/recommendation_system/api.py`)
- Recommendation API → Recommendation logic: uses (evidence: `backend/recommendation_system/api.py`)
- Recommendation API → User profiling: uses (evidence: `backend/recommendation_system/api.py`)
- Scoring model → Text preprocessing: transforms features (evidence: `backend/recommendation_system/model.py`)
- Recommendation logic → Scoring model: uses (evidence: `backend/recommendation_system/recommender.py`)
- Recommendation logic → Text preprocessing: uses (evidence: `backend/recommendation_system/recommender.py`)
- Recommendation logic → User profiling: uses (evidence: `backend/recommendation_system/recommender.py`)
- Anime details → Jikan API: image fallback
- Community → Auth context: reads identity (evidence: `src/pages/Community.jsx`)
- Community → Socket context: uses events (evidence: `src/pages/Community.jsx`)
- Socket context → Express and sockets: connects socket (evidence: `src/context/SocketContext.jsx`)
- Express and sockets → Discussion groups: joins rooms (evidence: `backend/server.js`)
- Community → API client: uses
- Post endpoints → JWT guard: guards (evidence: `backend/src/routes/postRoutes.js`)
- Post endpoints → Posts: reads and writes (evidence: `backend/src/routes/postRoutes.js`)
- Post endpoints → Discussion groups: checks membership (evidence: `backend/src/routes/postRoutes.js`)
- Post endpoints → Notification helper: uses (evidence: `backend/src/routes/postRoutes.js`)
- Express and sockets → Notification helper: cleans old alerts (evidence: `backend/server.js`)
- Personal library → API client: uses
- User profile → API client: requests profile (evidence: `src/pages/ProfilePage2.jsx`)
- Top and trending → API client: loads listings
