# kotombo123/alignroute architecture

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

- Interactive diagram: https://gitdiagram.com/kotombo123/alignroute
- Repository: https://github.com/kotombo123/alignroute

## Overview

AlignRoute coordinates group trip planning: an organizer creates a session, others join, an AI proposes attractions, participants vote, and the group receives an itinerary. The excerpts show session creation, exploration, voting-related updates, persistence, and real-time signaling; the results UI and some endpoint behavior are present in the tree but their wiring is not fully shown. Dashed edges mark frontend-to-backend or itinerary connections that cannot be verified from the supplied excerpts.

Main entry points: [`frontend/js/app.js`](https://github.com/kotombo123/alignroute/blob/main/frontend/js/app.js) (Screen orchestration), [`backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs`](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs) (Exploration operations), [`frontend/js/api.js`](https://github.com/kotombo123/alignroute/blob/main/frontend/js/api.js) (HTTP API client), [`frontend/js/voting.js`](https://github.com/kotombo123/alignroute/blob/main/frontend/js/voting.js) (Swipe voting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Planning interface"]
  node_app["Screen orchestration<br/>[app.js]"]
  node_api["HTTP API client<br/>[api.js]"]
  node_realtime_client["Realtime client<br/>[signalr-client.js]"]
  node_voting["Swipe voting<br/>[voting.js]"]
  node_swipe["Swipe gestures<br/>[swipe.js]"]
  node_map["Attraction map<br/>[map.js]"]
  node_results["Plan results<br/>[results.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

subgraph group_backend["Session backend"]
  node_session_endpoints["Session operations"]
  node_exploration_endpoints["Exploration operations"]
  node_hub["Session hub<br/>[SessionHub.cs]"]
  node_database[("SQLite data context<br/>[AppDbContext.cs]")]
  node_entities["Session domain model<br/>[Entities.cs]"]
end

subgraph group_exploration["Attraction exploration"]
  node_agent["Attraction generator<br/>[ExplorerAgent.cs]"]
end

node_travelers(("Trip participants"))
node_llm{{"PSNC language model"}}
node_openstreetmap{{"OpenStreetMap"}}

node_travelers -.->|"use"| node_app
node_app -->|"creates sessions"| node_api
node_app -->|"starts exploration"| node_api
node_app -->|"connects"| node_realtime_client
node_app -.->|"opens voting"| node_voting
node_voting -->|"initializes gestures"| node_swipe
node_voting -->|"embeds map"| node_openstreetmap
node_api -.->|"sends requests"| node_session_endpoints
node_api -.->|"requests attractions"| node_exploration_endpoints
node_app -.->|"shows results"| node_results
node_session_endpoints -->|"reads and writes"| node_database
node_session_endpoints -->|"broadcasts updates"| node_hub
node_exploration_endpoints -->|"reads and writes"| node_database
node_exploration_endpoints -->|"generates attractions"| node_agent
node_exploration_endpoints -->|"signals completion"| node_hub
node_agent -->|"requests completions"| node_llm
node_hub -.->|"sends session events"| node_realtime_client

click node_app "https://github.com/kotombo123/alignroute/blob/main/frontend/js/app.js"
click node_api "https://github.com/kotombo123/alignroute/blob/main/frontend/js/api.js"
click node_realtime_client "https://github.com/kotombo123/alignroute/blob/main/frontend/js/signalr-client.js"
click node_voting "https://github.com/kotombo123/alignroute/blob/main/frontend/js/voting.js"
click node_swipe "https://github.com/kotombo123/alignroute/blob/main/frontend/js/swipe.js"
click node_map "https://github.com/kotombo123/alignroute/blob/main/frontend/js/map.js"
click node_results "https://github.com/kotombo123/alignroute/blob/main/frontend/js/results.js"
click node_translations "https://github.com/kotombo123/alignroute/blob/main/frontend/js/i18n.js"
click node_session_endpoints "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Endpoints/SessionEndpoints.cs"
click node_exploration_endpoints "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs"
click node_hub "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Hubs/SessionHub.cs"
click node_database "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Data/AppDbContext.cs"
click node_entities "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Models/Entities.cs"
click node_agent "https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Services/ExplorerAgent.cs"

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_api,node_realtime_client,node_voting,node_swipe,node_map,node_results,node_translations toneBlue
class node_session_endpoints,node_exploration_endpoints,node_hub,node_database,node_entities toneAmber
class node_agent toneMint
class node_travelers,node_llm,node_openstreetmap toneIndigo
```

## Components

### Planning interface

- [Screen orchestration](https://github.com/kotombo123/alignroute/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [HTTP API client](https://github.com/kotombo123/alignroute/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Realtime client](https://github.com/kotombo123/alignroute/blob/main/frontend/js/signalr-client.js): `frontend/js/signalr-client.js`
- [Swipe voting](https://github.com/kotombo123/alignroute/blob/main/frontend/js/voting.js): `frontend/js/voting.js`
- [Swipe gestures](https://github.com/kotombo123/alignroute/blob/main/frontend/js/swipe.js): `frontend/js/swipe.js`
- [Attraction map](https://github.com/kotombo123/alignroute/blob/main/frontend/js/map.js): `frontend/js/map.js`
- [Plan results](https://github.com/kotombo123/alignroute/blob/main/frontend/js/results.js): `frontend/js/results.js`
- [Translations](https://github.com/kotombo123/alignroute/blob/main/frontend/js/i18n.js): `frontend/js/i18n.js`

### Session backend

- [Session operations](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Endpoints/SessionEndpoints.cs): `backend/AlignRoute.Api/Endpoints/SessionEndpoints.cs`
- [Exploration operations](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs): `backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs`
- [Session hub](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Hubs/SessionHub.cs): `backend/AlignRoute.Api/Hubs/SessionHub.cs`
- [SQLite data context](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Data/AppDbContext.cs): `backend/AlignRoute.Api/Data/AppDbContext.cs`
- [Session domain model](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Models/Entities.cs): `backend/AlignRoute.Api/Models/Entities.cs`

### Attraction exploration

- [Attraction generator](https://github.com/kotombo123/alignroute/blob/main/backend/AlignRoute.Api/Services/ExplorerAgent.cs): `backend/AlignRoute.Api/Services/ExplorerAgent.cs`

### Other components

- **Trip participants**
- **PSNC language model**
- **OpenStreetMap**

## Connections

- Trip participants → Screen orchestration: use
- Screen orchestration → HTTP API client: creates sessions (evidence: `frontend/js/app.js`)
- Screen orchestration → HTTP API client: starts exploration (evidence: `frontend/js/app.js`)
- Screen orchestration → Realtime client: connects (evidence: `frontend/js/app.js`)
- Screen orchestration → Swipe voting: opens voting
- Swipe voting → Swipe gestures: initializes gestures (evidence: `frontend/js/voting.js`)
- Swipe voting → OpenStreetMap: embeds map (evidence: `frontend/js/voting.js`)
- HTTP API client → Session operations: sends requests
- HTTP API client → Exploration operations: requests attractions
- Screen orchestration → Plan results: shows results
- Session operations → SQLite data context: reads and writes (evidence: `backend/AlignRoute.Api/Endpoints/SessionEndpoints.cs`)
- Session operations → Session hub: broadcasts updates (evidence: `backend/AlignRoute.Api/Endpoints/SessionEndpoints.cs`)
- Exploration operations → SQLite data context: reads and writes (evidence: `backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs`)
- Exploration operations → Attraction generator: generates attractions (evidence: `backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs`)
- Exploration operations → Session hub: signals completion (evidence: `backend/AlignRoute.Api/Endpoints/ExplorationEndpoints.cs`)
- Attraction generator → PSNC language model: requests completions (evidence: `backend/AlignRoute.Api/Services/ExplorerAgent.cs`)
- Session hub → Realtime client: sends session events
