# voss-labs/vprep architecture

> Architecture diagram of the GitHub repository voss-labs/vprep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/voss-labs/vprep
- Repository: https://github.com/voss-labs/vprep

## Overview

vprep is a student resource-library foundation: its shipped landing page presents papers, notes, syllabus and resources, while browsing, uploads and moderation routes are explicitly future work. The current runtime includes institute-email OTP authentication, session-aware landing/navigation, and database, mail and object-storage helpers. The graph separates implemented wiring from documented future content workflows; unsampled implementations are represented only at the existing app directory level.

Main entry points: [`app/page.tsx`](https://github.com/voss-labs/vprep/blob/main/app/page.tsx) (Landing page), [`lib/auth.ts`](https://github.com/voss-labs/vprep/blob/main/lib/auth.ts) (OTP authentication), [`db/index.ts`](https://github.com/voss-labs/vprep/blob/main/db/index.ts) (Database access), [`lib/session.ts`](https://github.com/voss-labs/vprep/blob/main/lib/session.ts) (Session helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_home["Landing page<br/>[page.tsx]"]
  node_navigation["Site navigation<br/>[editorial-nav.tsx]"]
end

subgraph group_identity["Identity and sessions"]
  node_session["Session helpers<br/>[session.ts]"]
  node_authapi["Auth API route<br/>[route.ts]"]
  node_auth["OTP authentication<br/>[auth.ts]"]
  node_authclient["Auth client<br/>[auth-client.ts]"]
end

subgraph group_services["Data and integrations"]
  node_database["Database access<br/>[index.ts]"]
  node_schema["Auth and content schema<br/>[schema.ts]"]
  node_mail["OTP mail helper<br/>[mail.ts]"]
  node_storage["PDF object storage<br/>[r2.ts]"]
end

subgraph group_library["Resource library"]
  node_papers["Past papers"]
  node_notes["Notes"]
  node_syllabus["Syllabus"]
  node_resources["Curated resources"]
  node_contribution["Upload and review"]
end

node_student(("Student"))
node_moderator(("Moderator"))
node_neon[("Neon Postgres")]
node_resend["Resend"]
node_r2service["Cloudflare R2"]

node_student -->|"opens"| node_home
node_home -->|"gets session"| node_session
node_navigation -->|"gets session"| node_session
node_home -->|"links to"| node_papers
node_home -->|"links to"| node_notes
node_home -->|"links to"| node_syllabus
node_home -->|"links to"| node_resources
node_student -->|"requests OTP auth"| node_authapi
node_authapi -->|"dispatches"| node_auth
node_authclient -->|"calls auth API"| node_authapi
node_session -->|"gets session"| node_auth
node_auth -->|"uses adapter"| node_database
node_auth -->|"sends OTP"| node_mail
node_database -->|"queries"| node_neon
node_database -->|"configures"| node_schema
node_mail -.->|"sends email"| node_resend
node_student -.->|"planned upload"| node_contribution
node_moderator -.->|"planned review"| node_contribution
node_storage -.->|"stores files"| node_r2service
node_contribution -.->|"planned file storage"| node_storage

click node_home "https://github.com/voss-labs/vprep/blob/main/app/page.tsx"
click node_navigation "https://github.com/voss-labs/vprep/blob/main/components/editorial-nav.tsx"
click node_session "https://github.com/voss-labs/vprep/blob/main/lib/session.ts"
click node_authapi "https://github.com/voss-labs/vprep/blob/main/app/api/auth/%5B...all%5D/route.ts"
click node_auth "https://github.com/voss-labs/vprep/blob/main/lib/auth.ts"
click node_authclient "https://github.com/voss-labs/vprep/blob/main/lib/auth-client.ts"
click node_database "https://github.com/voss-labs/vprep/blob/main/db/index.ts"
click node_schema "https://github.com/voss-labs/vprep/blob/main/db/schema.ts"
click node_mail "https://github.com/voss-labs/vprep/blob/main/lib/mail.ts"
click node_storage "https://github.com/voss-labs/vprep/blob/main/lib/r2.ts"
click node_papers "https://github.com/voss-labs/vprep/tree/main/app"
click node_notes "https://github.com/voss-labs/vprep/tree/main/app"
click node_syllabus "https://github.com/voss-labs/vprep/tree/main/app"
click node_resources "https://github.com/voss-labs/vprep/tree/main/app"
click node_contribution "https://github.com/voss-labs/vprep/tree/main/app"

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_home,node_navigation toneBlue
class node_session,node_authapi,node_auth,node_authclient,node_neon toneAmber
class node_database,node_schema,node_mail,node_storage toneMint
class node_papers,node_notes,node_syllabus,node_resources,node_contribution toneRose
class node_student,node_moderator,node_resend,node_r2service toneIndigo
```

## Components

### Web experience

- [Landing page](https://github.com/voss-labs/vprep/blob/main/app/page.tsx): `app/page.tsx`
- [Site navigation](https://github.com/voss-labs/vprep/blob/main/components/editorial-nav.tsx): `components/editorial-nav.tsx`

### Identity and sessions

- [Session helpers](https://github.com/voss-labs/vprep/blob/main/lib/session.ts): `lib/session.ts`
- [Auth API route](https://github.com/voss-labs/vprep/blob/main/app/api/auth/%5B...all%5D/route.ts): `app/api/auth/[...all]/route.ts`
- [OTP authentication](https://github.com/voss-labs/vprep/blob/main/lib/auth.ts): `lib/auth.ts`
- [Auth client](https://github.com/voss-labs/vprep/blob/main/lib/auth-client.ts): `lib/auth-client.ts`

### Data and integrations

- [Database access](https://github.com/voss-labs/vprep/blob/main/db/index.ts): `db/index.ts`
- [Auth and content schema](https://github.com/voss-labs/vprep/blob/main/db/schema.ts): `db/schema.ts`
- [OTP mail helper](https://github.com/voss-labs/vprep/blob/main/lib/mail.ts): `lib/mail.ts`
- [PDF object storage](https://github.com/voss-labs/vprep/blob/main/lib/r2.ts): `lib/r2.ts`

### Resource library

- [Past papers](https://github.com/voss-labs/vprep/tree/main/app): `app`
- [Notes](https://github.com/voss-labs/vprep/tree/main/app): `app`
- [Syllabus](https://github.com/voss-labs/vprep/tree/main/app): `app`
- [Curated resources](https://github.com/voss-labs/vprep/tree/main/app): `app`
- [Upload and review](https://github.com/voss-labs/vprep/tree/main/app): `app`

### Other components

- **Student**
- **Moderator**
- **Neon Postgres**
- **Resend**
- **Cloudflare R2**

## Connections

- Student → Landing page: opens
- Landing page → Session helpers: gets session
- Site navigation → Session helpers: gets session
- Landing page → Past papers: links to
- Landing page → Notes: links to
- Landing page → Syllabus: links to
- Landing page → Curated resources: links to
- Student → Auth API route: requests OTP auth
- Auth API route → OTP authentication: dispatches
- Auth client → Auth API route: calls auth API
- Session helpers → OTP authentication: gets session
- OTP authentication → Database access: uses adapter
- OTP authentication → OTP mail helper: sends OTP
- Database access → Neon Postgres: queries
- Database access → Auth and content schema: configures
- OTP mail helper → Resend: sends email
- Student → Upload and review: planned upload
- Moderator → Upload and review: planned review
- PDF object storage → Cloudflare R2: stores files
- Upload and review → PDF object storage: planned file storage
