# rionseekings/clemson-student-spending architecture

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

- Interactive diagram: https://gitdiagram.com/rionseekings/clemson-student-spending
- Repository: https://github.com/rionseekings/clemson-student-spending

## Overview

The repository collects Clemson student spending responses and computes aggregate spending statistics. The primary workflow is a student completing the survey, submitting it for validation and storage, then a data pipeline fetching responses, cleaning them, analyzing them, and updating an analytics cache. The README describes finding insights; visualization and email-related modules are present, but their behavior and connections are not established by the available excerpts. The landing page excerpt is still a Next.js starter page.

Main entry points: [`data/pipeline.py`](https://github.com/rionseekings/clemson-student-spending/blob/main/data/pipeline.py) (Analytics pipeline), [`frontend/src/app/survey/page.tsx`](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/survey/page.tsx) (Spending survey), [`frontend/src/app/api/submit/route.ts`](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/api/submit/route.ts) (Submission API), [`frontend/src/lib/supabase.ts`](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/lib/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Response collection"]
  node_survey["Spending survey<br/>[page.tsx]"]
  node_formui["Form controls"]
  node_schema["Survey schema<br/>[survey-schema.ts]"]
  node_submit["Submission API<br/>[route.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_responses[("Survey responses")]
  node_home["Home page<br/>[page.tsx]"]
end

subgraph group_analysis["Spending analysis"]
  node_pipeline["Analytics pipeline<br/>[pipeline.py]"]
  node_clean["Response cleaning<br/>[clean.py]"]
  node_analyze["Spending analysis<br/>[analyze.py]"]
  node_cache[("Analytics cache")]
end

subgraph group_presentation["Presentation modules"]
  node_visualize["Visualization<br/>[visualize.py]"]
  node_email["Email builder<br/>[email_builder.py]"]
end

node_student(("Student"))

node_student -->|"completes"| node_survey
node_survey -->|"renders"| node_formui
node_survey -->|"validates with"| node_schema
node_survey -->|"posts to"| node_submit
node_submit -->|"validates with"| node_schema
node_submit -->|"inserts via"| node_supabase_client
node_supabase_client -->|"writes"| node_responses
node_pipeline -->|"reads"| node_responses
node_pipeline -->|"cleans with"| node_clean
node_pipeline -->|"analyzes with"| node_analyze
node_pipeline -->|"updates"| node_cache

click node_survey "https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/survey/page.tsx"
click node_formui "https://github.com/rionseekings/clemson-student-spending/tree/main/frontend/src/components/ui"
click node_schema "https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/lib/survey-schema.ts"
click node_submit "https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/api/submit/route.ts"
click node_supabase_client "https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/lib/supabase.ts"
click node_pipeline "https://github.com/rionseekings/clemson-student-spending/blob/main/data/pipeline.py"
click node_clean "https://github.com/rionseekings/clemson-student-spending/blob/main/data/clean.py"
click node_analyze "https://github.com/rionseekings/clemson-student-spending/blob/main/data/analyze.py"
click node_visualize "https://github.com/rionseekings/clemson-student-spending/blob/main/data/visualize.py"
click node_email "https://github.com/rionseekings/clemson-student-spending/blob/main/data/email_builder.py"
click node_home "https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/page.tsx"

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_survey,node_formui,node_schema,node_submit,node_supabase_client,node_responses,node_home toneBlue
class node_pipeline,node_clean,node_analyze,node_cache toneAmber
class node_visualize,node_email toneMint
class node_student toneIndigo
```

## Components

### Response collection

- [Spending survey](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/survey/page.tsx): `frontend/src/app/survey/page.tsx`
- [Form controls](https://github.com/rionseekings/clemson-student-spending/tree/main/frontend/src/components/ui): `frontend/src/components/ui`
- [Survey schema](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/lib/survey-schema.ts): `frontend/src/lib/survey-schema.ts`
- [Submission API](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/api/submit/route.ts): `frontend/src/app/api/submit/route.ts`
- [Supabase client](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/lib/supabase.ts): `frontend/src/lib/supabase.ts`
- **Survey responses**
- [Home page](https://github.com/rionseekings/clemson-student-spending/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### Spending analysis

- [Analytics pipeline](https://github.com/rionseekings/clemson-student-spending/blob/main/data/pipeline.py): `data/pipeline.py`
- [Response cleaning](https://github.com/rionseekings/clemson-student-spending/blob/main/data/clean.py): `data/clean.py`
- [Spending analysis](https://github.com/rionseekings/clemson-student-spending/blob/main/data/analyze.py): `data/analyze.py`
- **Analytics cache**

### Presentation modules

- [Visualization](https://github.com/rionseekings/clemson-student-spending/blob/main/data/visualize.py): `data/visualize.py`
- [Email builder](https://github.com/rionseekings/clemson-student-spending/blob/main/data/email_builder.py): `data/email_builder.py`

### Other components

- **Student**

## Connections

- Student → Spending survey: completes (evidence: `frontend/src/app/survey/page.tsx`)
- Spending survey → Form controls: renders (evidence: `frontend/src/app/survey/page.tsx`)
- Spending survey → Survey schema: validates with (evidence: `frontend/src/app/survey/page.tsx`)
- Spending survey → Submission API: posts to (evidence: `frontend/src/app/survey/page.tsx`)
- Submission API → Survey schema: validates with (evidence: `frontend/src/app/api/submit/route.ts`)
- Submission API → Supabase client: inserts via (evidence: `frontend/src/app/api/submit/route.ts`)
- Supabase client → Survey responses: writes
- Analytics pipeline → Survey responses: reads (evidence: `data/pipeline.py`)
- Analytics pipeline → Response cleaning: cleans with (evidence: `data/pipeline.py`)
- Analytics pipeline → Spending analysis: analyzes with (evidence: `data/pipeline.py`)
- Analytics pipeline → Analytics cache: updates (evidence: `data/pipeline.py`)
