# johnathanmcphilbin/expedition architecture

> Architecture diagram of the GitHub repository johnathanmcphilbin/expedition, 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/johnathanmcphilbin/expedition
- Repository: https://github.com/johnathanmcphilbin/expedition

## Overview

Expedition is a participant program portal for logging project hours, submitting work for review, earning rewards, and pursuing travel support, with an operator-facing review and administration area. The visible review workflow loads queued work and supporting project/fraud details, lets authorized reviewers decide, and records the decision through a database function. The tree also shows distinct checkpoint, claims, Ireland travel, referrals, and fulfilment capabilities. Source excerpts directly support only a subset of route-to-service relationships, so other branches are represented without speculative edges.

Main entry points: [`src/routes/admin/reviews/+page.server.ts`](https://github.com/johnathanmcphilbin/expedition/blob/main/src/routes/admin/reviews/%2Bpage.server.ts) (Submission review), [`src/lib/server/db.ts`](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/db.ts) (PostgREST client), [`src/lib/server/review-stats.ts`](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review-stats.ts) (Review statistics), [`src/lib/server/review.ts`](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review.ts) (Review decisions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Participant experience"]
  node_participant_routes["Participant pages"]
  node_program_data["Program content<br/>[data.ts]"]
end

subgraph group_review["Review operations"]
  node_admin_routes["Admin pages"]
  node_review_workflow["Submission review<br/>[+page.server.ts]"]
  node_review_decision["Review decisions<br/>[review.ts]"]
  node_review_metrics["Review statistics<br/>[review-stats.ts]"]
  node_review_queue["Queue operations<br/>[queue.ts]"]
end

subgraph group_domain["Program services"]
  node_checkpoints["Checkpoint tracking<br/>[checkpoints.ts]"]
  node_claims_grants["Claims and grants<br/>[claims.ts]"]
  node_travel["Travel planning<br/>[travel-claims.ts]"]
  node_referrals["Referral attribution<br/>[referrals.ts]"]
  node_fulfilment["Rewards fulfilment<br/>[payouts.ts]"]
end

subgraph group_platform["Data platform"]
  node_identity["Sessions and access<br/>[session.ts]"]
  node_authorization["Role guards<br/>[guards.ts]"]
  node_db_client["PostgREST client<br/>[db.ts]"]
  node_schema_types["Database types<br/>[database.types.ts]"]
end

node_participant(("Participant"))
node_reviewer(("Reviewer"))
node_postgres[("PostgreSQL via PostgREST")]
node_hackclub["Hack Club"]
node_hackatime["Hackatime"]
node_airtable["Airtable"]

node_participant -.->|"uses"| node_participant_routes
node_reviewer -.->|"reviews submissions"| node_review_workflow
node_review_workflow -->|"loads queue details"| node_review_queue
node_review_workflow -.->|"records decision"| node_review_decision
node_review_workflow -->|"fetches project times"| node_hackatime
node_review_workflow -->|"syncs submissions"| node_airtable
node_review_workflow -->|"loads submission data"| node_hackclub
node_review_workflow -.->|"uses reviewer metrics"| node_review_metrics
node_review_decision -->|"calls RPC"| node_db_client
node_review_metrics -->|"queries review data"| node_db_client
node_review_metrics -->|"uses reviewer names"| node_authorization
node_identity -->|"reads and writes sessions"| node_db_client
node_db_client -->|"queries PostgREST"| node_postgres
node_db_client -->|"types queries"| node_schema_types
node_review_workflow -.->|"checks reviewer access"| node_authorization

click node_participant_routes "https://github.com/johnathanmcphilbin/expedition/tree/main/src/routes"
click node_admin_routes "https://github.com/johnathanmcphilbin/expedition/tree/main/src/routes/admin"
click node_review_workflow "https://github.com/johnathanmcphilbin/expedition/blob/main/src/routes/admin/reviews/%2Bpage.server.ts"
click node_review_decision "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review.ts"
click node_review_metrics "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review-stats.ts"
click node_review_queue "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/queue.ts"
click node_identity "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/session.ts"
click node_authorization "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/guards.ts"
click node_program_data "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/data.ts"
click node_checkpoints "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/checkpoints.ts"
click node_claims_grants "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/claims.ts"
click node_travel "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/travel-claims.ts"
click node_referrals "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/referrals.ts"
click node_fulfilment "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/payouts.ts"
click node_db_client "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/db.ts"
click node_schema_types "https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/database.types.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_participant_routes,node_program_data,node_reviewer toneBlue
class node_admin_routes,node_review_workflow,node_review_decision,node_review_metrics,node_review_queue,node_postgres toneAmber
class node_checkpoints,node_claims_grants,node_travel,node_referrals,node_fulfilment toneMint
class node_identity,node_authorization,node_db_client,node_schema_types toneRose
class node_participant,node_hackclub,node_hackatime,node_airtable toneIndigo
```

## Components

### Participant experience

- [Participant pages](https://github.com/johnathanmcphilbin/expedition/tree/main/src/routes): `src/routes`
- [Program content](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/data.ts): `src/lib/data.ts`

### Review operations

- [Admin pages](https://github.com/johnathanmcphilbin/expedition/tree/main/src/routes/admin): `src/routes/admin`
- [Submission review](https://github.com/johnathanmcphilbin/expedition/blob/main/src/routes/admin/reviews/%2Bpage.server.ts): `src/routes/admin/reviews/+page.server.ts`
- [Review decisions](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review.ts): `src/lib/server/review.ts`
- [Review statistics](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/review-stats.ts): `src/lib/server/review-stats.ts`
- [Queue operations](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/queue.ts): `src/lib/server/queue.ts`

### Program services

- [Checkpoint tracking](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/checkpoints.ts): `src/lib/server/checkpoints.ts`
- [Claims and grants](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/claims.ts): `src/lib/server/claims.ts`
- [Travel planning](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/travel-claims.ts): `src/lib/server/travel-claims.ts`
- [Referral attribution](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/referrals.ts): `src/lib/server/referrals.ts`
- [Rewards fulfilment](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/payouts.ts): `src/lib/server/payouts.ts`

### Data platform

- [Sessions and access](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/session.ts): `src/lib/server/session.ts`
- [Role guards](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/guards.ts): `src/lib/server/guards.ts`
- [PostgREST client](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/db.ts): `src/lib/server/db.ts`
- [Database types](https://github.com/johnathanmcphilbin/expedition/blob/main/src/lib/server/database.types.ts): `src/lib/server/database.types.ts`

### Other components

- **Participant**
- **Reviewer**
- **PostgreSQL via PostgREST**
- **Hack Club**
- **Hackatime**
- **Airtable**

## Connections

- Participant → Participant pages: uses
- Reviewer → Submission review: reviews submissions
- Submission review → Queue operations: loads queue details (evidence: `src/routes/admin/reviews/+page.server.ts`)
- Submission review → Review decisions: records decision
- Submission review → Hackatime: fetches project times (evidence: `src/routes/admin/reviews/+page.server.ts`)
- Submission review → Airtable: syncs submissions (evidence: `src/routes/admin/reviews/+page.server.ts`)
- Submission review → Hack Club: loads submission data (evidence: `src/routes/admin/reviews/+page.server.ts`)
- Submission review → Review statistics: uses reviewer metrics
- Review decisions → PostgREST client: calls RPC (evidence: `src/lib/server/review.ts`)
- Review statistics → PostgREST client: queries review data (evidence: `src/lib/server/review-stats.ts`)
- Review statistics → Role guards: uses reviewer names (evidence: `src/lib/server/review-stats.ts`)
- Sessions and access → PostgREST client: reads and writes sessions (evidence: `src/lib/server/session.ts`)
- PostgREST client → PostgreSQL via PostgREST: queries PostgREST (evidence: `src/lib/server/db.ts`)
- PostgREST client → Database types: types queries (evidence: `src/lib/server/db.ts`)
- Submission review → Role guards: checks reviewer access
