# drissakov/hackatonqbersgdg architecture

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

- Interactive diagram: https://gitdiagram.com/drissakov/hackatonqbersgdg
- Repository: https://github.com/drissakov/hackatonqbersgdg

## Overview

Qadam Astana helps a user choose one Astana place or event under time, location, and budget constraints. The main workflow runs from the React search form through the FastAPI API to POI recommendations or transient event search, then renders results; optional walking routes provide travel estimates. A separate OSM ingestion path acquires and normalizes POIs for trusted persistence. The graph preserves documented event discovery, database coverage, and 2GIS capabilities. Some backend orchestration is unsampled, so uncertain internal call edges are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/App.tsx) (Search interface), [`backend/app/api.py`](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/api.py) (HTTP API), [`ingestion/cli.py`](https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/cli.py) (Ingestion workflow), [`backend/app/services/events/discover.py`](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/discover.py) (Web discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Search experience"]
  node_webapp["Search interface<br/>[App.tsx]"]
  node_searchform["Search form<br/>[SearchForm.tsx]"]
  node_resultviews["Result views<br/>[ResultCard.tsx]"]
  node_eventviews["Event views"]
  node_destination["Destination details"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_api["API and recommendations"]
  node_fastapi["HTTP API<br/>[api.py]"]
  node_recommend["POI recommendations<br/>[recommend.py]"]
  node_retrieval["POI retrieval<br/>[retrieval.py]"]
  node_route["Walking routes<br/>[twogis.py]"]
end

subgraph group_events["Event discovery"]
  node_eventrecommend["Event search<br/>[event_recommend.py]"]
  node_eventdiscover["Web discovery<br/>[discover.py]"]
  node_eventnormalize["Event normalization<br/>[normalize.py]"]
  node_eventmodels["Event models<br/>[models.py]"]
end

subgraph group_data["POI data and ingestion"]
  node_repository["POI repository<br/>[repository.py]"]
  node_database[("Postgres database<br/>[database.py]")]
  node_osm["OSM acquisition<br/>[osm.py]"]
  node_ingestcli["Ingestion workflow<br/>[cli.py]"]
  node_ingestnormalize["POI normalization<br/>[normalize.py]"]
end

node_visitor(("Astana visitor"))
node_two_gis{{"2GIS services"}}
node_openai{{"OpenAI services"}}

node_visitor -->|"searches"| node_webapp
node_webapp -->|"renders"| node_searchform
node_webapp -->|"requests"| node_clientapi
node_clientapi -->|"calls"| node_fastapi
node_webapp -->|"renders"| node_resultviews
node_webapp -->|"renders"| node_eventviews
node_webapp -->|"renders"| node_destination
node_fastapi -->|"serves recommendations"| node_recommend
node_fastapi -->|"serves event search"| node_eventrecommend
node_fastapi -->|"serves route requests"| node_route
node_fastapi -->|"reads coverage"| node_repository
node_recommend -.->|"uses retrieval"| node_retrieval
node_route -->|"requests walking routes"| node_two_gis
node_eventrecommend -.->|"coordinates discovery"| node_eventdiscover
node_eventdiscover -->|"searches and extracts"| node_openai
node_eventdiscover -.->|"normalizes results"| node_eventnormalize
node_eventnormalize -->|"uses models"| node_eventmodels
node_repository -->|"uses pool"| node_database
node_ingestcli -->|"fetches data"| node_osm
node_ingestcli -->|"normalizes records"| node_ingestnormalize
node_ingestcli -->|"upserts POIs"| node_repository
node_ingestnormalize -->|"uses source data"| node_osm

click node_webapp "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/App.tsx"
click node_searchform "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/SearchForm.tsx"
click node_resultviews "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/ResultCard.tsx"
click node_eventviews "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/DiscoveredEventCard.tsx"
click node_destination "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/DestinationDetails.tsx"
click node_clientapi "https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/lib/api.ts"
click node_fastapi "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/api.py"
click node_recommend "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/recommend.py"
click node_retrieval "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/retrieval.py"
click node_route "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/twogis.py"
click node_eventrecommend "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/event_recommend.py"
click node_eventdiscover "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/discover.py"
click node_eventnormalize "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/normalize.py"
click node_eventmodels "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/models.py"
click node_repository "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/repository.py"
click node_database "https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/database.py"
click node_osm "https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/osm.py"
click node_ingestcli "https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/cli.py"
click node_ingestnormalize "https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/normalize.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_searchform,node_resultviews,node_eventviews,node_destination,node_clientapi toneBlue
class node_fastapi,node_recommend,node_retrieval,node_route toneAmber
class node_eventrecommend,node_eventdiscover,node_eventnormalize,node_eventmodels toneMint
class node_repository,node_database,node_osm,node_ingestcli,node_ingestnormalize toneRose
class node_visitor,node_two_gis,node_openai toneIndigo
```

## Components

### Search experience

- [Search interface](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Search form](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/SearchForm.tsx): `frontend/src/components/SearchForm.tsx`
- [Result views](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/ResultCard.tsx): `frontend/src/components/ResultCard.tsx`
- [Event views](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/DiscoveredEventCard.tsx): `frontend/src/components/DiscoveredEventCard.tsx`
- [Destination details](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/components/DestinationDetails.tsx): `frontend/src/components/DestinationDetails.tsx`
- [API client](https://github.com/drissakov/hackatonqbersgdg/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and recommendations

- [HTTP API](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/api.py): `backend/app/api.py`
- [POI recommendations](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/recommend.py): `backend/app/recommend.py`
- [POI retrieval](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/retrieval.py): `backend/app/retrieval.py`
- [Walking routes](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/twogis.py): `backend/app/services/twogis.py`

### Event discovery

- [Event search](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/event_recommend.py): `backend/app/event_recommend.py`
- [Web discovery](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/discover.py): `backend/app/services/events/discover.py`
- [Event normalization](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/normalize.py): `backend/app/services/events/normalize.py`
- [Event models](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/services/events/models.py): `backend/app/services/events/models.py`

### POI data and ingestion

- [POI repository](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/repository.py): `backend/app/repository.py`
- [Postgres database](https://github.com/drissakov/hackatonqbersgdg/blob/main/backend/app/database.py): `backend/app/database.py`
- [OSM acquisition](https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/osm.py): `ingestion/osm.py`
- [Ingestion workflow](https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/cli.py): `ingestion/cli.py`
- [POI normalization](https://github.com/drissakov/hackatonqbersgdg/blob/main/ingestion/normalize.py): `ingestion/normalize.py`

### Other components

- **Astana visitor**
- **2GIS services**
- **OpenAI services**

## Connections

- Astana visitor → Search interface: searches (evidence: `README.md`)
- Search interface → Search form: renders (evidence: `frontend/src/App.tsx`)
- Search interface → API client: requests (evidence: `frontend/src/App.tsx`)
- API client → HTTP API: calls (evidence: `README.md`)
- Search interface → Result views: renders (evidence: `frontend/src/App.tsx`)
- Search interface → Event views: renders (evidence: `frontend/src/App.tsx`)
- Search interface → Destination details: renders (evidence: `frontend/src/App.tsx`)
- HTTP API → POI recommendations: serves recommendations (evidence: `README.md`)
- HTTP API → Event search: serves event search (evidence: `README.md`)
- HTTP API → Walking routes: serves route requests (evidence: `README.md`)
- HTTP API → POI repository: reads coverage (evidence: `README.md`)
- POI recommendations → POI retrieval: uses retrieval
- Walking routes → 2GIS services: requests walking routes (evidence: `README.md`)
- Event search → Web discovery: coordinates discovery
- Web discovery → OpenAI services: searches and extracts (evidence: `README.md`)
- Web discovery → Event normalization: normalizes results (evidence: `backend/app/services/events/discover.py`)
- Event normalization → Event models: uses models (evidence: `backend/app/services/events/normalize.py`)
- POI repository → Postgres database: uses pool (evidence: `backend/app/repository.py`)
- Ingestion workflow → OSM acquisition: fetches data (evidence: `ingestion/cli.py`)
- Ingestion workflow → POI normalization: normalizes records (evidence: `ingestion/cli.py`)
- Ingestion workflow → POI repository: upserts POIs (evidence: `ingestion/cli.py`)
- POI normalization → OSM acquisition: uses source data (evidence: `ingestion/normalize.py`)
