# mm1itriq-dotcom/shmagh architecture

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

- Interactive diagram: https://gitdiagram.com/mm1itriq-dotcom/shmagh
- Repository: https://github.com/mm1itriq-dotcom/shmagh

## Overview

SHMAGH is a Jordan travel guide and trip-planning web application. A visitor can create an account, browse destinations, and request a generated journey; the browser calls a FastAPI backend, which reads and updates Firebase data and can use generative AI for itinerary planning. The interface also presents travel stories, gallery and cultural content, user profile features, and a currency converter. The README only names the product, and backend excerpts are partial, so links for unsampled features reflect documented routes or visible frontend requests only where supported.

Main entry points: [`backend/main.py`](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py) (FastAPI application), [`backend/firebase_config.py`](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/firebase_config.py) (Firebase Firestore), [`frontend/js/destinations.js`](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/destinations.js) (Destination browser), [`frontend/js/home.js`](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/home.js) (Home experience)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_auth_ui["Sign-in UI<br/>[app.js]"]
  node_auth_page["Sign-in page<br/>[index.html]"]
  node_dest_ui["Destination browser<br/>[destinations.js]"]
  node_dest_page["Destinations page<br/>[destinations.html]"]
  node_home_ui["Home experience<br/>[home.js]"]
  node_home_page["Home page<br/>[home.html]"]
  node_gallery_page["Gallery page<br/>[gallery.html]"]
  node_profile_ui["Profile features<br/>[profile.js]"]
  node_profile_page["Profile page<br/>[profile.html]"]
  node_converter["Currency converter<br/>[converter.js]"]
end

subgraph group_api["Backend API"]
  node_api["FastAPI application<br/>[main.py]"]
  node_auth["Account handling<br/>[main.py]"]
  node_catalog["Travel catalog<br/>[main.py]"]
  node_planner["Journey planning<br/>[main.py]"]
  node_community["Community content<br/>[main.py]"]
  node_profile_api["User profile<br/>[main.py]"]
end

subgraph group_data["Travel data"]
  node_firestore[("Firebase Firestore<br/>[firebase_config.py]")]
end

subgraph group_integrations["External services"]
  node_gemini["Generative AI"]
  node_weather["Open-Meteo"]
  node_rates["Exchange-rate API"]
end

node_visitor(("Traveler"))

node_visitor -->|"opens"| node_auth_page
node_visitor -->|"browses"| node_dest_page
node_visitor -->|"explores"| node_home_page
node_visitor -->|"views"| node_gallery_page
node_visitor -->|"manages account"| node_profile_page
node_auth_page -->|"loads"| node_auth_ui
node_auth_ui -->|"registers or logs in"| node_auth
node_dest_page -->|"loads"| node_dest_ui
node_dest_ui -->|"requests destinations"| node_catalog
node_dest_ui -->|"requests journey"| node_planner
node_home_page -->|"loads"| node_home_ui
node_home_ui -->|"requests stories"| node_community
node_home_ui -->|"fetches forecast"| node_weather
node_gallery_page -.->|"gallery content"| node_community
node_profile_page -->|"loads"| node_profile_ui
node_profile_ui -->|"updates profile"| node_profile_api
node_profile_ui -->|"updates password"| node_auth
node_converter -->|"fetches rates"| node_rates
node_api -->|"dispatches"| node_auth
node_api -->|"dispatches"| node_catalog
node_api -->|"dispatches"| node_planner
node_api -->|"dispatches"| node_community
node_api -->|"dispatches"| node_profile_api
node_auth -->|"reads and writes"| node_firestore
node_catalog -->|"reads"| node_firestore
node_planner -->|"reads"| node_firestore
node_planner -.->|"generates itinerary"| node_gemini
node_community -->|"reads and writes"| node_firestore
node_profile_api -->|"reads and writes"| node_firestore

click node_auth_ui "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/app.js"
click node_auth_page "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/index.html"
click node_dest_ui "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/destinations.js"
click node_dest_page "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/destinations.html"
click node_home_ui "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/home.js"
click node_home_page "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/home.html"
click node_gallery_page "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/gallery.html"
click node_profile_ui "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/profile.js"
click node_profile_page "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/profile.html"
click node_converter "https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/converter.js"
click node_api "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_auth "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_catalog "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_planner "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_community "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_profile_api "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py"
click node_firestore "https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/firebase_config.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_auth_ui,node_auth_page,node_dest_ui,node_dest_page,node_home_ui,node_home_page,node_gallery_page,node_profile_ui,node_profile_page,node_converter toneBlue
class node_api,node_auth,node_catalog,node_planner,node_community,node_profile_api toneAmber
class node_firestore toneMint
class node_gemini,node_weather,node_rates toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Sign-in UI](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Sign-in page](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/index.html): `frontend/index.html`
- [Destination browser](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/destinations.js): `frontend/js/destinations.js`
- [Destinations page](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/destinations.html): `frontend/destinations.html`
- [Home experience](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/home.js): `frontend/js/home.js`
- [Home page](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/home.html): `frontend/home.html`
- [Gallery page](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/gallery.html): `frontend/gallery.html`
- [Profile features](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/profile.js): `frontend/js/profile.js`
- [Profile page](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/profile.html): `frontend/profile.html`
- [Currency converter](https://github.com/mm1itriq-dotcom/shmagh/blob/main/frontend/js/converter.js): `frontend/js/converter.js`

### Backend API

- [FastAPI application](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`
- [Account handling](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`
- [Travel catalog](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`
- [Journey planning](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`
- [Community content](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`
- [User profile](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/main.py): `backend/main.py`

### Travel data

- [Firebase Firestore](https://github.com/mm1itriq-dotcom/shmagh/blob/main/backend/firebase_config.py): `backend/firebase_config.py`

### External services

- **Generative AI**
- **Open-Meteo**
- **Exchange-rate API**

### Other components

- **Traveler**

## Connections

- Traveler → Sign-in page: opens
- Traveler → Destinations page: browses
- Traveler → Home page: explores
- Traveler → Gallery page: views
- Traveler → Profile page: manages account
- Sign-in page → Sign-in UI: loads
- Sign-in UI → Account handling: registers or logs in
- Destinations page → Destination browser: loads
- Destination browser → Travel catalog: requests destinations
- Destination browser → Journey planning: requests journey
- Home page → Home experience: loads
- Home experience → Community content: requests stories
- Home experience → Open-Meteo: fetches forecast
- Gallery page → Community content: gallery content
- Profile page → Profile features: loads
- Profile features → User profile: updates profile
- Profile features → Account handling: updates password
- Currency converter → Exchange-rate API: fetches rates
- FastAPI application → Account handling: dispatches
- FastAPI application → Travel catalog: dispatches
- FastAPI application → Journey planning: dispatches
- FastAPI application → Community content: dispatches
- FastAPI application → User profile: dispatches
- Account handling → Firebase Firestore: reads and writes
- Travel catalog → Firebase Firestore: reads
- Journey planning → Firebase Firestore: reads
- Journey planning → Generative AI: generates itinerary
- Community content → Firebase Firestore: reads and writes
- User profile → Firebase Firestore: reads and writes
