# gininipushes/which-way architecture

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

- Interactive diagram: https://gitdiagram.com/gininipushes/which-way
- Repository: https://github.com/gininipushes/which-way

## Overview

Which Way? is an offline Android compass for finding nearby shops and places of worship around MIT Manipal. The main workflow loads bundled place data, combines it with user pins, measures places from the device’s location, and displays the selected nearest place against the phone’s heading. Users can browse and lock a place from LIST or add and remove pins. FRIENDS manages contacts and sync settings; an optional foreground BLE service exchanges pin snapshots with mutual friends. Source excerpts establish the main UI, storage and sync interactions; some wiring and sensor handling are described only in the README.

Main entry points: [`src/com/pratyush/disha/MainActivity.java`](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/MainActivity.java) (App coordinator), [`src/com/pratyush/disha/CompassView.java`](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/CompassView.java) (Compass and tabs), [`src/com/pratyush/disha/SyncService.java`](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/SyncService.java) (BLE sync service), [`src/com/pratyush/disha/Place.java`](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/Place.java) (Place calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App workflow"]
  node_activity["App coordinator<br/>[MainActivity.java]"]
end

subgraph group_places["Places and compass"]
  node_view["Compass and tabs<br/>[CompassView.java]"]
  node_place["Place calculations<br/>[Place.java]"]
  node_bundled["Bundled places<br/>[places.csv]"]
end

subgraph group_sharing["Pins and sync"]
  node_store[("Pins and friends<br/>[PinStore.java]")]
  node_sync["BLE sync service<br/>[SyncService.java]"]
end

node_user(("Phone user"))
node_device["Location and sensors"]
node_peer(("Nearby friend phone"))

node_user -->|"uses"| node_activity
node_activity -->|"loads places"| node_bundled
node_activity -->|"updates view"| node_view
node_device -->|"provides readings"| node_activity
node_activity -->|"sets location"| node_view
node_activity -->|"reads and edits"| node_store
node_activity -->|"creates places"| node_place
node_view -->|"measures places"| node_place
node_view -->|"dispatches actions"| node_activity
node_activity -->|"starts service"| node_sync
node_sync -->|"checks and merges pins"| node_store
node_sync -->|"exchanges snapshots"| node_peer

click node_activity "https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/MainActivity.java"
click node_view "https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/CompassView.java"
click node_place "https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/Place.java"
click node_bundled "https://github.com/gininipushes/which-way/blob/main/assets/places.csv"
click node_store "https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/PinStore.java"
click node_sync "https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/SyncService.java"

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_activity,node_user toneBlue
class node_view,node_place,node_bundled toneAmber
class node_store,node_sync toneMint
class node_device,node_peer toneIndigo
```

## Components

### App workflow

- [App coordinator](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/MainActivity.java): `src/com/pratyush/disha/MainActivity.java`

### Places and compass

- [Compass and tabs](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/CompassView.java): `src/com/pratyush/disha/CompassView.java`
- [Place calculations](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/Place.java): `src/com/pratyush/disha/Place.java`
- [Bundled places](https://github.com/gininipushes/which-way/blob/main/assets/places.csv): `assets/places.csv`

### Pins and sync

- [Pins and friends](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/PinStore.java): `src/com/pratyush/disha/PinStore.java`
- [BLE sync service](https://github.com/gininipushes/which-way/blob/main/src/com/pratyush/disha/SyncService.java): `src/com/pratyush/disha/SyncService.java`

### Other components

- **Phone user**
- **Location and sensors**
- **Nearby friend phone**

## Connections

- Phone user → App coordinator: uses (evidence: `README.md`)
- App coordinator → Bundled places: loads places (evidence: `README.md`)
- App coordinator → Compass and tabs: updates view (evidence: `src/com/pratyush/disha/MainActivity.java`)
- Location and sensors → App coordinator: provides readings (evidence: `README.md`)
- App coordinator → Compass and tabs: sets location (evidence: `src/com/pratyush/disha/MainActivity.java`)
- App coordinator → Pins and friends: reads and edits (evidence: `src/com/pratyush/disha/MainActivity.java`)
- App coordinator → Place calculations: creates places (evidence: `src/com/pratyush/disha/MainActivity.java`)
- Compass and tabs → Place calculations: measures places (evidence: `src/com/pratyush/disha/CompassView.java`)
- Compass and tabs → App coordinator: dispatches actions (evidence: `src/com/pratyush/disha/CompassView.java`)
- App coordinator → BLE sync service: starts service (evidence: `src/com/pratyush/disha/MainActivity.java`)
- BLE sync service → Pins and friends: checks and merges pins (evidence: `src/com/pratyush/disha/SyncService.java`)
- BLE sync service → Nearby friend phone: exchanges snapshots (evidence: `README.md`)
