# stuy-arista/arista-web architecture

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

- Interactive diagram: https://gitdiagram.com/stuy-arista/arista-web
- Repository: https://github.com/stuy-arista/arista-web
- Video tour (about a minute): https://gitdiagram.com/stuy-arista/arista-web/video

## Overview

ARISTA is a SvelteKit website where members register, browse and join events, check in to meetings, request or provide tutoring, and track credits; administrators manage attendance, credits, permissions, and member records. PocketBase is the central store for users, events, credits, and meetings. A separate sharing branch fetches public preview data and renders social cards. The sampled files show key registration, dashboard, tutoring, crediting, and preview relationships; other route details are represented from the README and file tree, so their internal connections are left out.

Main entry points: [`src/routes/(protected)/tutoring/+page.server.ts`](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/tutoring/%2Bpage.server.ts) (Tutoring sessions), [`src/lib/server/eventPreview.ts`](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/eventPreview.ts) (Event preview data), [`src/routes/(protected)/admin/crediting/+page.server.ts`](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/crediting/%2Bpage.server.ts) (Credit administration), [`src/lib/server/linkPreviews.ts`](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/linkPreviews.ts) (Preview metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_member["Member services"]
  node_register["Registration<br/>[+page.server.ts]"]
  node_dashboard["Credit dashboard<br/>[+page.server.ts]"]
  node_events["Event signup<br/>[+page.server.ts]"]
  node_attendance["Meeting check-in<br/>[+page.server.ts]"]
  node_tutoring["Tutoring sessions<br/>[+page.server.ts]"]
end

subgraph group_admin["Administration"]
  node_admin_home["Admin overview<br/>[+page.server.ts]"]
  node_admin_attendance["Attendance management<br/>[+page.server.ts]"]
  node_admin_credit["Credit administration<br/>[+page.server.ts]"]
end

subgraph group_backend["Data and integrations"]
  node_credit_planner["Credit planner<br/>[planCredit.ts]"]
  node_credit_math["Credit calculation"]
  node_pocketbase[("PocketBase")]
  node_slack["Slack tutoring alerts"]
end

subgraph group_sharing["Link previews"]
  node_preview_routes["Preview metadata<br/>[linkPreviews.ts]"]
  node_event_preview["Event preview data<br/>[eventPreview.ts]"]
  node_preview_utils["Preview utilities<br/>[previewUtils.ts]"]
  node_og_routes["Social card endpoints"]
  node_event_card["Event card renderer<br/>[event.ts]"]
  node_page_cards["Page card renderer<br/>[pages.ts]"]
  node_card_kit["Card primitives<br/>[kit.ts]"]
end

node_visitor(("Member or visitor"))

node_visitor -.->|"creates account"| node_register
node_register -->|"creates and authenticates"| node_pocketbase
node_visitor -.->|"views credits"| node_dashboard
node_dashboard -->|"reads member data"| node_pocketbase
node_visitor -.->|"signs up"| node_events
node_visitor -.->|"checks in"| node_attendance
node_visitor -.->|"requests tutoring"| node_tutoring
node_tutoring -->|"reads and updates"| node_pocketbase
node_tutoring -->|"updates alerts"| node_slack
node_admin_home -->|"manages records"| node_pocketbase
node_admin_credit -->|"creates planned credits"| node_credit_planner
node_admin_credit -->|"looks up members"| node_pocketbase
node_event_preview -->|"calculates event credits"| node_credit_math
node_preview_routes -->|"fetches event metadata"| node_event_preview
node_preview_routes -->|"uses preview helpers"| node_preview_utils
node_event_preview -->|"fetches and formats data"| node_preview_utils
node_og_routes -.->|"renders event cards"| node_event_card
node_og_routes -.->|"renders page cards"| node_page_cards
node_event_card -->|"uses primitives"| node_card_kit
node_page_cards -->|"uses primitives"| node_card_kit

click node_register "https://github.com/stuy-arista/arista-web/blob/main/src/routes/register/%2Bpage.server.ts"
click node_dashboard "https://github.com/stuy-arista/arista-web/blob/main/src/routes/%2Bpage.server.ts"
click node_events "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/events/view/%5Bid%5D/%2Bpage.server.ts"
click node_attendance "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/attendance/%5Bcode%5D/%2Bpage.server.ts"
click node_tutoring "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/tutoring/%2Bpage.server.ts"
click node_admin_home "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/%2Bpage.server.ts"
click node_admin_attendance "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/attendance/%2Bpage.server.ts"
click node_admin_credit "https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/crediting/%2Bpage.server.ts"
click node_credit_planner "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/planCredit.ts"
click node_credit_math "https://github.com/stuy-arista/arista-web/blob/main/src/lib/calculateCredits.ts"
click node_preview_routes "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/linkPreviews.ts"
click node_event_preview "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/eventPreview.ts"
click node_preview_utils "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/previewUtils.ts"
click node_og_routes "https://github.com/stuy-arista/arista-web/tree/main/src/routes/og"
click node_event_card "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/event.ts"
click node_page_cards "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/pages.ts"
click node_card_kit "https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/kit.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_register,node_dashboard,node_events,node_attendance,node_tutoring toneBlue
class node_admin_home,node_admin_attendance,node_admin_credit toneAmber
class node_credit_planner,node_credit_math,node_pocketbase,node_slack toneMint
class node_preview_routes,node_event_preview,node_preview_utils,node_og_routes,node_event_card,node_page_cards,node_card_kit toneRose
class node_visitor toneIndigo
```

## Components

### Member services

- [Registration](https://github.com/stuy-arista/arista-web/blob/main/src/routes/register/%2Bpage.server.ts): `src/routes/register/+page.server.ts`
- [Credit dashboard](https://github.com/stuy-arista/arista-web/blob/main/src/routes/%2Bpage.server.ts): `src/routes/+page.server.ts`
- [Event signup](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/events/view/%5Bid%5D/%2Bpage.server.ts): `src/routes/(protected)/events/view/[id]/+page.server.ts`
- [Meeting check-in](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/attendance/%5Bcode%5D/%2Bpage.server.ts): `src/routes/(protected)/attendance/[code]/+page.server.ts`
- [Tutoring sessions](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/tutoring/%2Bpage.server.ts): `src/routes/(protected)/tutoring/+page.server.ts`

### Administration

- [Admin overview](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/%2Bpage.server.ts): `src/routes/(protected)/admin/+page.server.ts`
- [Attendance management](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/attendance/%2Bpage.server.ts): `src/routes/(protected)/admin/attendance/+page.server.ts`
- [Credit administration](https://github.com/stuy-arista/arista-web/blob/main/src/routes/(protected)/admin/crediting/%2Bpage.server.ts): `src/routes/(protected)/admin/crediting/+page.server.ts`

### Data and integrations

- [Credit planner](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/planCredit.ts): `src/lib/server/planCredit.ts`
- [Credit calculation](https://github.com/stuy-arista/arista-web/blob/main/src/lib/calculateCredits.ts): `src/lib/calculateCredits.ts`
- **PocketBase**
- **Slack tutoring alerts**

### Link previews

- [Preview metadata](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/linkPreviews.ts): `src/lib/server/linkPreviews.ts`
- [Event preview data](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/eventPreview.ts): `src/lib/server/eventPreview.ts`
- [Preview utilities](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/previewUtils.ts): `src/lib/server/previewUtils.ts`
- [Social card endpoints](https://github.com/stuy-arista/arista-web/tree/main/src/routes/og): `src/routes/og`
- [Event card renderer](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/event.ts): `src/lib/server/cards/event.ts`
- [Page card renderer](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/pages.ts): `src/lib/server/cards/pages.ts`
- [Card primitives](https://github.com/stuy-arista/arista-web/blob/main/src/lib/server/cards/kit.ts): `src/lib/server/cards/kit.ts`

### Other components

- **Member or visitor**

## Connections

- Member or visitor → Registration: creates account
- Registration → PocketBase: creates and authenticates (evidence: `src/routes/register/+page.server.ts`)
- Member or visitor → Credit dashboard: views credits
- Credit dashboard → PocketBase: reads member data (evidence: `src/routes/+page.server.ts`)
- Member or visitor → Event signup: signs up
- Member or visitor → Meeting check-in: checks in
- Member or visitor → Tutoring sessions: requests tutoring
- Tutoring sessions → PocketBase: reads and updates (evidence: `src/routes/(protected)/tutoring/+page.server.ts`)
- Tutoring sessions → Slack tutoring alerts: updates alerts (evidence: `src/routes/(protected)/tutoring/+page.server.ts`)
- Admin overview → PocketBase: manages records (evidence: `src/routes/(protected)/admin/+page.server.ts`)
- Credit administration → Credit planner: creates planned credits (evidence: `src/routes/(protected)/admin/crediting/+page.server.ts`)
- Credit administration → PocketBase: looks up members (evidence: `src/routes/(protected)/admin/crediting/+page.server.ts`)
- Event preview data → Credit calculation: calculates event credits (evidence: `src/lib/server/eventPreview.ts`)
- Preview metadata → Event preview data: fetches event metadata (evidence: `src/lib/server/linkPreviews.ts`)
- Preview metadata → Preview utilities: uses preview helpers (evidence: `src/lib/server/linkPreviews.ts`)
- Event preview data → Preview utilities: fetches and formats data (evidence: `src/lib/server/eventPreview.ts`)
- Social card endpoints → Event card renderer: renders event cards (evidence: `README.md`)
- Social card endpoints → Page card renderer: renders page cards (evidence: `README.md`)
- Event card renderer → Card primitives: uses primitives (evidence: `src/lib/server/cards/event.ts`)
- Page card renderer → Card primitives: uses primitives (evidence: `src/lib/server/cards/pages.ts`)
