# noahchocolumbia/week-1 architecture

> Architecture diagram of the GitHub repository noahchocolumbia/week-1, 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/noahchocolumbia/week-1
- Repository: https://github.com/noahchocolumbia/week-1
- Video tour (about a minute): https://gitdiagram.com/noahchocolumbia/week-1/video

## Overview

This is a Next.js meme-making and community app. A user signs in, completes a profile, uploads a photo, generates or remixes AI captions, and publishes or shares a meme; other users browse, vote, and view ranked or individual posts. The graph groups those user-facing stages and includes the server actions, feed assembly, and Supabase persistence layer. Evidence is limited to the README, SOURCE INDEX references, and sampled excerpts; unsampled subsystem links are omitted where their callers are not shown.

Main entry points: [`src/lib/feed.ts`](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/feed.ts) (Feed assembly), [`src/app/actions.ts`](https://github.com/noahchocolumbia/week-1/blob/main/src/app/actions.ts) (Server actions), [`src/lib/supabase-server.ts`](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/supabase-server.ts) (Server client), [`src/components/Studio.tsx`](https://github.com/noahchocolumbia/week-1/blob/main/src/components/Studio.tsx) (Creation studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and profile"]
  node_login["Sign in<br/>[page.tsx]"]
  node_auth_routes["Auth routes<br/>[route.ts]"]
  node_profile["Profile<br/>[page.tsx]"]
  node_avatar["Avatar upload<br/>[AvatarUploader.tsx]"]
  node_welcome["Name setup<br/>[page.tsx]"]
end

subgraph group_creation["Meme creation"]
  node_studio_page["Generate page<br/>[page.tsx]"]
  node_studio["Creation studio<br/>[Studio.tsx]"]
end

subgraph group_discovery["Browse and engage"]
  node_home["Home gallery<br/>[page.tsx]"]
  node_rate["Rate memes<br/>[page.tsx]"]
  node_top["Ranked memes<br/>[page.tsx]"]
  node_detail["Meme detail<br/>[page.tsx]"]
  node_projects["Projects<br/>[page.tsx]"]
  node_postcard["Meme post card<br/>[PostCard.tsx]"]
  node_votes["Vote controls<br/>[VoteButtons.tsx]"]
end

subgraph group_runtime["Application services"]
  node_feed["Feed assembly<br/>[feed.ts]"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_styles["Styles and formats<br/>[styles.ts]"]
  node_gemini["Caption generation<br/>[gemini.ts]"]
  node_supabase_server["Server client<br/>[supabase-server.ts]"]
  node_supabase_client["Browser client<br/>[supabase.ts]"]
  node_storage[("Supabase data and storage")]
end

node_user(("User"))
node_google_ai{{"Google Gemini API"}}

node_user -->|"signs in"| node_login
node_login -->|"checks session"| node_supabase_server
node_auth_routes -->|"handles auth"| node_supabase_server
node_user -->|"sets name"| node_welcome
node_welcome -->|"saves name"| node_actions
node_user -->|"views profile"| node_profile
node_profile -->|"loads scores"| node_feed
node_profile -->|"edits avatar"| node_avatar
node_avatar -->|"saves avatar path"| node_actions
node_avatar -->|"uploads image"| node_supabase_client
node_user -->|"browses"| node_home
node_home -->|"loads memes"| node_feed
node_user -->|"rates memes"| node_rate
node_rate -->|"loads memes"| node_feed
node_rate -->|"renders feed"| node_postcard
node_user -->|"views rankings"| node_top
node_top -->|"ranks memes"| node_feed
node_user -->|"opens meme"| node_detail
node_detail -->|"loads meme"| node_feed
node_home -->|"renders posts"| node_postcard
node_detail -->|"renders post"| node_postcard
node_postcard -->|"shows controls"| node_votes
node_votes -->|"casts vote"| node_actions
node_user -->|"creates meme"| node_studio_page
node_studio_page -->|"renders studio"| node_studio
node_studio_page -->|"loads drafts"| node_feed
node_studio -->|"generates captions"| node_actions
node_studio -->|"uploads photo"| node_supabase_client
node_studio -->|"chooses style"| node_styles
node_actions -->|"requests captions"| node_gemini
node_gemini -->|"calls generation API"| node_google_ai
node_actions -->|"authenticates and persists"| node_supabase_server
node_actions -->|"stores uploads"| node_storage
node_feed -->|"reads posts and scores"| node_storage
node_feed -->|"uses server client"| node_supabase_server
node_supabase_server -->|"queries data"| node_storage
node_supabase_client -->|"accesses storage"| node_storage
node_projects -->|"loads session"| node_supabase_server

click node_login "https://github.com/noahchocolumbia/week-1/blob/main/src/app/login/page.tsx"
click node_auth_routes "https://github.com/noahchocolumbia/week-1/blob/main/src/app/auth/callback/route.ts"
click node_profile "https://github.com/noahchocolumbia/week-1/blob/main/src/app/profile/page.tsx"
click node_avatar "https://github.com/noahchocolumbia/week-1/blob/main/src/components/AvatarUploader.tsx"
click node_welcome "https://github.com/noahchocolumbia/week-1/blob/main/src/app/welcome/page.tsx"
click node_home "https://github.com/noahchocolumbia/week-1/blob/main/src/app/page.tsx"
click node_rate "https://github.com/noahchocolumbia/week-1/blob/main/src/app/rate/page.tsx"
click node_top "https://github.com/noahchocolumbia/week-1/blob/main/src/app/top/page.tsx"
click node_detail "https://github.com/noahchocolumbia/week-1/blob/main/src/app/m/%5Bid%5D/page.tsx"
click node_projects "https://github.com/noahchocolumbia/week-1/blob/main/src/app/projects/page.tsx"
click node_postcard "https://github.com/noahchocolumbia/week-1/blob/main/src/components/PostCard.tsx"
click node_votes "https://github.com/noahchocolumbia/week-1/blob/main/src/components/VoteButtons.tsx"
click node_feed "https://github.com/noahchocolumbia/week-1/blob/main/src/lib/feed.ts"
click node_studio_page "https://github.com/noahchocolumbia/week-1/blob/main/src/app/generate/page.tsx"
click node_studio "https://github.com/noahchocolumbia/week-1/blob/main/src/components/Studio.tsx"
click node_actions "https://github.com/noahchocolumbia/week-1/blob/main/src/app/actions.ts"
click node_styles "https://github.com/noahchocolumbia/week-1/blob/main/src/lib/styles.ts"
click node_gemini "https://github.com/noahchocolumbia/week-1/blob/main/src/lib/gemini.ts"
click node_supabase_server "https://github.com/noahchocolumbia/week-1/blob/main/src/lib/supabase-server.ts"
click node_supabase_client "https://github.com/noahchocolumbia/week-1/blob/main/src/lib/supabase.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_login,node_auth_routes,node_profile,node_avatar,node_welcome,node_user toneBlue
class node_studio_page,node_studio toneAmber
class node_home,node_rate,node_top,node_detail,node_projects,node_postcard,node_votes,node_google_ai toneMint
class node_feed,node_actions,node_styles,node_gemini,node_supabase_server,node_supabase_client,node_storage toneRose
```

## Components

### Identity and profile

- [Sign in](https://github.com/noahchocolumbia/week-1/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth routes](https://github.com/noahchocolumbia/week-1/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Profile](https://github.com/noahchocolumbia/week-1/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Avatar upload](https://github.com/noahchocolumbia/week-1/blob/main/src/components/AvatarUploader.tsx): `src/components/AvatarUploader.tsx`
- [Name setup](https://github.com/noahchocolumbia/week-1/blob/main/src/app/welcome/page.tsx): `src/app/welcome/page.tsx`

### Meme creation

- [Generate page](https://github.com/noahchocolumbia/week-1/blob/main/src/app/generate/page.tsx): `src/app/generate/page.tsx`
- [Creation studio](https://github.com/noahchocolumbia/week-1/blob/main/src/components/Studio.tsx): `src/components/Studio.tsx`

### Browse and engage

- [Home gallery](https://github.com/noahchocolumbia/week-1/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Rate memes](https://github.com/noahchocolumbia/week-1/blob/main/src/app/rate/page.tsx): `src/app/rate/page.tsx`
- [Ranked memes](https://github.com/noahchocolumbia/week-1/blob/main/src/app/top/page.tsx): `src/app/top/page.tsx`
- [Meme detail](https://github.com/noahchocolumbia/week-1/blob/main/src/app/m/%5Bid%5D/page.tsx): `src/app/m/[id]/page.tsx`
- [Projects](https://github.com/noahchocolumbia/week-1/blob/main/src/app/projects/page.tsx): `src/app/projects/page.tsx`
- [Meme post card](https://github.com/noahchocolumbia/week-1/blob/main/src/components/PostCard.tsx): `src/components/PostCard.tsx`
- [Vote controls](https://github.com/noahchocolumbia/week-1/blob/main/src/components/VoteButtons.tsx): `src/components/VoteButtons.tsx`

### Application services

- [Feed assembly](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/feed.ts): `src/lib/feed.ts`
- [Server actions](https://github.com/noahchocolumbia/week-1/blob/main/src/app/actions.ts): `src/app/actions.ts`
- [Styles and formats](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/styles.ts): `src/lib/styles.ts`
- [Caption generation](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/gemini.ts): `src/lib/gemini.ts`
- [Server client](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/supabase-server.ts): `src/lib/supabase-server.ts`
- [Browser client](https://github.com/noahchocolumbia/week-1/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase data and storage**

### Other components

- **User**
- **Google Gemini API**

## Connections

- User → Sign in: signs in
- Sign in → Server client: checks session (evidence: `src/app/login/page.tsx`)
- Auth routes → Server client: handles auth (evidence: `src/app/auth/callback/route.ts`)
- User → Name setup: sets name
- Name setup → Server actions: saves name (evidence: `src/app/welcome/page.tsx`)
- User → Profile: views profile
- Profile → Feed assembly: loads scores (evidence: `src/app/profile/page.tsx`)
- Profile → Avatar upload: edits avatar (evidence: `src/app/profile/page.tsx`)
- Avatar upload → Server actions: saves avatar path (evidence: `src/components/AvatarUploader.tsx`)
- Avatar upload → Browser client: uploads image (evidence: `src/components/AvatarUploader.tsx`)
- User → Home gallery: browses
- Home gallery → Feed assembly: loads memes (evidence: `src/app/page.tsx`)
- User → Rate memes: rates memes
- Rate memes → Feed assembly: loads memes (evidence: `src/app/rate/page.tsx`)
- Rate memes → Meme post card: renders feed (evidence: `src/app/rate/page.tsx`)
- User → Ranked memes: views rankings
- Ranked memes → Feed assembly: ranks memes (evidence: `src/app/top/page.tsx`)
- User → Meme detail: opens meme
- Meme detail → Feed assembly: loads meme (evidence: `src/app/m/[id]/page.tsx`)
- Home gallery → Meme post card: renders posts (evidence: `src/app/page.tsx`)
- Meme detail → Meme post card: renders post (evidence: `src/app/m/[id]/page.tsx`)
- Meme post card → Vote controls: shows controls (evidence: `src/components/PostCard.tsx`)
- Vote controls → Server actions: casts vote (evidence: `src/components/VoteButtons.tsx`)
- User → Generate page: creates meme
- Generate page → Creation studio: renders studio (evidence: `src/app/generate/page.tsx`)
- Generate page → Feed assembly: loads drafts (evidence: `src/app/generate/page.tsx`)
- Creation studio → Server actions: generates captions (evidence: `src/components/Studio.tsx`)
- Creation studio → Browser client: uploads photo (evidence: `src/components/Studio.tsx`)
- Creation studio → Styles and formats: chooses style (evidence: `src/components/Studio.tsx`)
- Server actions → Caption generation: requests captions (evidence: `src/app/actions.ts`)
- Caption generation → Google Gemini API: calls generation API (evidence: `src/lib/gemini.ts`)
- Server actions → Server client: authenticates and persists (evidence: `src/app/actions.ts`)
- Server actions → Supabase data and storage: stores uploads (evidence: `src/app/actions.ts`)
- Feed assembly → Supabase data and storage: reads posts and scores (evidence: `src/lib/feed.ts`)
- Feed assembly → Server client: uses server client (evidence: `src/lib/feed.ts`)
- Server client → Supabase data and storage: queries data (evidence: `src/lib/supabase-server.ts`)
- Browser client → Supabase data and storage: accesses storage
- Projects → Server client: loads session (evidence: `src/app/projects/page.tsx`)
