# idonov8/meet-case-studies architecture

> Architecture diagram of the GitHub repository idonov8/meet-case-studies, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/idonov8/meet-case-studies
- Repository: https://github.com/idonov8/meet-case-studies

## Overview

#### Purpose and Delivery Model
Case Study Room is a student-team workspace for creating and tracking case-study deliverables across a Sun–Wed timeline. It is an Astro static-site application with React-powered interactive UI, intended to run without a required backend and persist workspace data in browser storage. Primary project entry and build configuration are `src/pages/index.astro`, `astro.config.mjs`, and `package.json`.

#### Page and Application Entry Points
Astro routes define the top-level surfaces:
- Landing/login flow: `src/pages/index.astro`
- Main team workspace: `src/pages/app.astro`
- Administration surface: `src/pages/admin.astro`
- Contact and isolated test routes: `src/pages/contact.astro`, `src/pages/test-button.astro`

Shared document structure is supplied by `src/layouts/Layout.astro`; application-wide styling resides in `src/styles/global.css`.

#### Workspace Composition
The main interactive experience is assembled from React components centered on deliverable authoring and submission:
- Workspace orchestration: `src/components/Workspace.tsx`
- Case-study deliverable rendering: `src/components/CaseStudy.tsx`
- Submission/progress-facing panel: `src/components/SubmitPanel.tsx`
- Reusable interactive widgets: `src/components/widgets.tsx`

These components represent purpose-built tools rather than a single generic form, supporting structured inputs such as planning, matrices, trees, checklists, and visual selections.

#### Deliverable Data and Progress Flow
Deliverable definitions, grouping, and completion-related logic are separated from UI:
- Core data model/content: `src/lib/data.ts`
- Deliverable processing: `src/lib/deliverables.ts`
- Submission state/actions: `src/lib/submission.ts`
- Deadline/countdown calculations: `src/lib/deadline.ts`

The expected flow is: workspace loads deliverable structure, renders the relevant interactive component/widget, records answers and completion state, then derives per-deliverable, part-level, and overall progress for display and submission.

#### Client State and Persistence Boundary
Browser-side persistence is a primary architectural boundary: the README specifies `localStorage` and no required backend. State/session utilities are isolated in:
- Storage abstraction: `src/lib/store.ts`
- Session handling: `src/lib/session.ts`
- Read-only behavior: `src/lib/readonly.ts`

This keeps UI components from directly owning persistence mechanics and permits workspace modes such as editable versus read-only.

#### Identity, Collaboration, and External-Service Boundary
The current landing flow uses mock Google login rather than wired OAuth, while authentication concerns are isolated in `src/lib/auth.ts`. The repository also contains a Supabase integration boundary and SQL assets:
- Client/service integration: `src/lib/supabase.ts`
- Realtime enablement: `supabase/enable_realtime.sql`
- Seed and schema-extension scripts: `supabase/seed.sql`, `supabase/add_challenge_doc_urls.sql`

These files indicate optional or evolving backend/realtime capabilities, but the documented baseline remains local browser persistence.

#### Supporting Product Features
Cross-cutting product behavior is encapsulated outside the core workspace:
- Admin UI: `src/components/Admin.tsx`
- Contact-related logic: `src/lib/contacts.ts`
- Upload boundary: `src/lib/uploads.ts`
- Theme state: `src/lib/theme.ts`
- Easter-egg feature set, including doomsday clock behavior: `src/components/EasterEggs.tsx`, `src/lib/easter-eggs.ts`, `src/lib/doomsday-clock.ts`

#### Runtime and Deployment
The application requires Node 22+ for development/build. Astro produces static output, with React used for interactivity and Tailwind CSS v4 for styling; deployment can target static hosts such as Vercel. Operational deployment guidance is in `DEPLOY.md`.

Main entry points: [`src/components/Workspace.tsx`](https://github.com/idonov8/meet-case-studies/blob/main/src/components/Workspace.tsx) (Workspace), [`src/layouts/Layout.astro`](https://github.com/idonov8/meet-case-studies/blob/main/src/layouts/Layout.astro) (Shared layout), [`src/pages/app.astro`](https://github.com/idonov8/meet-case-studies/blob/main/src/pages/app.astro) (Team workspace route), [`src/pages/index.astro`](https://github.com/idonov8/meet-case-studies/blob/main/src/pages/index.astro) (Landing & mock login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_astro["Astro app"]
  node_index["Landing &amp; mock login<br/>Astro route<br/>[index.astro]"]
  node_app["Team workspace route<br/>Astro route<br/>[app.astro]"]
  node_admin_route["Admin route<br/>Astro route<br/>[admin.astro]"]
  node_layout["Shared layout<br/>Astro layout<br/>[Layout.astro]"]
  node_global_css["Global styles<br/>CSS<br/>[global.css]"]
  node_deploy["Deployment guidance<br/>operations document<br/>[DEPLOY.md]"]
end

subgraph group_workspace["Workspace UI"]
  node_workspace_ui["Workspace<br/>React orchestrator<br/>[Workspace.tsx]"]
  node_case_study["Deliverable renderer<br/>React component<br/>[CaseStudy.tsx]"]
  node_widgets["Structured widgets<br/>React widgets<br/>[widgets.tsx]"]
  node_submit_panel["Submission panel<br/>React component<br/>[SubmitPanel.tsx]"]
  node_admin_ui["Admin UI<br/>React component<br/>[Admin.tsx]"]
end

subgraph group_domain["Deliverable domain"]
  node_deliverable_data[("Deliverable definitions<br/>content model<br/>[data.ts]")]
  node_deliverables["Deliverable processing<br/>domain logic<br/>[deliverables.ts]"]
  node_submission["Progress &amp; submission<br/>domain actions<br/>[submission.ts]"]
  node_deadline["Deadline countdown<br/>domain logic<br/>[deadline.ts]"]
end

subgraph group_client["Client state"]
  node_store[("Storage abstraction<br/>client persistence<br/>[store.ts]")]
  node_session["Session handling<br/>client state<br/>[session.ts]"]
  node_readonly["Read-only mode<br/>access policy<br/>[readonly.ts]"]
  node_auth["Authentication boundary<br/>auth service<br/>[auth.ts]"]
end

subgraph group_optional["Optional services"]
  node_supabase{{"Supabase boundary<br/>external service client<br/>[supabase.ts]"}}
  node_realtime_sql["Realtime SQL enablement<br/>Supabase SQL"]
end

node_index -->|"uses"| node_layout
node_app -->|"uses"| node_layout
node_admin_route -->|"uses"| node_layout
node_layout -->|"loads"| node_global_css
node_app -->|"mounts"| node_workspace_ui
node_admin_route -->|"mounts"| node_admin_ui
node_workspace_ui -->|"renders"| node_case_study
node_case_study -->|"uses"| node_widgets
node_workspace_ui -->|"shows"| node_submit_panel
node_workspace_ui -->|"loads structure"| node_deliverables
node_deliverables -->|"reads"| node_deliverable_data
node_workspace_ui -->|"records answers"| node_submission
node_submit_panel -->|"displays progress"| node_submission
node_workspace_ui -->|"calculates countdown"| node_deadline
node_workspace_ui -->|"persists workspace"| node_store
node_session -->|"persists session"| node_store
node_readonly -->|"controls editability"| node_workspace_ui
node_index -->|"initiates login"| node_auth
node_auth -->|"establishes session"| node_session
node_supabase -.->|"configured by"| node_realtime_sql
node_deploy -.->|"deploys static output"| node_app

click node_index "https://github.com/idonov8/meet-case-studies/blob/main/src/pages/index.astro"
click node_app "https://github.com/idonov8/meet-case-studies/blob/main/src/pages/app.astro"
click node_admin_route "https://github.com/idonov8/meet-case-studies/blob/main/src/pages/admin.astro"
click node_layout "https://github.com/idonov8/meet-case-studies/blob/main/src/layouts/Layout.astro"
click node_global_css "https://github.com/idonov8/meet-case-studies/blob/main/src/styles/global.css"
click node_workspace_ui "https://github.com/idonov8/meet-case-studies/blob/main/src/components/Workspace.tsx"
click node_case_study "https://github.com/idonov8/meet-case-studies/blob/main/src/components/CaseStudy.tsx"
click node_widgets "https://github.com/idonov8/meet-case-studies/blob/main/src/components/widgets.tsx"
click node_submit_panel "https://github.com/idonov8/meet-case-studies/blob/main/src/components/SubmitPanel.tsx"
click node_admin_ui "https://github.com/idonov8/meet-case-studies/blob/main/src/components/Admin.tsx"
click node_deliverable_data "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/data.ts"
click node_deliverables "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/deliverables.ts"
click node_submission "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/submission.ts"
click node_deadline "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/deadline.ts"
click node_store "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/store.ts"
click node_session "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/session.ts"
click node_readonly "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/readonly.ts"
click node_auth "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/auth.ts"
click node_supabase "https://github.com/idonov8/meet-case-studies/blob/main/src/lib/supabase.ts"
click node_realtime_sql "https://github.com/idonov8/meet-case-studies/blob/main/supabase/enable_realtime.sql"
click node_deploy "https://github.com/idonov8/meet-case-studies/blob/main/DEPLOY.md"

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_index,node_app,node_admin_route,node_layout,node_global_css,node_deploy toneBlue
class node_workspace_ui,node_case_study,node_widgets,node_submit_panel,node_admin_ui toneAmber
class node_deliverable_data,node_deliverables,node_submission,node_deadline toneMint
class node_store,node_session,node_readonly,node_auth toneRose
class node_supabase,node_realtime_sql toneIndigo
```

## Components

### Astro app

Static routes and shared document shell.

- [Landing & mock login](https://github.com/idonov8/meet-case-studies/blob/main/src/pages/index.astro): Astro route · `src/pages/index.astro`
- [Team workspace route](https://github.com/idonov8/meet-case-studies/blob/main/src/pages/app.astro): Astro route · `src/pages/app.astro`
- [Admin route](https://github.com/idonov8/meet-case-studies/blob/main/src/pages/admin.astro): Astro route · `src/pages/admin.astro`
- [Shared layout](https://github.com/idonov8/meet-case-studies/blob/main/src/layouts/Layout.astro): Astro layout · `src/layouts/Layout.astro`
- [Global styles](https://github.com/idonov8/meet-case-studies/blob/main/src/styles/global.css): CSS · `src/styles/global.css`
- [Deployment guidance](https://github.com/idonov8/meet-case-studies/blob/main/DEPLOY.md): operations document · Static-host deployment guidance. · `DEPLOY.md`

### Workspace UI

React authoring and submission experience.

- [Workspace](https://github.com/idonov8/meet-case-studies/blob/main/src/components/Workspace.tsx): React orchestrator · `src/components/Workspace.tsx`
- [Deliverable renderer](https://github.com/idonov8/meet-case-studies/blob/main/src/components/CaseStudy.tsx): React component · `src/components/CaseStudy.tsx`
- [Structured widgets](https://github.com/idonov8/meet-case-studies/blob/main/src/components/widgets.tsx): React widgets · Planning, matrix, tree, checklist, and visual inputs. · `src/components/widgets.tsx`
- [Submission panel](https://github.com/idonov8/meet-case-studies/blob/main/src/components/SubmitPanel.tsx): React component · `src/components/SubmitPanel.tsx`
- [Admin UI](https://github.com/idonov8/meet-case-studies/blob/main/src/components/Admin.tsx): React component · `src/components/Admin.tsx`

### Deliverable domain

Definitions, progress, and deadline logic.

- [Deliverable definitions](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/data.ts): content model · `src/lib/data.ts`
- [Deliverable processing](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/deliverables.ts): domain logic · Builds grouped deliverables and completion state. · `src/lib/deliverables.ts`
- [Progress & submission](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/submission.ts): domain actions · Derives part, deliverable, and overall progress. · `src/lib/submission.ts`
- [Deadline countdown](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/deadline.ts): domain logic · `src/lib/deadline.ts`

### Client state

Browser persistence and workspace access modes.

- [Storage abstraction](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/store.ts): client persistence · Wraps browser localStorage. · `src/lib/store.ts`
- [Session handling](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/session.ts): client state · `src/lib/session.ts`
- [Read-only mode](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/readonly.ts): access policy · `src/lib/readonly.ts`
- [Authentication boundary](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/auth.ts): auth service · Current landing flow uses mock Google login. · `src/lib/auth.ts`

### Optional services

Evolving external integration boundary.

- [Supabase boundary](https://github.com/idonov8/meet-case-studies/blob/main/src/lib/supabase.ts): external service client · Optional backend and realtime integration. · `src/lib/supabase.ts`
- [Realtime SQL enablement](https://github.com/idonov8/meet-case-studies/blob/main/supabase/enable_realtime.sql): Supabase SQL · `supabase/enable_realtime.sql`

## Connections

- Landing & mock login → Shared layout: uses
- Team workspace route → Shared layout: uses
- Admin route → Shared layout: uses
- Shared layout → Global styles: loads
- Team workspace route → Workspace: mounts
- Admin route → Admin UI: mounts
- Workspace → Deliverable renderer: renders
- Deliverable renderer → Structured widgets: uses
- Workspace → Submission panel: shows
- Workspace → Deliverable processing: loads structure
- Deliverable processing → Deliverable definitions: reads
- Workspace → Progress & submission: records answers
- Submission panel → Progress & submission: displays progress
- Workspace → Deadline countdown: calculates countdown
- Workspace → Storage abstraction: persists workspace
- Session handling → Storage abstraction: persists session
- Read-only mode → Workspace: controls editability
- Landing & mock login → Authentication boundary: initiates login
- Authentication boundary → Session handling: establishes session
- Supabase boundary → Realtime SQL enablement: configured by
- Deployment guidance → Team workspace route: deploys static output
