# alogicsays/bluejury architecture

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

- Interactive diagram: https://gitdiagram.com/alogicsays/bluejury
- Repository: https://github.com/alogicsays/bluejury

## Overview

BLUEJURY is a web and Android marine decision-support product. Fishers explore or select a zone, submit trip inputs for assessment, and review an explainable recommendation and route; live alternatives use GPS and remaining fuel, while saved trips and accounts remain on-device. The backend’s sampled analysis service loads marine evidence, invokes juror assessments, and negotiates a result. README capabilities are included, but several frontend and API connections are inferred from product documentation rather than sampled implementation; uncertain wiring is omitted.

Main entry points: [`services/api/src/bluejury/services/mvp.py`](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/services/mvp.py) (Analysis and negotiation), [`apps/web/app/layout.tsx`](https://github.com/alogicsays/bluejury/blob/main/apps/web/app/layout.tsx) (Web application), [`services/api/src/bluejury/api/routes.py`](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/api/routes.py) (HTTP API), [`apps/web/components/live-trip.tsx`](https://github.com/alogicsays/bluejury/blob/main/apps/web/components/live-trip.tsx) (Live trip)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Fisher experience"]
  node_web["Web application<br/>[layout.tsx]"]
  node_planning["Route planning<br/>[plan-workspace.tsx]"]
  node_map["Zone assessment<br/>[map-workspace.tsx]"]
  node_live["Live trip<br/>[live-trip.tsx]"]
  node_android["Android wrapper<br/>[MainActivity.java]"]
end

subgraph group_decision["Decision engine"]
  node_api["HTTP API<br/>[routes.py]"]
  node_analysis["Analysis and negotiation<br/>[mvp.py]"]
  node_catch["Catch juror<br/>[catch.py]"]
  node_safety["Safety juror<br/>[safety.py]"]
  node_fuel["Fuel juror<br/>[fuel.py]"]
  node_ecology["Ecology juror<br/>[ecology.py]"]
  node_border["Border juror<br/>[border.py]"]
  node_cases["Case service<br/>[cases.py]"]
  node_repository["Case repository<br/>[cases.py]"]
  node_db[("Case database<br/>[db.py]")]
end

subgraph group_data["Marine evidence"]
  node_marine["Marine data providers"]
  node_marine_adapter["Marine regions adapter<br/>[marine_regions.py]"]
  node_protected_adapter["Protected-area adapters"]
  node_local_protected["Local protected areas"]
  node_wii["Biodiversity context"]
end

subgraph group_state["Local state"]
  node_auth["Local accounts<br/>[local-auth.ts]"]
  node_trips["Offline trips"]
  node_browser_store[("Device storage")]
end

node_fisher(("Fisher"))
node_gps["Device GPS"]

node_fisher -->|"uses"| node_web
node_web -->|"offers planning"| node_planning
node_web -->|"offers assessment"| node_map
node_web -->|"offers trip checks"| node_live
node_android -->|"hosts app"| node_web
node_planning -->|"requests analysis"| node_api
node_map -->|"requests assessment"| node_api
node_live -->|"reads position"| node_gps
node_live -->|"checks alternatives"| node_api
node_api -->|"invokes analysis"| node_analysis
node_analysis -->|"evaluates catch"| node_catch
node_analysis -->|"evaluates safety"| node_safety
node_analysis -->|"evaluates fuel"| node_fuel
node_analysis -->|"evaluates ecology"| node_ecology
node_analysis -->|"evaluates borders"| node_border
node_analysis -->|"loads boundaries"| node_marine_adapter
node_marine_adapter -->|"reads reference data"| node_marine
node_analysis -->|"loads fallback data"| node_protected_adapter
node_analysis -->|"loads local data"| node_local_protected
node_analysis -->|"loads context"| node_wii
node_protected_adapter -.->|"requests provider data"| node_marine
node_api -->|"handles case routes"| node_cases
node_cases -->|"persists cases"| node_repository
node_repository -->|"reads and writes"| node_db
node_fisher -->|"signs in locally"| node_auth
node_auth -->|"stores account and session"| node_browser_store
node_fisher -->|"saves trips"| node_trips
node_trips -->|"stores trip data"| node_browser_store

click node_web "https://github.com/alogicsays/bluejury/blob/main/apps/web/app/layout.tsx"
click node_planning "https://github.com/alogicsays/bluejury/blob/main/apps/web/components/plan-workspace.tsx"
click node_map "https://github.com/alogicsays/bluejury/blob/main/apps/web/components/map-workspace.tsx"
click node_live "https://github.com/alogicsays/bluejury/blob/main/apps/web/components/live-trip.tsx"
click node_android "https://github.com/alogicsays/bluejury/blob/main/apps/web/android/app/src/main/java/com/bluejury/app/MainActivity.java"
click node_api "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/api/routes.py"
click node_analysis "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/services/mvp.py"
click node_catch "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/catch.py"
click node_safety "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/safety.py"
click node_fuel "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/fuel.py"
click node_ecology "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/ecology.py"
click node_border "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/border.py"
click node_marine_adapter "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/marine_regions.py"
click node_protected_adapter "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/protected_planet.py"
click node_local_protected "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/protected_planet_local.py"
click node_wii "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/wii_biodiversity_context.py"
click node_cases "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/services/cases.py"
click node_repository "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/repositories/cases.py"
click node_db "https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/db.py"
click node_auth "https://github.com/alogicsays/bluejury/blob/main/apps/web/lib/local-auth.ts"
click node_trips "https://github.com/alogicsays/bluejury/blob/main/apps/web/lib/offline-trip-store.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_web,node_planning,node_map,node_live,node_android toneBlue
class node_api,node_analysis,node_catch,node_safety,node_fuel,node_ecology,node_border,node_cases,node_repository,node_db toneAmber
class node_marine,node_marine_adapter,node_protected_adapter,node_local_protected,node_wii toneMint
class node_auth,node_trips,node_browser_store toneRose
class node_fisher,node_gps toneIndigo
```

## Components

### Fisher experience

- [Web application](https://github.com/alogicsays/bluejury/blob/main/apps/web/app/layout.tsx): `apps/web/app/layout.tsx`
- [Route planning](https://github.com/alogicsays/bluejury/blob/main/apps/web/components/plan-workspace.tsx): `apps/web/components/plan-workspace.tsx`
- [Zone assessment](https://github.com/alogicsays/bluejury/blob/main/apps/web/components/map-workspace.tsx): `apps/web/components/map-workspace.tsx`
- [Live trip](https://github.com/alogicsays/bluejury/blob/main/apps/web/components/live-trip.tsx): `apps/web/components/live-trip.tsx`
- [Android wrapper](https://github.com/alogicsays/bluejury/blob/main/apps/web/android/app/src/main/java/com/bluejury/app/MainActivity.java): `apps/web/android/app/src/main/java/com/bluejury/app/MainActivity.java`

### Decision engine

- [HTTP API](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/api/routes.py): `services/api/src/bluejury/api/routes.py`
- [Analysis and negotiation](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/services/mvp.py): `services/api/src/bluejury/services/mvp.py`
- [Catch juror](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/catch.py): `services/api/src/bluejury/jurors/catch.py`
- [Safety juror](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/safety.py): `services/api/src/bluejury/jurors/safety.py`
- [Fuel juror](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/fuel.py): `services/api/src/bluejury/jurors/fuel.py`
- [Ecology juror](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/ecology.py): `services/api/src/bluejury/jurors/ecology.py`
- [Border juror](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/jurors/border.py): `services/api/src/bluejury/jurors/border.py`
- [Case service](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/services/cases.py): `services/api/src/bluejury/services/cases.py`
- [Case repository](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/repositories/cases.py): `services/api/src/bluejury/repositories/cases.py`
- [Case database](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/db.py): `services/api/src/bluejury/db.py`

### Marine evidence

- **Marine data providers**
- [Marine regions adapter](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/marine_regions.py): `services/api/src/bluejury/adapters/marine_regions.py`
- [Protected-area adapters](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/protected_planet.py): `services/api/src/bluejury/adapters/protected_planet.py`
- [Local protected areas](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/protected_planet_local.py): `services/api/src/bluejury/adapters/protected_planet_local.py`
- [Biodiversity context](https://github.com/alogicsays/bluejury/blob/main/services/api/src/bluejury/adapters/wii_biodiversity_context.py): `services/api/src/bluejury/adapters/wii_biodiversity_context.py`

### Local state

- [Local accounts](https://github.com/alogicsays/bluejury/blob/main/apps/web/lib/local-auth.ts): `apps/web/lib/local-auth.ts`
- [Offline trips](https://github.com/alogicsays/bluejury/blob/main/apps/web/lib/offline-trip-store.ts): `apps/web/lib/offline-trip-store.ts`
- **Device storage**

### Other components

- **Fisher**
- **Device GPS**

## Connections

- Fisher → Web application: uses
- Web application → Route planning: offers planning
- Web application → Zone assessment: offers assessment
- Web application → Live trip: offers trip checks
- Android wrapper → Web application: hosts app
- Route planning → HTTP API: requests analysis
- Zone assessment → HTTP API: requests assessment
- Live trip → Device GPS: reads position
- Live trip → HTTP API: checks alternatives
- HTTP API → Analysis and negotiation: invokes analysis
- Analysis and negotiation → Catch juror: evaluates catch
- Analysis and negotiation → Safety juror: evaluates safety
- Analysis and negotiation → Fuel juror: evaluates fuel
- Analysis and negotiation → Ecology juror: evaluates ecology
- Analysis and negotiation → Border juror: evaluates borders
- Analysis and negotiation → Marine regions adapter: loads boundaries
- Marine regions adapter → Marine data providers: reads reference data
- Analysis and negotiation → Protected-area adapters: loads fallback data
- Analysis and negotiation → Local protected areas: loads local data
- Analysis and negotiation → Biodiversity context: loads context
- Protected-area adapters → Marine data providers: requests provider data
- HTTP API → Case service: handles case routes
- Case service → Case repository: persists cases
- Case repository → Case database: reads and writes
- Fisher → Local accounts: signs in locally
- Local accounts → Device storage: stores account and session
- Fisher → Offline trips: saves trips
- Offline trips → Device storage: stores trip data
