# ranuramadan/walking-tour-energy architecture

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

- Interactive diagram: https://gitdiagram.com/ranuramadan/walking-tour-energy
- Repository: https://github.com/ranuramadan/walking-tour-energy

## Overview

This is an observation-mapping web app: field participants create or join a session, submit geolocated observations, and view results; administrators monitor observations across events. The sampled source shows session and observation reads/writes in Firestore, live admin subscriptions, and map, feed, analytics, and leaderboard views. Some capabilities are represented by substantial modules named in the source index, though their implementation was not sampled; edges are limited to visible calls or indexed references.

Main entry points: [`src/app/admin/page.tsx`](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/admin/page.tsx) (Admin dashboard), [`src/app/page.tsx`](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/page.tsx) (Observation entry), [`src/app/hasil/page.tsx`](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/hasil/page.tsx) (Results page), [`src/components/admin/MapView.tsx`](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/MapView.tsx) (Observation map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_field["Field observation"]
  node_field_entry["Observation entry<br/>[page.tsx]"]
end

subgraph group_results["Results experience"]
  node_results_page["Results page<br/>[page.tsx]"]
end

subgraph group_admin["Admin monitoring"]
  node_admin_page["Admin dashboard<br/>[page.tsx]"]
  node_filters["Dashboard filters<br/>[FilterBar.tsx]"]
  node_map["Observation map<br/>[MapView.tsx]"]
  node_feed["Observation feed"]
  node_insights["Insight panel<br/>[InsightPanel.tsx]"]
  node_leaderboard["Leaderboard view<br/>[Leaderboard.tsx]"]
  node_stat_card["Stat cards<br/>[StatCard.tsx]"]
  node_analytics["Analytics hooks<br/>[useAnalytics.ts]"]
end

subgraph group_services["Data and configuration"]
  node_observations_hook["Observation subscription<br/>[useObservations.ts]"]
  node_firebase["Firebase setup<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_event_config["Event configuration<br/>[constants.ts]"]
  node_domain_types["Observation types<br/>[index.ts]"]
end

node_participant(("Participant"))
node_administrator(("Administrator"))
node_map_tiles["OpenStreetMap tiles"]

node_participant -->|"submits observations"| node_field_entry
node_field_entry -->|"creates sessions and observations"| node_firestore
node_field_entry -->|"navigates to results"| node_results_page
node_results_page -->|"reads results"| node_firestore
node_results_page -->|"returns to entry"| node_field_entry
node_administrator -->|"opens dashboard"| node_admin_page
node_admin_page -->|"loads observations"| node_observations_hook
node_observations_hook -->|"subscribes to sessions"| node_firestore
node_observations_hook -->|"uses database client"| node_firebase
node_admin_page -->|"derives participant names"| node_analytics
node_admin_page -->|"renders filters"| node_filters
node_admin_page -->|"renders map"| node_map
node_admin_page -->|"renders insights"| node_insights
node_admin_page -->|"renders recent observations"| node_feed
node_admin_page -->|"renders rankings"| node_leaderboard
node_admin_page -->|"renders statistics"| node_stat_card
node_map -->|"loads map tiles"| node_map_tiles
node_map -->|"gets category metadata"| node_event_config
node_filters -->|"reads event options"| node_event_config
node_feed -->|"gets category metadata"| node_event_config

click node_field_entry "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/page.tsx"
click node_results_page "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/hasil/page.tsx"
click node_admin_page "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/admin/page.tsx"
click node_filters "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/FilterBar.tsx"
click node_map "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/MapView.tsx"
click node_feed "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/ObservationFeed.tsx"
click node_insights "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/InsightPanel.tsx"
click node_leaderboard "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/Leaderboard.tsx"
click node_stat_card "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/StatCard.tsx"
click node_analytics "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/hooks/useAnalytics.ts"
click node_observations_hook "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/hooks/useObservations.ts"
click node_firebase "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/firebase/firebase.ts"
click node_event_config "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/lib/constants.ts"
click node_domain_types "https://github.com/ranuramadan/walking-tour-energy/blob/main/src/types/index.ts"

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_field_entry toneBlue
class node_results_page toneAmber
class node_admin_page,node_filters,node_map,node_feed,node_insights,node_leaderboard,node_stat_card,node_analytics toneMint
class node_observations_hook,node_firebase,node_firestore,node_event_config,node_domain_types toneRose
class node_participant,node_administrator,node_map_tiles toneIndigo
```

## Components

### Field observation

- [Observation entry](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Results experience

- [Results page](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/hasil/page.tsx): `src/app/hasil/page.tsx`

### Admin monitoring

- [Admin dashboard](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Dashboard filters](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/FilterBar.tsx): `src/components/admin/FilterBar.tsx`
- [Observation map](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/MapView.tsx): `src/components/admin/MapView.tsx`
- [Observation feed](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/ObservationFeed.tsx): `src/components/admin/ObservationFeed.tsx`
- [Insight panel](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/InsightPanel.tsx): `src/components/admin/InsightPanel.tsx`
- [Leaderboard view](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/Leaderboard.tsx): `src/components/admin/Leaderboard.tsx`
- [Stat cards](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/components/admin/StatCard.tsx): `src/components/admin/StatCard.tsx`
- [Analytics hooks](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/hooks/useAnalytics.ts): `src/hooks/useAnalytics.ts`

### Data and configuration

- [Observation subscription](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/hooks/useObservations.ts): `src/hooks/useObservations.ts`
- [Firebase setup](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/firebase/firebase.ts): `src/firebase/firebase.ts`
- **Cloud Firestore**
- [Event configuration](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/lib/constants.ts): `src/lib/constants.ts`
- [Observation types](https://github.com/ranuramadan/walking-tour-energy/blob/main/src/types/index.ts): `src/types/index.ts`

### Other components

- **Participant**
- **Administrator**
- **OpenStreetMap tiles**

## Connections

- Participant → Observation entry: submits observations (evidence: `src/app/page.tsx`)
- Observation entry → Cloud Firestore: creates sessions and observations (evidence: `src/app/page.tsx`)
- Observation entry → Results page: navigates to results (evidence: `src/app/page.tsx`)
- Results page → Cloud Firestore: reads results (evidence: `src/app/hasil/page.tsx`)
- Results page → Observation entry: returns to entry (evidence: `src/app/hasil/page.tsx`)
- Administrator → Admin dashboard: opens dashboard (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Observation subscription: loads observations (evidence: `src/app/admin/page.tsx`)
- Observation subscription → Cloud Firestore: subscribes to sessions (evidence: `src/hooks/useObservations.ts`)
- Observation subscription → Firebase setup: uses database client (evidence: `src/hooks/useObservations.ts`)
- Admin dashboard → Analytics hooks: derives participant names (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Dashboard filters: renders filters (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Observation map: renders map (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Insight panel: renders insights (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Observation feed: renders recent observations (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Leaderboard view: renders rankings (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Stat cards: renders statistics (evidence: `src/app/admin/page.tsx`)
- Observation map → OpenStreetMap tiles: loads map tiles (evidence: `src/components/admin/MapView.tsx`)
- Observation map → Event configuration: gets category metadata (evidence: `src/components/admin/MapView.tsx`)
- Dashboard filters → Event configuration: reads event options (evidence: `src/components/admin/FilterBar.tsx`)
- Observation feed → Event configuration: gets category metadata (evidence: `src/components/admin/ObservationFeed.tsx`)
