# adarshamu/trekwise architecture

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

- Interactive diagram: https://gitdiagram.com/adarshamu/trekwise
- Repository: https://github.com/adarshamu/trekwise

## Overview

TrekWise is a trekking assistant. Users sign up or log in, then search for a destination, view route and weather information, and save places to favorites; profile and contact pages provide supporting features. The graph follows documented capabilities and relationships visible in the supplied excerpts or SOURCE INDEX. Chatbot implementation details and some unsampled page-to-service wiring are not established by the evidence, so those connections are left out.

Main entry points: [`src/App.jsx`](https://github.com/adarshamu/trekwise/blob/main/src/App.jsx) (App and routes), [`src/pages/Dashboard.jsx`](https://github.com/adarshamu/trekwise/blob/main/src/pages/Dashboard.jsx) (Trek dashboard), [`src/store/useStore.js`](https://github.com/adarshamu/trekwise/blob/main/src/store/useStore.js) (User and favorites state), [`src/firebase/firebase.js`](https://github.com/adarshamu/trekwise/blob/main/src/firebase/firebase.js) (Firebase setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["App and routes<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_contact["Developer contact"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_trek["Trek planning"]
  node_dashboard["Trek dashboard<br/>[Dashboard.jsx]"]
  node_search["Place search<br/>[SearchBar.jsx]"]
  node_map["Route map<br/>[MapCard.jsx]"]
  node_route["Route calculations<br/>[graphhopper.js]"]
  node_weathercard["Weather display<br/>[WeatherCard.jsx]"]
  node_weather["Weather data<br/>[weather.js]"]
  node_trekinfo["Trek information<br/>[TrekInfo.jsx]"]
  node_trekcard["Trek cards<br/>[TrekCard.jsx]"]
end

subgraph group_account["Accounts and favorites"]
  node_firebase["Firebase setup<br/>[firebase.js]"]
  node_auth["Authentication pages<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_store["User and favorites state<br/>[useStore.js]"]
  node_userservice["Profile persistence<br/>[userService.js]"]
  node_firestore[("Firestore profiles")]
  node_favorites["Favorites page<br/>[Favorites.jsx]"]
  node_profile["Profile page<br/>[Profile.jsx]"]
end

subgraph group_integrations["External services"]
  node_geo["Place lookup<br/>[geoapify.js]"]
  node_graphhopper["GraphHopper"]
  node_openmeteo["Open-Meteo"]
  node_chatproxy["Chatbot proxy<br/>[server.js]"]
  node_openai["OpenAI"]
end

node_traveler(("Traveler"))

node_traveler -->|"opens"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_favorites
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_contact
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_dashboard -->|"renders"| node_search
node_dashboard -->|"renders"| node_map
node_dashboard -->|"renders"| node_weathercard
node_dashboard -->|"renders"| node_trekinfo
node_dashboard -->|"renders"| node_trekcard
node_dashboard -->|"requests route"| node_route
node_search -->|"searches places"| node_geo
node_weathercard -->|"loads forecast"| node_weather
node_route -->|"requests directions"| node_graphhopper
node_weather -->|"fetches weather"| node_openmeteo
node_app -->|"checks session"| node_firebase
node_auth -->|"uses auth"| node_firebase
node_signup -->|"uses auth"| node_firebase
node_app -->|"initializes profile"| node_store
node_store -->|"loads and saves"| node_userservice
node_userservice -->|"uses database"| node_firebase
node_userservice -->|"reads and writes"| node_firestore
node_favorites -->|"uses favorites"| node_store
node_dashboard -->|"updates favorites"| node_store
node_profile -->|"reads and updates"| node_store
node_navbar -->|"reads state"| node_store
node_traveler -.->|"uses chatbot"| node_chatproxy
node_chatproxy -.->|"proxies requests"| node_openai

click node_app "https://github.com/adarshamu/trekwise/blob/main/src/App.jsx"
click node_dashboard "https://github.com/adarshamu/trekwise/blob/main/src/pages/Dashboard.jsx"
click node_search "https://github.com/adarshamu/trekwise/blob/main/src/components/SearchBar.jsx"
click node_map "https://github.com/adarshamu/trekwise/blob/main/src/components/MapCard.jsx"
click node_route "https://github.com/adarshamu/trekwise/blob/main/src/api/graphhopper.js"
click node_weathercard "https://github.com/adarshamu/trekwise/blob/main/src/components/WeatherCard.jsx"
click node_weather "https://github.com/adarshamu/trekwise/blob/main/src/api/weather.js"
click node_trekinfo "https://github.com/adarshamu/trekwise/blob/main/src/components/TrekInfo.jsx"
click node_trekcard "https://github.com/adarshamu/trekwise/blob/main/src/components/TrekCard.jsx"
click node_geo "https://github.com/adarshamu/trekwise/blob/main/src/api/geoapify.js"
click node_firebase "https://github.com/adarshamu/trekwise/blob/main/src/firebase/firebase.js"
click node_auth "https://github.com/adarshamu/trekwise/blob/main/src/pages/Login.jsx"
click node_signup "https://github.com/adarshamu/trekwise/blob/main/src/pages/Signup.jsx"
click node_store "https://github.com/adarshamu/trekwise/blob/main/src/store/useStore.js"
click node_userservice "https://github.com/adarshamu/trekwise/blob/main/src/services/userService.js"
click node_favorites "https://github.com/adarshamu/trekwise/blob/main/src/pages/Favorites.jsx"
click node_profile "https://github.com/adarshamu/trekwise/blob/main/src/pages/Profile.jsx"
click node_navbar "https://github.com/adarshamu/trekwise/blob/main/src/components/Navbar.jsx"
click node_about "https://github.com/adarshamu/trekwise/blob/main/src/pages/About.jsx"
click node_contact "https://github.com/adarshamu/trekwise/blob/main/src/pages/DeveloperContact.jsx"
click node_footer "https://github.com/adarshamu/trekwise/blob/main/src/components/Footer.jsx"
click node_chatproxy "https://github.com/adarshamu/trekwise/blob/main/server/server.js"

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_navbar,node_about,node_contact,node_footer toneBlue
class node_dashboard,node_search,node_map,node_route,node_weathercard,node_weather,node_trekinfo,node_trekcard toneAmber
class node_firebase,node_auth,node_signup,node_store,node_userservice,node_firestore,node_favorites,node_profile toneMint
class node_geo,node_graphhopper,node_openmeteo,node_chatproxy,node_openai toneRose
class node_traveler toneIndigo
```

## Components

### Application shell

- [App and routes](https://github.com/adarshamu/trekwise/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/adarshamu/trekwise/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [About page](https://github.com/adarshamu/trekwise/blob/main/src/pages/About.jsx): `src/pages/About.jsx`
- [Developer contact](https://github.com/adarshamu/trekwise/blob/main/src/pages/DeveloperContact.jsx): `src/pages/DeveloperContact.jsx`
- [Footer](https://github.com/adarshamu/trekwise/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Trek planning

- [Trek dashboard](https://github.com/adarshamu/trekwise/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Place search](https://github.com/adarshamu/trekwise/blob/main/src/components/SearchBar.jsx): `src/components/SearchBar.jsx`
- [Route map](https://github.com/adarshamu/trekwise/blob/main/src/components/MapCard.jsx): `src/components/MapCard.jsx`
- [Route calculations](https://github.com/adarshamu/trekwise/blob/main/src/api/graphhopper.js): `src/api/graphhopper.js`
- [Weather display](https://github.com/adarshamu/trekwise/blob/main/src/components/WeatherCard.jsx): `src/components/WeatherCard.jsx`
- [Weather data](https://github.com/adarshamu/trekwise/blob/main/src/api/weather.js): `src/api/weather.js`
- [Trek information](https://github.com/adarshamu/trekwise/blob/main/src/components/TrekInfo.jsx): `src/components/TrekInfo.jsx`
- [Trek cards](https://github.com/adarshamu/trekwise/blob/main/src/components/TrekCard.jsx): `src/components/TrekCard.jsx`

### Accounts and favorites

- [Firebase setup](https://github.com/adarshamu/trekwise/blob/main/src/firebase/firebase.js): `src/firebase/firebase.js`
- [Authentication pages](https://github.com/adarshamu/trekwise/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Signup](https://github.com/adarshamu/trekwise/blob/main/src/pages/Signup.jsx): `src/pages/Signup.jsx`
- [User and favorites state](https://github.com/adarshamu/trekwise/blob/main/src/store/useStore.js): `src/store/useStore.js`
- [Profile persistence](https://github.com/adarshamu/trekwise/blob/main/src/services/userService.js): `src/services/userService.js`
- **Firestore profiles**
- [Favorites page](https://github.com/adarshamu/trekwise/blob/main/src/pages/Favorites.jsx): `src/pages/Favorites.jsx`
- [Profile page](https://github.com/adarshamu/trekwise/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`

### External services

- [Place lookup](https://github.com/adarshamu/trekwise/blob/main/src/api/geoapify.js): `src/api/geoapify.js`
- **GraphHopper**
- **Open-Meteo**
- [Chatbot proxy](https://github.com/adarshamu/trekwise/blob/main/server/server.js): `server/server.js`
- **OpenAI**

### Other components

- **Traveler**

## Connections

- Traveler → App and routes: opens
- App and routes → Trek dashboard: routes to (evidence: `src/App.jsx`)
- App and routes → Authentication pages: routes to (evidence: `src/App.jsx`)
- App and routes → Signup: routes to (evidence: `src/App.jsx`)
- App and routes → Favorites page: routes to (evidence: `src/App.jsx`)
- App and routes → Profile page: routes to (evidence: `src/App.jsx`)
- App and routes → About page: routes to (evidence: `src/App.jsx`)
- App and routes → Developer contact: routes to (evidence: `src/App.jsx`)
- App and routes → Navigation: renders (evidence: `src/App.jsx`)
- App and routes → Footer: renders (evidence: `src/App.jsx`)
- Trek dashboard → Place search: renders (evidence: `src/pages/Dashboard.jsx`)
- Trek dashboard → Route map: renders (evidence: `src/pages/Dashboard.jsx`)
- Trek dashboard → Weather display: renders (evidence: `src/pages/Dashboard.jsx`)
- Trek dashboard → Trek information: renders (evidence: `src/pages/Dashboard.jsx`)
- Trek dashboard → Trek cards: renders (evidence: `src/pages/Dashboard.jsx`)
- Trek dashboard → Route calculations: requests route (evidence: `src/pages/Dashboard.jsx`)
- Place search → Place lookup: searches places (evidence: `src/components/SearchBar.jsx`)
- Weather display → Weather data: loads forecast (evidence: `src/components/WeatherCard.jsx`)
- Route calculations → GraphHopper: requests directions (evidence: `src/api/graphhopper.js`)
- Weather data → Open-Meteo: fetches weather (evidence: `src/api/weather.js`)
- App and routes → Firebase setup: checks session (evidence: `src/App.jsx`)
- Authentication pages → Firebase setup: uses auth (evidence: `src/pages/Login.jsx`)
- Signup → Firebase setup: uses auth (evidence: `src/pages/Signup.jsx`)
- App and routes → User and favorites state: initializes profile (evidence: `src/App.jsx`)
- User and favorites state → Profile persistence: loads and saves (evidence: `src/store/useStore.js`)
- Profile persistence → Firebase setup: uses database (evidence: `src/services/userService.js`)
- Profile persistence → Firestore profiles: reads and writes (evidence: `src/services/userService.js`)
- Favorites page → User and favorites state: uses favorites (evidence: `src/pages/Favorites.jsx`)
- Trek dashboard → User and favorites state: updates favorites (evidence: `src/pages/Dashboard.jsx`)
- Profile page → User and favorites state: reads and updates (evidence: `src/pages/Profile.jsx`)
- Navigation → User and favorites state: reads state (evidence: `src/components/Navbar.jsx`)
- Traveler → Chatbot proxy: uses chatbot (evidence: `README.md`)
- Chatbot proxy → OpenAI: proxies requests (evidence: `README.md`)
