# aurorabackcountry/infoex-api architecture

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

- Interactive diagram: https://gitdiagram.com/aurorabackcountry/infoex-api
- Repository: https://github.com/aurorabackcountry/infoex-api

## Overview

Aurora is an offline-capable avalanche field-reporting product with a mobile guide app, an operator console, and a Supabase-backed processing engine. Its core workflow is guide capture, offline queuing and sync, structured extraction, human review, then approval-gated InfoEx submission. Other documented capabilities include briefings and evidence-grounded Q&A, daily reports, weather and map views, and operational management. The README supports the main workflow and capabilities; sampled files show selected console API behavior, while several backend subsystems are represented only by their documented shared-code directories.

Main entry points: [`supabase/functions/_shared`](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared) (Edge function engine), [`apps/admin/app/(console)/dashboard/page.tsx`](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/(console)/dashboard/page.tsx) (Operator console), [`apps/admin/app/api/stations/route.ts`](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/stations/route.ts) (Station management API), [`apps/app/src/app/(tabs)/reports.tsx`](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/app/(tabs)/reports.tsx) (Review and approval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_field["Field app"]
  node_mobile["Guide app<br/>[index.tsx]"]
  node_capture["Field capture<br/>[draft-store.ts]"]
  node_outbox[("Offline outbox<br/>[outbox.ts]")]
  node_sync["Sync service<br/>[sync-service.ts]"]
  node_review["Review and approval<br/>[reports.tsx]"]
end

subgraph group_engine["Reporting engine"]
  node_edge["Edge function engine"]
  node_extract["Structured extraction<br/>[claude.ts]"]
  node_submission["InfoEx submission<br/>[infoex.ts]"]
end

subgraph group_insight["Briefings and insights"]
  node_briefing["Briefing assembly"]
  node_ask["Grounded Q&amp;A"]
  node_daily["Daily reports"]
end

subgraph group_console["Operator console"]
  node_admin["Operator console<br/>[page.tsx]"]
  node_mapapi["Field map API<br/>[route.ts]"]
  node_trends["Zone trends API<br/>[route.ts]"]
  node_notes["Operation notes API<br/>[route.ts]"]
  node_stations["Station management API<br/>[route.ts]"]
end

subgraph group_data["Data and integrations"]
  node_database[("Aurora database")]
  node_infoex["InfoEx"]
  node_feeds["External data feeds"]
  node_drive["Drive export<br/>[export.ts]"]
end

node_guide(("Field guide"))
node_operator(("Operation staff"))

node_guide -->|"records observations"| node_capture
node_capture -->|"saves drafts"| node_outbox
node_outbox -->|"queues uploads"| node_sync
node_sync -->|"syncs capture"| node_edge
node_edge -->|"runs extraction"| node_extract
node_extract -->|"stores validated data"| node_database
node_database -->|"provides review data"| node_review
node_guide -->|"reviews and approves"| node_review
node_review -->|"submits approved data"| node_edge
node_edge -->|"dispatches submission"| node_submission
node_submission -->|"posts observations"| node_infoex
node_infoex -.->|"supplies operator reports"| node_feeds
node_feeds -->|"ingests feed data"| node_database
node_edge -->|"assembles briefings"| node_briefing
node_briefing -->|"reads operation data"| node_database
node_edge -->|"serves questions"| node_ask
node_ask -->|"retrieves cited records"| node_database
node_edge -->|"builds daily reports"| node_daily
node_daily -->|"reads and stores reports"| node_database
node_operator -->|"manages operation"| node_admin
node_admin -->|"requests map data"| node_mapapi
node_mapapi -->|"reads field records"| node_database
node_admin -->|"requests trends"| node_trends
node_trends -->|"queries zone trends"| node_database
node_admin -->|"manages notes"| node_notes
node_notes -->|"reads and writes notes"| node_database
node_admin -->|"manages stations"| node_stations
node_stations -->|"stores station data"| node_database
node_stations -->|"requests station history"| node_feeds
node_edge -.->|"exports reports"| node_drive
node_drive -.->|"uses connected Drive"| node_infoex

click node_mobile "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/app/(tabs)/index.tsx"
click node_capture "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/features/capture/draft-store.ts"
click node_outbox "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/lib/outbox.ts"
click node_sync "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/lib/sync-service.ts"
click node_review "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/app/(tabs)/reports.tsx"
click node_edge "https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared"
click node_extract "https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/claude.ts"
click node_submission "https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/infoex.ts"
click node_feeds "https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/feeds"
click node_briefing "https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/briefing"
click node_ask "https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/ask"
click node_daily "https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/daily_report"
click node_admin "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/(console)/dashboard/page.tsx"
click node_mapapi "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/map/route.ts"
click node_trends "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/trends/route.ts"
click node_notes "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/notes/route.ts"
click node_stations "https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/stations/route.ts"
click node_drive "https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/drive/export.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_mobile,node_capture,node_outbox,node_sync,node_review toneBlue
class node_edge,node_extract,node_submission toneAmber
class node_briefing,node_ask,node_daily toneMint
class node_admin,node_mapapi,node_trends,node_notes,node_stations toneRose
class node_database,node_infoex,node_feeds,node_drive,node_guide,node_operator toneIndigo
```

## Components

### Field app

- [Guide app](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/app/(tabs)/index.tsx): `apps/app/src/app/(tabs)/index.tsx`
- [Field capture](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/features/capture/draft-store.ts): `apps/app/src/features/capture/draft-store.ts`
- [Offline outbox](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/lib/outbox.ts): `apps/app/src/lib/outbox.ts`
- [Sync service](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/lib/sync-service.ts): `apps/app/src/lib/sync-service.ts`
- [Review and approval](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/app/src/app/(tabs)/reports.tsx): `apps/app/src/app/(tabs)/reports.tsx`

### Reporting engine

- [Edge function engine](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared): `supabase/functions/_shared`
- [Structured extraction](https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/claude.ts): `supabase/functions/_shared/claude.ts`
- [InfoEx submission](https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/infoex.ts): `supabase/functions/_shared/infoex.ts`

### Briefings and insights

- [Briefing assembly](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/briefing): `supabase/functions/_shared/briefing`
- [Grounded Q&A](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/ask): `supabase/functions/_shared/ask`
- [Daily reports](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/daily_report): `supabase/functions/_shared/daily_report`

### Operator console

- [Operator console](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/(console)/dashboard/page.tsx): `apps/admin/app/(console)/dashboard/page.tsx`
- [Field map API](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/map/route.ts): `apps/admin/app/api/map/route.ts`
- [Zone trends API](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/trends/route.ts): `apps/admin/app/api/trends/route.ts`
- [Operation notes API](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/notes/route.ts): `apps/admin/app/api/notes/route.ts`
- [Station management API](https://github.com/aurorabackcountry/infoex-api/blob/main/apps/admin/app/api/stations/route.ts): `apps/admin/app/api/stations/route.ts`

### Data and integrations

- **Aurora database**
- **InfoEx**
- [External data feeds](https://github.com/aurorabackcountry/infoex-api/tree/main/supabase/functions/_shared/feeds): `supabase/functions/_shared/feeds`
- [Drive export](https://github.com/aurorabackcountry/infoex-api/blob/main/supabase/functions/_shared/drive/export.ts): `supabase/functions/_shared/drive/export.ts`

### Other components

- **Field guide**
- **Operation staff**

## Connections

- Field guide → Field capture: records observations
- Field capture → Offline outbox: saves drafts
- Offline outbox → Sync service: queues uploads
- Sync service → Edge function engine: syncs capture
- Edge function engine → Structured extraction: runs extraction
- Structured extraction → Aurora database: stores validated data
- Aurora database → Review and approval: provides review data
- Field guide → Review and approval: reviews and approves
- Review and approval → Edge function engine: submits approved data
- Edge function engine → InfoEx submission: dispatches submission
- InfoEx submission → InfoEx: posts observations
- InfoEx → External data feeds: supplies operator reports
- External data feeds → Aurora database: ingests feed data
- Edge function engine → Briefing assembly: assembles briefings
- Briefing assembly → Aurora database: reads operation data
- Edge function engine → Grounded Q&A: serves questions
- Grounded Q&A → Aurora database: retrieves cited records
- Edge function engine → Daily reports: builds daily reports
- Daily reports → Aurora database: reads and stores reports
- Operation staff → Operator console: manages operation
- Operator console → Field map API: requests map data
- Field map API → Aurora database: reads field records
- Operator console → Zone trends API: requests trends
- Zone trends API → Aurora database: queries zone trends
- Operator console → Operation notes API: manages notes
- Operation notes API → Aurora database: reads and writes notes
- Operator console → Station management API: manages stations
- Station management API → Aurora database: stores station data
- Station management API → External data feeds: requests station history
- Edge function engine → Drive export: exports reports
- Drive export → InfoEx: uses connected Drive
