# sep-group-10/tripmate architecture

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

- Interactive diagram: https://gitdiagram.com/sep-group-10/tripmate
- Repository: https://github.com/sep-group-10/tripmate

## Overview

TripMate is a tourism-planning product with React web and Flutter mobile clients backed by a FastAPI service. The primary workflow is a traveller chatting about trip preferences, receiving an AI-generated itinerary, then editing and saving it. The README also describes account access, tourism-data administration, budget and route planning, weather checks, and super-admin tools. Backend orchestration beyond the shown entry points is only partly evidenced; uncertain internal links are dashed and left uncited.

Main entry points: [`backend/app/main.py`](https://github.com/sep-group-10/tripmate/blob/main/backend/app/main.py) (FastAPI App), [`web/src/routes/AppRoutes.jsx`](https://github.com/sep-group-10/tripmate/blob/main/web/src/routes/AppRoutes.jsx) (App Routes), [`backend/app/services/tools`](https://github.com/sep-group-10/tripmate/tree/main/backend/app/services/tools) (Planning Tools), [`backend/app/services/itinerary_service.py`](https://github.com/sep-group-10/tripmate/blob/main/backend/app/services/itinerary_service.py) (Itinerary Persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Clients"]
  node_web["React Web<br/>[main.jsx]"]
  node_mobile["Flutter App"]
  node_web_routes["App Routes<br/>[AppRoutes.jsx]"]
  node_chat_ui["Planning Chat"]
  node_trip_ui["Trip Management<br/>[MyTripsPage.jsx]"]
  node_web_api["Web API Client<br/>[api.js]"]
  node_chat_service["Chat Service<br/>[chatService.js]"]
  node_trips_service["Trips Service<br/>[tripsService.js]"]
end

subgraph group_api["API and Access"]
  node_backend["FastAPI App<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_chat_router["Chat API<br/>[chat.py]"]
  node_trip_router["Trips API<br/>[trips.py]"]
  node_database[("Database<br/>[database.py]")]
end

subgraph group_planning["Trip Planning"]
  node_agent_planner["Agentic Planner"]
  node_planning_tools["Planning Tools"]
  node_scheduler["Itinerary Scheduler"]
  node_itinerary_service["Itinerary Persistence"]
  node_trip_model[("Trip Records<br/>[trip.py]")]
end

subgraph group_data["Tourism Data"]
  node_tourism_api["Tourism API<br/>[tourism.py]"]
  node_tourism_store[("Tourism Records<br/>[destination.py]")]
end

subgraph group_operations["Administration"]
  node_admin_router["Admin API<br/>[admin.py]"]
  node_admin_ui["Admin Tools<br/>[AdminDashboard.jsx]"]
end

node_traveller(("Traveller"))
node_maps_weather["Maps and Weather"]
node_email_storage["Email and File Services"]

node_traveller -->|"uses"| node_web
node_traveller -->|"uses"| node_mobile
node_web -->|"renders"| node_web_routes
node_web_routes -->|"routes to"| node_chat_ui
node_web_routes -->|"routes to"| node_trip_ui
node_chat_ui -.->|"requests chat"| node_chat_service
node_trip_ui -.->|"manages trips"| node_trips_service
node_chat_service -->|"calls"| node_web_api
node_trips_service -->|"calls"| node_web_api
node_web_api -->|"HTTP API"| node_backend
node_mobile -->|"uses API"| node_backend
node_backend -->|"registers"| node_auth
node_backend -->|"registers"| node_chat_router
node_backend -->|"registers"| node_trip_router
node_backend -->|"registers"| node_tourism_api
node_backend -->|"registers"| node_admin_router
node_chat_router -.->|"dispatches planning"| node_agent_planner
node_agent_planner -.->|"selects actions"| node_planning_tools
node_planning_tools -.->|"schedules candidates"| node_scheduler
node_scheduler -.->|"produces itinerary"| node_itinerary_service
node_itinerary_service -->|"persists trip"| node_trip_model
node_itinerary_service -.->|"writes records"| node_database
node_trip_router -->|"uses sessions"| node_database
node_tourism_api -->|"reads and writes"| node_tourism_store
node_admin_ui -.->|"manages data"| node_admin_router
node_admin_router -->|"uses sessions"| node_database
node_planning_tools -.->|"checks routes and weather"| node_maps_weather
node_auth -.->|"sends email"| node_email_storage
node_tourism_api -.->|"stores images"| node_email_storage

click node_web "https://github.com/sep-group-10/tripmate/blob/main/web/src/main.jsx"
click node_mobile "https://github.com/sep-group-10/tripmate/tree/main/mobile"
click node_web_routes "https://github.com/sep-group-10/tripmate/blob/main/web/src/routes/AppRoutes.jsx"
click node_chat_ui "https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/TripPlanChatPage.jsx"
click node_trip_ui "https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/MyTripsPage.jsx"
click node_web_api "https://github.com/sep-group-10/tripmate/blob/main/web/src/services/api.js"
click node_chat_service "https://github.com/sep-group-10/tripmate/blob/main/web/src/services/chatService.js"
click node_trips_service "https://github.com/sep-group-10/tripmate/blob/main/web/src/services/tripsService.js"
click node_backend "https://github.com/sep-group-10/tripmate/blob/main/backend/app/main.py"
click node_auth "https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/auth.py"
click node_chat_router "https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/chat.py"
click node_trip_router "https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/trips.py"
click node_tourism_api "https://github.com/sep-group-10/tripmate/blob/main/backend/app/api/tourism.py"
click node_agent_planner "https://github.com/sep-group-10/tripmate/tree/main/backend/app/services/langgraph"
click node_planning_tools "https://github.com/sep-group-10/tripmate/tree/main/backend/app/services/tools"
click node_scheduler "https://github.com/sep-group-10/tripmate/blob/main/backend/app/services/tools/scheduling_engine.py"
click node_itinerary_service "https://github.com/sep-group-10/tripmate/blob/main/backend/app/services/itinerary_service.py"
click node_trip_model "https://github.com/sep-group-10/tripmate/blob/main/backend/app/models/trip.py"
click node_database "https://github.com/sep-group-10/tripmate/blob/main/backend/app/core/database.py"
click node_admin_router "https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/admin.py"
click node_admin_ui "https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/admin/AdminDashboard.jsx"
click node_tourism_store "https://github.com/sep-group-10/tripmate/blob/main/backend/app/models/destination.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_web,node_mobile,node_web_routes,node_chat_ui,node_trip_ui,node_web_api,node_chat_service,node_trips_service toneBlue
class node_backend,node_auth,node_chat_router,node_trip_router,node_database toneAmber
class node_agent_planner,node_planning_tools,node_scheduler,node_itinerary_service,node_trip_model toneMint
class node_tourism_api,node_tourism_store toneRose
class node_admin_router,node_admin_ui,node_traveller,node_maps_weather,node_email_storage toneIndigo
```

## Components

### User Clients

- [React Web](https://github.com/sep-group-10/tripmate/blob/main/web/src/main.jsx): `web/src/main.jsx`
- [Flutter App](https://github.com/sep-group-10/tripmate/tree/main/mobile): `mobile`
- [App Routes](https://github.com/sep-group-10/tripmate/blob/main/web/src/routes/AppRoutes.jsx): `web/src/routes/AppRoutes.jsx`
- [Planning Chat](https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/TripPlanChatPage.jsx): `web/src/pages/TripPlanChatPage.jsx`
- [Trip Management](https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/MyTripsPage.jsx): `web/src/pages/MyTripsPage.jsx`
- [Web API Client](https://github.com/sep-group-10/tripmate/blob/main/web/src/services/api.js): `web/src/services/api.js`
- [Chat Service](https://github.com/sep-group-10/tripmate/blob/main/web/src/services/chatService.js): `web/src/services/chatService.js`
- [Trips Service](https://github.com/sep-group-10/tripmate/blob/main/web/src/services/tripsService.js): `web/src/services/tripsService.js`

### API and Access

- [FastAPI App](https://github.com/sep-group-10/tripmate/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Chat API](https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/chat.py): `backend/app/routers/chat.py`
- [Trips API](https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/trips.py): `backend/app/routers/trips.py`
- [Database](https://github.com/sep-group-10/tripmate/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Trip Planning

- [Agentic Planner](https://github.com/sep-group-10/tripmate/tree/main/backend/app/services/langgraph): `backend/app/services/langgraph`
- [Planning Tools](https://github.com/sep-group-10/tripmate/tree/main/backend/app/services/tools): `backend/app/services/tools`
- [Itinerary Scheduler](https://github.com/sep-group-10/tripmate/blob/main/backend/app/services/tools/scheduling_engine.py): `backend/app/services/tools/scheduling_engine.py`
- [Itinerary Persistence](https://github.com/sep-group-10/tripmate/blob/main/backend/app/services/itinerary_service.py): `backend/app/services/itinerary_service.py`
- [Trip Records](https://github.com/sep-group-10/tripmate/blob/main/backend/app/models/trip.py): `backend/app/models/trip.py`

### Tourism Data

- [Tourism API](https://github.com/sep-group-10/tripmate/blob/main/backend/app/api/tourism.py): `backend/app/api/tourism.py`
- [Tourism Records](https://github.com/sep-group-10/tripmate/blob/main/backend/app/models/destination.py): `backend/app/models/destination.py`

### Administration

- [Admin API](https://github.com/sep-group-10/tripmate/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Admin Tools](https://github.com/sep-group-10/tripmate/blob/main/web/src/pages/admin/AdminDashboard.jsx): `web/src/pages/admin/AdminDashboard.jsx`

### Other components

- **Traveller**
- **Maps and Weather**
- **Email and File Services**

## Connections

- Traveller → React Web: uses (evidence: `README.md`)
- Traveller → Flutter App: uses (evidence: `README.md`)
- React Web → App Routes: renders
- App Routes → Planning Chat: routes to (evidence: `web/src/routes/AppRoutes.jsx`)
- App Routes → Trip Management: routes to (evidence: `web/src/routes/AppRoutes.jsx`)
- Planning Chat → Chat Service: requests chat
- Trip Management → Trips Service: manages trips
- Chat Service → Web API Client: calls (evidence: `web/src/services/chatService.js`)
- Trips Service → Web API Client: calls (evidence: `web/src/services/tripsService.js`)
- Web API Client → FastAPI App: HTTP API (evidence: `README.md`)
- Flutter App → FastAPI App: uses API (evidence: `README.md`)
- FastAPI App → Authentication: registers (evidence: `backend/app/main.py`)
- FastAPI App → Chat API: registers (evidence: `backend/app/main.py`)
- FastAPI App → Trips API: registers (evidence: `backend/app/main.py`)
- FastAPI App → Tourism API: registers (evidence: `backend/app/main.py`)
- FastAPI App → Admin API: registers (evidence: `backend/app/main.py`)
- Chat API → Agentic Planner: dispatches planning (evidence: `backend/app/routers/chat.py`)
- Agentic Planner → Planning Tools: selects actions
- Planning Tools → Itinerary Scheduler: schedules candidates (evidence: `backend/app/services/tools/scheduling_engine.py`)
- Itinerary Scheduler → Itinerary Persistence: produces itinerary
- Itinerary Persistence → Trip Records: persists trip (evidence: `backend/app/services/itinerary_service.py`)
- Itinerary Persistence → Database: writes records
- Trips API → Database: uses sessions (evidence: `backend/app/routers/trips.py`)
- Tourism API → Tourism Records: reads and writes (evidence: `backend/app/api/tourism.py`)
- Admin Tools → Admin API: manages data
- Admin API → Database: uses sessions (evidence: `backend/app/routers/admin.py`)
- Planning Tools → Maps and Weather: checks routes and weather (evidence: `README.md`)
- Authentication → Email and File Services: sends email (evidence: `backend/app/routers/auth.py`)
- Tourism API → Email and File Services: stores images (evidence: `backend/app/api/tourism.py`)
