# raghavkp2006-ux/recomenadtionengine architecture

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

- Interactive diagram: https://gitdiagram.com/raghavkp2006-ux/recomenadtionengine
- Repository: https://github.com/raghavkp2006-ux/recomenadtionengine

## Overview

Poly_Taste is a cross-domain taste recommendation application: users connect accounts or provide feedback, then browse recommendations across music, anime, movies, tourism, dining, and Myntra fashion. The frontend calls a FastAPI backend, whose domain routes coordinate recommendation and profile services and persist user and activity data. The browser extension separately collects user-enabled Myntra page activity. The README documents all five recommendation domains and integrations; several route and service implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/App.tsx) (Web Application), [`main.py`](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/main.py) (FastAPI Application), [`routers/google_auth.py`](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/google_auth.py) (Google Sign-In), [`routers/anime.py`](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/anime.py) (Anime Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Experience"]
  node_webapp["Web Application<br/>[App.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
  node_anime_ui["Anime Experience<br/>[AnimeGrid.tsx]"]
  node_places_ui["Tourism Experience"]
  node_fashion_ui["Fashion Experience<br/>[MyntraPage.tsx]"]
end

subgraph group_api["API and Identity"]
  node_backend["FastAPI Application<br/>[main.py]"]
  node_google_auth["Google Sign-In<br/>[google_auth.py]"]
  node_session["Session Authentication<br/>[auth.py]"]
end

subgraph group_taste["Taste and Recommendations"]
  node_anime_routes["Anime Routes<br/>[anime.py]"]
  node_anime_recs["Anime Recommendations"]
  node_anime_sources["Anime Data Sources<br/>[anilist_client.py]"]
  node_spotify_routes["Spotify Routes<br/>[spotify.py]"]
  node_spotify_sync["Spotify Sync<br/>[spotify_sync.py]"]
  node_movie_recs["Movie Recommendations"]
  node_cross_domain["Cross-Domain Profile<br/>[taste_profile.py]"]
  node_rerank["Recommendation Reranking<br/>[rerank.py]"]
  node_other_domains["Tourism and Dining"]
  node_spotify_service["Spotify Service<br/>[spotify_sync.py]"]
end

subgraph group_state["Profiles and Storage"]
  node_db[("Relational Database<br/>[database.py]")]
end

subgraph group_fashion["Myntra Integration"]
  node_extension["Browser Extension<br/>[myntra-content.js]"]
  node_event_queue["Event Queue<br/>[queue.js]"]
  node_event_sender["Event Sender<br/>[service-worker.js]"]
  node_myntra_routes["Myntra API<br/>[myntra.py]"]
  node_myntra_profile["Myntra Profile<br/>[myntra_profile.py]"]
end

node_user(("User"))
node_external_services["External Content APIs"]

node_user -->|"uses"| node_webapp
node_webapp -->|"calls"| node_api_client
node_webapp -->|"renders"| node_anime_ui
node_webapp -->|"renders"| node_places_ui
node_webapp -->|"renders"| node_fashion_ui
node_api_client -->|"requests"| node_backend
node_backend -->|"routes to"| node_google_auth
node_google_auth -->|"verifies identity"| node_external_services
node_google_auth -->|"creates session"| node_session
node_backend -->|"routes to"| node_anime_routes
node_backend -->|"routes to"| node_spotify_routes
node_backend -->|"routes to"| node_other_domains
node_anime_routes -->|"requests recommendations"| node_anime_recs
node_anime_routes -->|"fetches data"| node_anime_sources
node_anime_sources -->|"fetches catalog and updates"| node_external_services
node_anime_sources -->|"fetches live data"| node_external_services
node_spotify_routes -->|"syncs listening data"| node_spotify_sync
node_spotify_routes -->|"requests Spotify data"| node_external_services
node_anime_routes -->|"personalizes"| node_cross_domain
node_movie_recs -.->|"uses taste profile"| node_cross_domain
node_cross_domain -.->|"supports reranking"| node_rerank
node_other_domains -.->|"personalizes recommendations"| node_cross_domain
node_spotify_routes -->|"reads and writes"| node_db
node_spotify_sync -->|"reads and writes"| node_db
node_google_auth -->|"stores identities"| node_db
node_user -->|"browses Myntra"| node_extension
node_extension -.->|"queues events"| node_event_queue
node_event_queue -->|"provides events"| node_event_sender
node_event_sender -.->|"sends events"| node_myntra_routes
node_api_client -->|"requests fashion data"| node_myntra_routes
node_myntra_routes -.->|"uses profile"| node_myntra_profile
node_myntra_routes -.->|"persists activity"| node_db

click node_webapp "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/api.ts"
click node_anime_ui "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/components/anime/AnimeGrid.tsx"
click node_places_ui "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/pages/TouristSpotsPage.tsx"
click node_fashion_ui "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/pages/MyntraPage.tsx"
click node_backend "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/main.py"
click node_google_auth "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/google_auth.py"
click node_session "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/auth.py"
click node_anime_routes "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/anime.py"
click node_anime_recs "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/anime_recommender.py"
click node_anime_sources "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/anilist_client.py"
click node_spotify_routes "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/spotify.py"
click node_spotify_sync "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/spotify_sync.py"
click node_movie_recs "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/movie_recommender.py"
click node_cross_domain "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/taste_profile.py"
click node_rerank "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/rerank.py"
click node_other_domains "https://github.com/raghavkp2006-ux/recomenadtionengine/tree/main/routers"
click node_db "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/database.py"
click node_extension "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/content/myntra-content.js"
click node_event_queue "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/storage/queue.js"
click node_event_sender "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/background/service-worker.js"
click node_myntra_routes "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/myntra.py"
click node_myntra_profile "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/myntra_profile.py"
click node_spotify_service "https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/spotify_sync.py"

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_webapp,node_api_client,node_anime_ui,node_places_ui,node_fashion_ui,node_user toneBlue
class node_backend,node_google_auth,node_session toneAmber
class node_anime_routes,node_anime_recs,node_anime_sources,node_spotify_routes,node_spotify_sync,node_movie_recs,node_cross_domain,node_rerank,node_other_domains,node_spotify_service,node_external_services toneMint
class node_db toneRose
class node_extension,node_event_queue,node_event_sender,node_myntra_routes,node_myntra_profile toneIndigo
```

## Components

### User Experience

- [Web Application](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API Client](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Anime Experience](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/components/anime/AnimeGrid.tsx): `frontend/src/components/anime/AnimeGrid.tsx`
- [Tourism Experience](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/pages/TouristSpotsPage.tsx): `frontend/src/pages/TouristSpotsPage.tsx`
- [Fashion Experience](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/frontend/src/pages/MyntraPage.tsx): `frontend/src/pages/MyntraPage.tsx`

### API and Identity

- [FastAPI Application](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/main.py): `main.py`
- [Google Sign-In](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/google_auth.py): `routers/google_auth.py`
- [Session Authentication](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/auth.py): `services/auth.py`

### Taste and Recommendations

- [Anime Routes](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/anime.py): `routers/anime.py`
- [Anime Recommendations](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/anime_recommender.py): `services/anime_recommender.py`
- [Anime Data Sources](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/anilist_client.py): `services/anilist_client.py`
- [Spotify Routes](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/spotify.py): `routers/spotify.py`
- [Spotify Sync](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/spotify_sync.py): `services/spotify_sync.py`
- [Movie Recommendations](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/movie_recommender.py): `services/movie_recommender.py`
- [Cross-Domain Profile](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/taste_profile.py): `services/taste_profile.py`
- [Recommendation Reranking](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/rerank.py): `services/rerank.py`
- [Tourism and Dining](https://github.com/raghavkp2006-ux/recomenadtionengine/tree/main/routers): `routers`
- [Spotify Service](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/spotify_sync.py): `services/spotify_sync.py`

### Profiles and Storage

- [Relational Database](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/database.py): `database.py`

### Myntra Integration

- [Browser Extension](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/content/myntra-content.js): `extension/src/content/myntra-content.js`
- [Event Queue](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/storage/queue.js): `extension/src/storage/queue.js`
- [Event Sender](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/extension/src/background/service-worker.js): `extension/src/background/service-worker.js`
- [Myntra API](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/routers/myntra.py): `routers/myntra.py`
- [Myntra Profile](https://github.com/raghavkp2006-ux/recomenadtionengine/blob/main/services/myntra_profile.py): `services/myntra_profile.py`

### Other components

- **User**
- **External Content APIs**

## Connections

- User → Web Application: uses
- Web Application → API Client: calls (evidence: `frontend/src/App.tsx`)
- Web Application → Anime Experience: renders (evidence: `frontend/src/App.tsx`)
- Web Application → Tourism Experience: renders (evidence: `frontend/src/App.tsx`)
- Web Application → Fashion Experience: renders (evidence: `frontend/src/App.tsx`)
- API Client → FastAPI Application: requests (evidence: `frontend/src/api.ts`)
- FastAPI Application → Google Sign-In: routes to (evidence: `main.py`)
- Google Sign-In → External Content APIs: verifies identity (evidence: `routers/google_auth.py`)
- Google Sign-In → Session Authentication: creates session (evidence: `routers/google_auth.py`)
- FastAPI Application → Anime Routes: routes to (evidence: `main.py`)
- FastAPI Application → Spotify Routes: routes to (evidence: `main.py`)
- FastAPI Application → Tourism and Dining: routes to (evidence: `main.py`)
- Anime Routes → Anime Recommendations: requests recommendations (evidence: `routers/anime.py`)
- Anime Routes → Anime Data Sources: fetches data (evidence: `routers/anime.py`)
- Anime Data Sources → External Content APIs: fetches catalog and updates
- Anime Data Sources → External Content APIs: fetches live data (evidence: `services/anilist_client.py`)
- Spotify Routes → Spotify Sync: syncs listening data (evidence: `routers/spotify.py`)
- Spotify Routes → External Content APIs: requests Spotify data
- Anime Routes → Cross-Domain Profile: personalizes (evidence: `routers/anime.py`)
- Movie Recommendations → Cross-Domain Profile: uses taste profile
- Cross-Domain Profile → Recommendation Reranking: supports reranking
- Tourism and Dining → Cross-Domain Profile: personalizes recommendations (evidence: `routers/anime.py`)
- Spotify Routes → Relational Database: reads and writes (evidence: `routers/spotify.py`)
- Spotify Sync → Relational Database: reads and writes (evidence: `services/spotify_sync.py`)
- Google Sign-In → Relational Database: stores identities (evidence: `routers/google_auth.py`)
- User → Browser Extension: browses Myntra
- Browser Extension → Event Queue: queues events
- Event Queue → Event Sender: provides events (evidence: `extension/src/background/service-worker.js`)
- Event Sender → Myntra API: sends events
- API Client → Myntra API: requests fashion data (evidence: `frontend/src/api.ts`)
- Myntra API → Myntra Profile: uses profile
- Myntra API → Relational Database: persists activity
