# utdnebula/utd-notebook architecture

> Architecture diagram of the GitHub repository utdnebula/utd-notebook, 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/utdnebula/utd-notebook
- Repository: https://github.com/utdnebula/utd-notebook

## Overview

UTD Notebook is a student-facing course and notes application: users discover courses and notes, create or manage notes, and use account and moderation features. The graph includes the documented search, notes, account, and moderation branches, plus the tRPC/API layer and persistence integrations. Sampled code confirms the tRPC entry point, authentication handler, autocomplete re-exports, and note-file upload/storage flow; wiring among unsampled pages and routers is left unspecified.

Main entry points: [`src/server/api/routers/storage.ts`](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/api/routers/storage.ts) (Storage procedures), [`src/systems/notes/hooks/useUploadToUploadURL.ts`](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/hooks/useUploadToUploadURL.ts) (File upload hook), [`src/server/storage.ts`](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/storage.ts) (Nebula storage client), [`src/systems/notes/pages/CreateNotePage.tsx`](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/pages/CreateNotePage.tsx) (Create note)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_search["Search and discovery"]
  node_home["Course search<br/>[HomePage.tsx]"]
  node_searchquery["Search query model<br/>[SearchQuery.tsx]"]
  node_autocomplete["Autocomplete API<br/>[autocomplete.ts]"]
  node_courseautocomplete["Course-name API"]
end

subgraph group_notes["Notes"]
  node_notes_pages["Notes pages<br/>[NotesPage.tsx]"]
  node_create_note["Create note<br/>[CreateNotePage.tsx]"]
  node_note_form["Note forms<br/>[CreateNoteForm.tsx]"]
  node_upload_hook["File upload hook"]
  node_file_api["Note file API<br/>[file.ts]"]
end

subgraph group_accounts["Accounts"]
  node_auth_page["Authentication page<br/>[AuthPage.tsx]"]
  node_profile["Profiles<br/>[ProfilePage.tsx]"]
  node_settings["Account settings<br/>[SettingsPage.tsx]"]
  node_onboarding["Onboarding<br/>[GetStartedPage.tsx]"]
end

subgraph group_moderation["Moderation"]
  node_report["Report submission<br/>[ReportPage.tsx]"]
  node_admin["Admin review<br/>[AdminPage.tsx]"]
end

subgraph group_platform["API and persistence"]
  node_autocomplete_route["Autocomplete route<br/>[route.ts]"]
  node_courseautocomplete_route["Course-name route<br/>[route.ts]"]
  node_file_route["File route<br/>[route.ts]"]
  node_auth_route["Authentication route<br/>[route.ts]"]
  node_auth_service["Auth service<br/>[auth.ts]"]
  node_trpc_route["tRPC endpoint<br/>[route.ts]"]
  node_app_router["Application router<br/>[root.ts]"]
  node_storage_router["Storage procedures<br/>[storage.ts]"]
  node_database[("PostgreSQL database<br/>[index.ts]")]
  node_storage_service["Nebula storage client<br/>[storage.ts]"]
end

node_user(("Student"))
node_nebula["Nebula storage API"]

node_user -->|"searches courses"| node_home
node_user -->|"browses notes"| node_notes_pages
node_user -->|"creates note"| node_create_note
node_user -->|"signs in"| node_auth_page
node_user -->|"views profile"| node_profile
node_user -->|"manages account"| node_settings
node_user -->|"completes onboarding"| node_onboarding
node_user -->|"submits report"| node_report
node_user -->|"reviews reports"| node_admin
node_autocomplete_route -->|"re-exports"| node_autocomplete
node_courseautocomplete_route -->|"re-exports"| node_courseautocomplete
node_create_note -->|"renders"| node_note_form
node_note_form -->|"uses"| node_upload_hook
node_file_route -->|"re-exports"| node_file_api
node_auth_route -->|"dispatches"| node_auth_service
node_trpc_route -->|"dispatches"| node_app_router
node_storage_router -->|"checks file ownership"| node_database
node_storage_router -->|"requests upload URL"| node_storage_service
node_storage_router -->|"gets or deletes file"| node_storage_service
node_upload_hook -->|"requests upload URL"| node_storage_router
node_storage_service -->|"calls storage API"| node_nebula
node_upload_hook -->|"uploads file"| node_nebula

click node_home "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/pages/HomePage.tsx"
click node_searchquery "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/utils/SearchQuery.tsx"
click node_autocomplete "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/api/autocomplete.ts"
click node_courseautocomplete "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/api/courseNameAutocomplete.ts"
click node_autocomplete_route "https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/autocomplete/route.ts"
click node_courseautocomplete_route "https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/courseNameAutocomplete/route.ts"
click node_notes_pages "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/pages/NotesPage.tsx"
click node_create_note "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/pages/CreateNotePage.tsx"
click node_note_form "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/forms/CreateNoteForm.tsx"
click node_upload_hook "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/hooks/useUploadToUploadURL.ts"
click node_file_route "https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/files/%5Bid%5D/route.ts"
click node_file_api "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/api/file.ts"
click node_auth_page "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/AuthPage.tsx"
click node_auth_route "https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/auth/%5B...all%5D/route.ts"
click node_auth_service "https://github.com/utdnebula/utd-notebook/blob/develop/src/server/auth.ts"
click node_profile "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/ProfilePage.tsx"
click node_settings "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/SettingsPage.tsx"
click node_onboarding "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/GetStartedPage.tsx"
click node_report "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/moderation/pages/ReportPage.tsx"
click node_admin "https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/moderation/pages/AdminPage.tsx"
click node_trpc_route "https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/trpc/%5Btrpc%5D/route.ts"
click node_app_router "https://github.com/utdnebula/utd-notebook/blob/develop/src/server/api/root.ts"
click node_storage_router "https://github.com/utdnebula/utd-notebook/blob/develop/src/server/api/routers/storage.ts"
click node_database "https://github.com/utdnebula/utd-notebook/blob/develop/src/server/db/index.ts"
click node_storage_service "https://github.com/utdnebula/utd-notebook/blob/develop/src/server/storage.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_home,node_searchquery,node_autocomplete,node_courseautocomplete toneBlue
class node_notes_pages,node_create_note,node_note_form,node_upload_hook,node_file_api,node_nebula toneAmber
class node_auth_page,node_profile,node_settings,node_onboarding toneMint
class node_report,node_admin toneRose
class node_autocomplete_route,node_courseautocomplete_route,node_file_route,node_auth_route,node_auth_service,node_trpc_route,node_app_router,node_storage_router,node_database,node_storage_service,node_user toneIndigo
```

## Components

### Search and discovery

- [Course search](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/pages/HomePage.tsx): `src/systems/search/pages/HomePage.tsx`
- [Search query model](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/utils/SearchQuery.tsx): `src/systems/search/utils/SearchQuery.tsx`
- [Autocomplete API](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/api/autocomplete.ts): `src/systems/search/api/autocomplete.ts`
- [Course-name API](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/search/api/courseNameAutocomplete.ts): `src/systems/search/api/courseNameAutocomplete.ts`

### Notes

- [Notes pages](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/pages/NotesPage.tsx): `src/systems/notes/pages/NotesPage.tsx`
- [Create note](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/pages/CreateNotePage.tsx): `src/systems/notes/pages/CreateNotePage.tsx`
- [Note forms](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/forms/CreateNoteForm.tsx): `src/systems/notes/forms/CreateNoteForm.tsx`
- [File upload hook](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/hooks/useUploadToUploadURL.ts): `src/systems/notes/hooks/useUploadToUploadURL.ts`
- [Note file API](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/notes/api/file.ts): `src/systems/notes/api/file.ts`

### Accounts

- [Authentication page](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/AuthPage.tsx): `src/systems/account/pages/AuthPage.tsx`
- [Profiles](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/ProfilePage.tsx): `src/systems/account/pages/ProfilePage.tsx`
- [Account settings](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/SettingsPage.tsx): `src/systems/account/pages/SettingsPage.tsx`
- [Onboarding](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/account/pages/GetStartedPage.tsx): `src/systems/account/pages/GetStartedPage.tsx`

### Moderation

- [Report submission](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/moderation/pages/ReportPage.tsx): `src/systems/moderation/pages/ReportPage.tsx`
- [Admin review](https://github.com/utdnebula/utd-notebook/blob/develop/src/systems/moderation/pages/AdminPage.tsx): `src/systems/moderation/pages/AdminPage.tsx`

### API and persistence

- [Autocomplete route](https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/autocomplete/route.ts): `src/app/api/autocomplete/route.ts`
- [Course-name route](https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/courseNameAutocomplete/route.ts): `src/app/api/courseNameAutocomplete/route.ts`
- [File route](https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/files/%5Bid%5D/route.ts): `src/app/api/files/[id]/route.ts`
- [Authentication route](https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Auth service](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/auth.ts): `src/server/auth.ts`
- [tRPC endpoint](https://github.com/utdnebula/utd-notebook/blob/develop/src/app/api/trpc/%5Btrpc%5D/route.ts): `src/app/api/trpc/[trpc]/route.ts`
- [Application router](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/api/root.ts): `src/server/api/root.ts`
- [Storage procedures](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/api/routers/storage.ts): `src/server/api/routers/storage.ts`
- [PostgreSQL database](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/db/index.ts): `src/server/db/index.ts`
- [Nebula storage client](https://github.com/utdnebula/utd-notebook/blob/develop/src/server/storage.ts): `src/server/storage.ts`

### Other components

- **Student**
- **Nebula storage API**

## Connections

- Student → Course search: searches courses
- Student → Notes pages: browses notes
- Student → Create note: creates note
- Student → Authentication page: signs in
- Student → Profiles: views profile
- Student → Account settings: manages account
- Student → Onboarding: completes onboarding
- Student → Report submission: submits report
- Student → Admin review: reviews reports
- Autocomplete route → Autocomplete API: re-exports
- Course-name route → Course-name API: re-exports
- Create note → Note forms: renders
- Note forms → File upload hook: uses
- File route → Note file API: re-exports
- Authentication route → Auth service: dispatches
- tRPC endpoint → Application router: dispatches
- Storage procedures → PostgreSQL database: checks file ownership
- Storage procedures → Nebula storage client: requests upload URL
- Storage procedures → Nebula storage client: gets or deletes file
- File upload hook → Storage procedures: requests upload URL
- Nebula storage client → Nebula storage API: calls storage API
- File upload hook → Nebula storage API: uploads file
