# ethanchenhyland/fall2026-codingchallenge architecture

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

- Interactive diagram: https://gitdiagram.com/ethanchenhyland/fall2026-codingchallenge
- Repository: https://github.com/ethanchenhyland/fall2026-codingchallenge

## Overview

Mosaic is a social visual-discovery application. A typical user searches and previews images, saves pins into organized collections, then shares collections or discusses pins with other users. The map includes the documented collection, recommendation, social, messaging, and sharing branches. Some backend route implementations were not sampled, so their internal calls are not detailed; their documented capabilities and paths are represented without inventing wiring.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/App.tsx) (App shell and routes), [`backend/src/app.ts`](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/app.ts) (HTTP application), [`frontend/src/api.ts`](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/api.ts) (REST client), [`backend/src/routes/search.ts`](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/search.ts) (Search and recommendations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_webapp["App shell and routes<br/>[App.tsx]"]
  node_authui["Sign in and register<br/>[AuthPage.tsx]"]
  node_discover["Discover search<br/>[DiscoverPage.tsx]"]
  node_explore["Explore feed<br/>[ExplorePage.tsx]"]
  node_collectionsui["Collection workspace<br/>[CollectionPage.tsx]"]
  node_collectionlist["Collections and smart views"]
  node_socialui["Profiles and pins<br/>[ProfilePage.tsx]"]
  node_sharedui["Shared presentations"]
  node_messagesui["Direct messages<br/>[MessagesPage.tsx]"]
  node_apiclient["REST client<br/>[api.ts]"]
end

subgraph group_api["Application API"]
  node_appserver["HTTP application<br/>[app.ts]"]
  node_authroutes["Account and sessions<br/>[auth.ts]"]
  node_searchroutes["Search and recommendations<br/>[search.ts]"]
  node_collectionroutes["Collection operations<br/>[collections.ts]"]
  node_socialroutes["Social interactions<br/>[pins.ts]"]
  node_profileroutes["Profiles and follows<br/>[profiles.ts]"]
  node_shareroutes["Public sharing<br/>[shared.ts]"]
  node_messageroutes["Messaging<br/>[messages.ts]"]
  node_airoutes["AI phrase suggestions<br/>[aiDiscovery.ts]"]
  node_catalog["Fallback image catalog<br/>[catalog.ts]"]
end

subgraph group_state["Persistence and media"]
  node_database[("SQLite database<br/>[db.ts]")]
  node_media["Persisted provider media<br/>[media.ts]"]
end

node_user(("User"))
node_pixabay["Pixabay provider"]
node_wikimedia["Wikimedia Commons"]
node_openrouter["OpenRouter AI"]
node_resend["Resend email"]

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_discover
node_webapp -->|"routes to"| node_explore
node_webapp -->|"routes to"| node_collectionlist
node_webapp -->|"routes to"| node_collectionsui
node_webapp -->|"routes to"| node_socialui
node_webapp -->|"routes to"| node_sharedui
node_webapp -->|"routes to"| node_messagesui
node_authui -->|"requests auth"| node_apiclient
node_discover -->|"requests discovery"| node_apiclient
node_explore -->|"requests feeds"| node_apiclient
node_collectionlist -->|"requests collections"| node_apiclient
node_collectionsui -->|"saves and organizes"| node_apiclient
node_socialui -->|"requests social actions"| node_apiclient
node_sharedui -->|"loads shared views"| node_apiclient
node_messagesui -->|"sends messages"| node_apiclient
node_apiclient -->|"calls API"| node_appserver
node_appserver -->|"dispatches auth"| node_authroutes
node_appserver -->|"dispatches search"| node_searchroutes
node_appserver -->|"dispatches collections"| node_collectionroutes
node_appserver -->|"dispatches pin actions"| node_socialroutes
node_appserver -->|"dispatches profiles"| node_profileroutes
node_appserver -->|"dispatches sharing"| node_shareroutes
node_appserver -->|"dispatches messages"| node_messageroutes
node_authroutes -->|"reads and writes"| node_database
node_searchroutes -->|"reads and caches"| node_database
node_collectionroutes -->|"stores collections"| node_database
node_socialroutes -->|"stores interactions"| node_database
node_profileroutes -->|"reads and writes"| node_database
node_shareroutes -->|"reads shared data"| node_database
node_messageroutes -->|"stores messages"| node_database
node_searchroutes -->|"uses fallback"| node_catalog
node_searchroutes -->|"requests phrases"| node_airoutes
node_searchroutes -.->|"searches images"| node_pixabay
node_searchroutes -.->|"searches images"| node_wikimedia
node_airoutes -.->|"requests suggestions"| node_openrouter
node_authroutes -.->|"sends verification"| node_resend
node_searchroutes -->|"persists provider images"| node_media

click node_webapp "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/AuthPage.tsx"
click node_discover "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/DiscoverPage.tsx"
click node_explore "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/ExplorePage.tsx"
click node_collectionsui "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/CollectionPage.tsx"
click node_collectionlist "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/CollectionsPage.tsx"
click node_socialui "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/ProfilePage.tsx"
click node_sharedui "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/SharedPresentationPage.tsx"
click node_messagesui "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/MessagesPage.tsx"
click node_apiclient "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/api.ts"
click node_appserver "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/app.ts"
click node_authroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/auth.ts"
click node_searchroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/search.ts"
click node_collectionroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/collections.ts"
click node_socialroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/pins.ts"
click node_profileroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/profiles.ts"
click node_shareroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/shared.ts"
click node_messageroutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/messages.ts"
click node_airoutes "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/lib/aiDiscovery.ts"
click node_database "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/db.ts"
click node_media "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/lib/media.ts"
click node_catalog "https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/catalog.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_webapp,node_authui,node_discover,node_explore,node_collectionsui,node_collectionlist,node_socialui,node_sharedui,node_messagesui,node_apiclient,node_user toneBlue
class node_appserver,node_authroutes,node_searchroutes,node_collectionroutes,node_socialroutes,node_profileroutes,node_shareroutes,node_messageroutes,node_airoutes,node_catalog toneAmber
class node_database,node_media,node_openrouter toneMint
class node_pixabay,node_wikimedia,node_resend toneIndigo
```

## Components

### Web experience

- [App shell and routes](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign in and register](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/AuthPage.tsx): `frontend/src/pages/AuthPage.tsx`
- [Discover search](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/DiscoverPage.tsx): `frontend/src/pages/DiscoverPage.tsx`
- [Explore feed](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/ExplorePage.tsx): `frontend/src/pages/ExplorePage.tsx`
- [Collection workspace](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/CollectionPage.tsx): `frontend/src/pages/CollectionPage.tsx`
- [Collections and smart views](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/CollectionsPage.tsx): `frontend/src/pages/CollectionsPage.tsx`
- [Profiles and pins](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/ProfilePage.tsx): `frontend/src/pages/ProfilePage.tsx`
- [Shared presentations](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/SharedPresentationPage.tsx): `frontend/src/pages/SharedPresentationPage.tsx`
- [Direct messages](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/pages/MessagesPage.tsx): `frontend/src/pages/MessagesPage.tsx`
- [REST client](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Application API

- [HTTP application](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Account and sessions](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [Search and recommendations](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/search.ts): `backend/src/routes/search.ts`
- [Collection operations](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/collections.ts): `backend/src/routes/collections.ts`
- [Social interactions](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/pins.ts): `backend/src/routes/pins.ts`
- [Profiles and follows](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/profiles.ts): `backend/src/routes/profiles.ts`
- [Public sharing](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/shared.ts): `backend/src/routes/shared.ts`
- [Messaging](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/routes/messages.ts): `backend/src/routes/messages.ts`
- [AI phrase suggestions](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/lib/aiDiscovery.ts): `backend/src/lib/aiDiscovery.ts`
- [Fallback image catalog](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/catalog.ts): `backend/src/catalog.ts`

### Persistence and media

- [SQLite database](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/db.ts): `backend/src/db.ts`
- [Persisted provider media](https://github.com/ethanchenhyland/fall2026-codingchallenge/blob/main/backend/src/lib/media.ts): `backend/src/lib/media.ts`

### Other components

- **User**
- **Pixabay provider**
- **Wikimedia Commons**
- **OpenRouter AI**
- **Resend email**

## Connections

- User → App shell and routes: uses
- App shell and routes → Sign in and register: routes to
- App shell and routes → Discover search: routes to
- App shell and routes → Explore feed: routes to
- App shell and routes → Collections and smart views: routes to
- App shell and routes → Collection workspace: routes to
- App shell and routes → Profiles and pins: routes to
- App shell and routes → Shared presentations: routes to
- App shell and routes → Direct messages: routes to
- Sign in and register → REST client: requests auth
- Discover search → REST client: requests discovery
- Explore feed → REST client: requests feeds
- Collections and smart views → REST client: requests collections
- Collection workspace → REST client: saves and organizes
- Profiles and pins → REST client: requests social actions
- Shared presentations → REST client: loads shared views
- Direct messages → REST client: sends messages
- REST client → HTTP application: calls API
- HTTP application → Account and sessions: dispatches auth
- HTTP application → Search and recommendations: dispatches search
- HTTP application → Collection operations: dispatches collections
- HTTP application → Social interactions: dispatches pin actions
- HTTP application → Profiles and follows: dispatches profiles
- HTTP application → Public sharing: dispatches sharing
- HTTP application → Messaging: dispatches messages
- Account and sessions → SQLite database: reads and writes
- Search and recommendations → SQLite database: reads and caches
- Collection operations → SQLite database: stores collections
- Social interactions → SQLite database: stores interactions
- Profiles and follows → SQLite database: reads and writes
- Public sharing → SQLite database: reads shared data
- Messaging → SQLite database: stores messages
- Search and recommendations → Fallback image catalog: uses fallback
- Search and recommendations → AI phrase suggestions: requests phrases
- Search and recommendations → Pixabay provider: searches images
- Search and recommendations → Wikimedia Commons: searches images
- AI phrase suggestions → OpenRouter AI: requests suggestions
- Account and sessions → Resend email: sends verification
- Search and recommendations → Persisted provider media: persists provider images
