# tinashe2023/eastern-sojourner architecture

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

- Interactive diagram: https://gitdiagram.com/tinashe2023/eastern-sojourner
- Repository: https://github.com/tinashe2023/eastern-sojourner

## Overview

Eastern Sojourner combines a North-East India tourism website with a Safety Hub and companion authentication app. The documented verification workflow is: a visitor opens the Safety Hub, obtains a QR challenge, scans it in the mobile app after biometric gating, and the backend verifies the signed location-bound payload; the web interface can then poll verification status. Tourism pages also provide destination and itinerary browsing. The sampled excerpts support the app-to-API verification and SOS calls; unsampled page wiring is represented only where the backend documents the capability.

Main entry points: [`backend/server.js`](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/server.js) (Safety API), [`auth-app/screens/ScanScreen.js`](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/ScanScreen.js) (QR Scanner), [`backend/crypto-utils.js`](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/crypto-utils.js) (Nonce and Verification), [`auth-app/utils/api.js`](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/utils/api.js) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tourism["Tourism Website"]
  node_home["Tourism Home<br/>[index.html]"]
  node_statepages["State Destinations<br/>[assam.html]"]
  node_statecontent["State Content<br/>[states.js]"]
  node_siteinteractions["Site Interactions<br/>[script.js]"]
end

subgraph group_safetyweb["Safety Hub Web"]
  node_safetyentry["Safety Hub<br/>[index.html]"]
  node_safetyconnect["QR Connect<br/>[connect.html]"]
  node_safetydashboard["Safety Dashboard<br/>[dashboard.html]"]
end

subgraph group_mobile["Mobile Authentication"]
  node_mobileapp["Auth App<br/>[App.js]"]
  node_biometric["Biometric Gate<br/>[BiometricGate.js]"]
  node_scanner["QR Scanner<br/>[ScanScreen.js]"]
  node_signing["Key Signing<br/>[crypto.js]"]
  node_mobileapi["API Client<br/>[api.js]"]
  node_result["Verification Result<br/>[StatusScreen.js]"]
end

subgraph group_server["Safety Backend"]
  node_backend["Safety API<br/>[server.js]"]
  node_cryptoutils["Nonce and Verification<br/>[crypto-utils.js]"]
  node_noncestore[("Nonce State<br/>[crypto-utils.js]")]
  node_incidentstore[("Incident State<br/>[server.js]")]
end

node_visitor(("Traveler"))
node_device(("Device Services"))
node_traveler(("Traveler"))

node_visitor -->|"browses"| node_home
node_visitor -->|"explores"| node_statepages
node_statepages -->|"uses"| node_statecontent
node_home -->|"uses"| node_siteinteractions
node_visitor -->|"opens"| node_safetyentry
node_safetyentry -->|"continues"| node_safetyconnect
node_safetyconnect -->|"requests challenge"| node_backend
node_backend -->|"generates nonce"| node_cryptoutils
node_cryptoutils -->|"stores nonce"| node_noncestore
node_backend -->|"returns QR data"| node_safetyconnect
node_visitor -->|"uses"| node_mobileapp
node_mobileapp -->|"navigates"| node_biometric
node_biometric -->|"unlocks"| node_scanner
node_device -->|"authenticates"| node_biometric
node_device -->|"provides camera and GPS"| node_scanner
node_scanner -->|"requests keys and signature"| node_signing
node_scanner -->|"submits payload"| node_mobileapi
node_mobileapi -->|"POST verify or SOS"| node_backend
node_backend -->|"checks signature and nonce"| node_cryptoutils
node_cryptoutils -->|"consumes and marks"| node_noncestore
node_backend -->|"records SOS"| node_incidentstore
node_mobileapi -->|"returns response"| node_scanner
node_scanner -->|"shows outcome"| node_result
node_safetydashboard -->|"polls verification status"| node_backend
node_backend -->|"reads nonce status"| node_cryptoutils
node_backend -->|"returns status and incidents"| node_safetydashboard
node_backend -->|"reads recent incidents"| node_incidentstore
node_traveler -.->|"reports SOS"| node_mobileapi

click node_home "https://github.com/tinashe2023/eastern-sojourner/blob/master/index.html"
click node_statepages "https://github.com/tinashe2023/eastern-sojourner/blob/master/assam.html"
click node_statecontent "https://github.com/tinashe2023/eastern-sojourner/blob/master/states.js"
click node_siteinteractions "https://github.com/tinashe2023/eastern-sojourner/blob/master/script.js"
click node_safetyentry "https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/index.html"
click node_safetyconnect "https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/connect.html"
click node_safetydashboard "https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/dashboard.html"
click node_mobileapp "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/App.js"
click node_biometric "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/BiometricGate.js"
click node_scanner "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/ScanScreen.js"
click node_signing "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/utils/crypto.js"
click node_mobileapi "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/utils/api.js"
click node_result "https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/StatusScreen.js"
click node_backend "https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/server.js"
click node_cryptoutils "https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/crypto-utils.js"
click node_noncestore "https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/crypto-utils.js"
click node_incidentstore "https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/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_home,node_statepages,node_statecontent,node_siteinteractions toneBlue
class node_safetyentry,node_safetyconnect,node_safetydashboard toneAmber
class node_mobileapp,node_biometric,node_scanner,node_signing,node_mobileapi,node_result toneMint
class node_backend,node_cryptoutils,node_noncestore,node_incidentstore toneRose
class node_visitor,node_device,node_traveler toneIndigo
```

## Components

### Tourism Website

- [Tourism Home](https://github.com/tinashe2023/eastern-sojourner/blob/master/index.html): `index.html`
- [State Destinations](https://github.com/tinashe2023/eastern-sojourner/blob/master/assam.html): `assam.html`
- [State Content](https://github.com/tinashe2023/eastern-sojourner/blob/master/states.js): `states.js`
- [Site Interactions](https://github.com/tinashe2023/eastern-sojourner/blob/master/script.js): `script.js`

### Safety Hub Web

- [Safety Hub](https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/index.html): `safety/index.html`
- [QR Connect](https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/connect.html): `safety/connect.html`
- [Safety Dashboard](https://github.com/tinashe2023/eastern-sojourner/blob/master/safety/dashboard.html): `safety/dashboard.html`

### Mobile Authentication

- [Auth App](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/App.js): `auth-app/App.js`
- [Biometric Gate](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/BiometricGate.js): `auth-app/screens/BiometricGate.js`
- [QR Scanner](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/ScanScreen.js): `auth-app/screens/ScanScreen.js`
- [Key Signing](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/utils/crypto.js): `auth-app/utils/crypto.js`
- [API Client](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/utils/api.js): `auth-app/utils/api.js`
- [Verification Result](https://github.com/tinashe2023/eastern-sojourner/blob/master/auth-app/screens/StatusScreen.js): `auth-app/screens/StatusScreen.js`

### Safety Backend

- [Safety API](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/server.js): `backend/server.js`
- [Nonce and Verification](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/crypto-utils.js): `backend/crypto-utils.js`
- [Nonce State](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/crypto-utils.js): `backend/crypto-utils.js`
- [Incident State](https://github.com/tinashe2023/eastern-sojourner/blob/master/backend/server.js): `backend/server.js`

### Other components

- **Traveler**
- **Device Services**
- **Traveler**

## Connections

- Traveler → Tourism Home: browses
- Traveler → State Destinations: explores
- State Destinations → State Content: uses
- Tourism Home → Site Interactions: uses
- Traveler → Safety Hub: opens
- Safety Hub → QR Connect: continues
- QR Connect → Safety API: requests challenge
- Safety API → Nonce and Verification: generates nonce
- Nonce and Verification → Nonce State: stores nonce
- Safety API → QR Connect: returns QR data
- Traveler → Auth App: uses
- Auth App → Biometric Gate: navigates
- Biometric Gate → QR Scanner: unlocks
- Device Services → Biometric Gate: authenticates
- Device Services → QR Scanner: provides camera and GPS
- QR Scanner → Key Signing: requests keys and signature
- QR Scanner → API Client: submits payload
- API Client → Safety API: POST verify or SOS
- Safety API → Nonce and Verification: checks signature and nonce
- Nonce and Verification → Nonce State: consumes and marks
- Safety API → Incident State: records SOS
- API Client → QR Scanner: returns response
- QR Scanner → Verification Result: shows outcome
- Safety Dashboard → Safety API: polls verification status
- Safety API → Nonce and Verification: reads nonce status
- Safety API → Safety Dashboard: returns status and incidents
- Safety API → Incident State: reads recent incidents
- Traveler → API Client: reports SOS
