# mitali-gautam05/geofood-recommender architecture

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

- Interactive diagram: https://gitdiagram.com/mitali-gautam05/geofood-recommender
- Repository: https://github.com/mitali-gautam05/geofood-recommender

## Overview

GeoTaste is a restaurant-discovery product: users browse personalized recommendations or ask conversationally, then receive ranked, explained restaurant suggestions. The backend also supports authentication, city lookup, click-based personalization, cuisine passports, challenges, and leaderboards. The tree contains native platform scaffolding but no Flutter/Dart application source, so the client is shown as an external actor. Several service relationships are supported by the README or SOURCE INDEX; unsampled integrations are omitted or marked unverified.

Main entry points: [`backend/services/recommender.py`](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/recommender.py) (Recommendation engine), [`backend/main.py`](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/main.py) (FastAPI app), [`backend/routes/social.py`](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/social.py) (Social API), [`backend/routes/chat.py`](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/chat.py) (Single-turn chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Identity"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_places["City lookup<br/>[places.py]"]
  node_recommend_route["Recommendation API<br/>[recommender.py]"]
  node_chat_route["Single-turn chat<br/>[chat.py]"]
  node_converse_route["Conversation API<br/>[converse.py]"]
  node_social_route["Social API<br/>[social.py]"]
end

subgraph group_discovery["Discovery and Chat"]
  node_ranker["Recommendation engine<br/>[recommender.py]"]
  node_scorer["Signal scoring<br/>[scorer.py]"]
  node_rag["Semantic retrieval<br/>[rag_engine.py]"]
  node_chat_orchestrator["Chat orchestration"]
  node_chat_graph["Conversation graph<br/>[chat_graph.py]"]
  node_llm["Query and explanations<br/>[llm_engine.py]"]
  node_images["Cuisine images<br/>[image_service.py]"]
  node_geo["Geolocation service<br/>[geo_service.py]"]
  node_weather["Weather service"]
end

subgraph group_engagement["Social and Personalization"]
  node_passport[("Cuisine passport<br/>[passport.py]")]
  node_clicks[("Taste click history<br/>[user_click.py]")]
  node_challenges[("Challenge completions<br/>[challenge.py]")]
end

subgraph group_persistence["State and Storage"]
  node_users[("User records<br/>[user.py]")]
  node_places_data[("Restaurant records<br/>[place.py]")]
  node_cache_service["Recommendation cache<br/>[cache.py]"]
  node_cached_results[("Persistent result cache<br/>[cached_result.py]")]
  node_redis[("Redis")]
  node_postgres[("PostgreSQL")]
  node_chroma[("ChromaDB index")]
end

node_person(("Food seeker"))
node_client["Flutter app"]
node_groq["Groq LLM"]
node_unsplash["Unsplash"]

node_person -->|"searches"| node_client
node_client -->|"HTTP requests"| node_api_app
node_api_app -->|"registers"| node_auth
node_api_app -->|"registers"| node_places
node_api_app -->|"registers"| node_recommend_route
node_api_app -->|"registers"| node_chat_route
node_api_app -->|"registers"| node_converse_route
node_api_app -->|"registers"| node_social_route
node_auth -->|"reads and writes"| node_users
node_recommend_route -->|"calls"| node_ranker
node_ranker -->|"retrieves semantic scores"| node_rag
node_ranker -.->|"scores signals"| node_scorer
node_ranker -->|"reads and records"| node_clicks
node_ranker -->|"checks cache"| node_cache_service
node_ranker -->|"gets cuisine images"| node_images
node_ranker -.->|"uses location scoring"| node_geo
node_ranker -.->|"uses weather context"| node_weather
node_rag -.->|"queries index"| node_chroma
node_chat_route -->|"calls"| node_chat_orchestrator
node_chat_route -->|"uses explanations"| node_llm
node_chat_orchestrator -->|"requests recommendations"| node_ranker
node_chat_orchestrator -->|"resolves and explains"| node_llm
node_converse_route -->|"invokes"| node_chat_graph
node_chat_graph -.->|"retrieves recommendations"| node_ranker
node_chat_graph -.->|"parses and explains"| node_llm
node_social_route -->|"reads and upserts"| node_passport
node_social_route -->|"reads activity"| node_clicks
node_social_route -->|"reads and records"| node_challenges
node_cache_service -->|"reads and writes"| node_cached_results
node_cache_service -.->|"uses cache"| node_redis
node_images -->|"reads image cache"| node_redis
node_images -.->|"prefetched images"| node_unsplash
node_api_app -->|"initializes tables"| node_postgres
node_rag -.->|"explains results"| node_groq

click node_api_app "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/main.py"
click node_auth "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/auth.py"
click node_places "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/places.py"
click node_recommend_route "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/recommender.py"
click node_chat_route "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/chat.py"
click node_converse_route "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/converse.py"
click node_social_route "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/social.py"
click node_ranker "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/recommender.py"
click node_scorer "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/scorer.py"
click node_rag "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/rag_engine.py"
click node_chat_orchestrator "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/chat_orchestrator.py"
click node_chat_graph "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/chat_graph.py"
click node_llm "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/llm_engine.py"
click node_images "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/image_service.py"
click node_geo "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/geo_service.py"
click node_passport "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/passport.py"
click node_clicks "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/user_click.py"
click node_challenges "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/challenge.py"
click node_users "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/user.py"
click node_places_data "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/place.py"
click node_cache_service "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/cache.py"
click node_cached_results "https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/cached_result.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_api_app,node_auth,node_places,node_recommend_route,node_chat_route,node_converse_route,node_social_route toneBlue
class node_ranker,node_scorer,node_rag,node_chat_orchestrator,node_chat_graph,node_llm,node_images,node_geo,node_weather toneAmber
class node_passport,node_clicks,node_challenges toneMint
class node_users,node_places_data,node_cache_service,node_cached_results,node_redis,node_postgres,node_chroma toneRose
class node_person,node_client,node_groq,node_unsplash toneIndigo
```

## Components

### API and Identity

- [FastAPI app](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [City lookup](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/places.py): `backend/routes/places.py`
- [Recommendation API](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/recommender.py): `backend/routes/recommender.py`
- [Single-turn chat](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/chat.py): `backend/routes/chat.py`
- [Conversation API](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/converse.py): `backend/routes/converse.py`
- [Social API](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/routes/social.py): `backend/routes/social.py`

### Discovery and Chat

- [Recommendation engine](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/recommender.py): `backend/services/recommender.py`
- [Signal scoring](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/scorer.py): `backend/services/scorer.py`
- [Semantic retrieval](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/rag_engine.py): `backend/services/rag_engine.py`
- [Chat orchestration](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/chat_orchestrator.py): `backend/services/chat_orchestrator.py`
- [Conversation graph](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/chat_graph.py): `backend/services/chat_graph.py`
- [Query and explanations](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/llm_engine.py): `backend/services/llm_engine.py`
- [Cuisine images](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/image_service.py): `backend/services/image_service.py`
- [Geolocation service](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/geo_service.py): `backend/services/geo_service.py`
- **Weather service**

### Social and Personalization

- [Cuisine passport](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/passport.py): `backend/models/passport.py`
- [Taste click history](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/user_click.py): `backend/models/user_click.py`
- [Challenge completions](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/challenge.py): `backend/models/challenge.py`

### State and Storage

- [User records](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/user.py): `backend/models/user.py`
- [Restaurant records](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/place.py): `backend/models/place.py`
- [Recommendation cache](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/services/cache.py): `backend/services/cache.py`
- [Persistent result cache](https://github.com/mitali-gautam05/geofood-recommender/blob/main/backend/models/cached_result.py): `backend/models/cached_result.py`
- **Redis**
- **PostgreSQL**
- **ChromaDB index**

### Other components

- **Food seeker**
- **Flutter app**
- **Groq LLM**
- **Unsplash**

## Connections

- Food seeker → Flutter app: searches (evidence: `README.md`)
- Flutter app → FastAPI app: HTTP requests (evidence: `README.md`)
- FastAPI app → Authentication: registers (evidence: `backend/main.py`)
- FastAPI app → City lookup: registers (evidence: `backend/main.py`)
- FastAPI app → Recommendation API: registers (evidence: `backend/main.py`)
- FastAPI app → Single-turn chat: registers (evidence: `backend/main.py`)
- FastAPI app → Conversation API: registers (evidence: `backend/main.py`)
- FastAPI app → Social API: registers (evidence: `backend/main.py`)
- Authentication → User records: reads and writes (evidence: `backend/routes/auth.py`)
- Recommendation API → Recommendation engine: calls (evidence: `backend/routes/recommender.py`)
- Recommendation engine → Semantic retrieval: retrieves semantic scores (evidence: `backend/services/recommender.py`)
- Recommendation engine → Signal scoring: scores signals
- Recommendation engine → Taste click history: reads and records (evidence: `backend/services/recommender.py`)
- Recommendation engine → Recommendation cache: checks cache (evidence: `backend/services/recommender.py`)
- Recommendation engine → Cuisine images: gets cuisine images (evidence: `backend/services/recommender.py`)
- Recommendation engine → Geolocation service: uses location scoring
- Recommendation engine → Weather service: uses weather context
- Semantic retrieval → ChromaDB index: queries index
- Single-turn chat → Chat orchestration: calls (evidence: `backend/routes/chat.py`)
- Single-turn chat → Query and explanations: uses explanations (evidence: `backend/routes/chat.py`)
- Chat orchestration → Recommendation engine: requests recommendations (evidence: `backend/services/chat_orchestrator.py`)
- Chat orchestration → Query and explanations: resolves and explains (evidence: `backend/services/chat_orchestrator.py`)
- Conversation API → Conversation graph: invokes (evidence: `backend/routes/converse.py`)
- Conversation graph → Recommendation engine: retrieves recommendations
- Conversation graph → Query and explanations: parses and explains
- Social API → Cuisine passport: reads and upserts (evidence: `backend/routes/social.py`)
- Social API → Taste click history: reads activity (evidence: `backend/routes/social.py`)
- Social API → Challenge completions: reads and records (evidence: `backend/routes/social.py`)
- Recommendation cache → Persistent result cache: reads and writes (evidence: `backend/services/cache.py`)
- Recommendation cache → Redis: uses cache
- Cuisine images → Redis: reads image cache (evidence: `backend/services/image_service.py`)
- Cuisine images → Unsplash: prefetched images (evidence: `README.md`)
- FastAPI app → PostgreSQL: initializes tables (evidence: `backend/main.py`)
- Semantic retrieval → Groq LLM: explains results (evidence: `README.md`)
