# rachelalba-tech/stsweng_smartalbum architecture

> Architecture diagram of the GitHub repository rachelalba-tech/stsweng_smartalbum, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rachelalba-tech/stsweng_smartalbum
- Repository: https://github.com/rachelalba-tech/stsweng_smartalbum

## Overview

Smart Album is a browser photo and album manager backed by a Node API. The main workflow is an authenticated user navigating albums, managing photos and album membership, and optionally building and exporting collages; account signup/login gates that workflow. Analysis capabilities include duplicate detection, similarity, photo quality, and color grading. Edges reflect calls shown in excerpts or explicit README statements; unsampled routes and modules are retained as capability nodes where supported, without guessing their internal wiring.

Main entry points: [`frontend/src/app/App.tsx`](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/App.tsx) (Application shell), [`server/src/http.ts`](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/http.ts) (HTTP API and handlers), [`frontend/src/app/api.ts`](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/api.ts) (API client), [`frontend/src/app/PhotoGallery.tsx`](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/PhotoGallery.tsx) (Photo gallery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser application"]
  node_app["Application shell<br/>[App.tsx]"]
  node_routing["Hash routing<br/>[route.ts]"]
  node_auth["Sign in and signup<br/>[LoginPage.tsx]"]
  node_signup["Signup validation"]
  node_api["API client<br/>[api.ts]"]
  node_photoapi["Photo API helpers<br/>[photoApi.ts]"]
end

subgraph group_album["Album and photo management"]
  node_albummanager["Album manager<br/>[AlbumManager.tsx]"]
  node_albumpage["Album details<br/>[AlbumPage.tsx]"]
  node_gallery["Photo gallery<br/>[PhotoGallery.tsx]"]
  node_upload["Photo upload<br/>[PhotoUpload.tsx]"]
end

subgraph group_analysis["Photo analysis"]
  node_duplicate["Duplicate detection"]
  node_similar["Photo similarity<br/>[SimilarPhotos.tsx]"]
  node_similarity["Similarity engine<br/>[photoSimilarity.ts]"]
  node_quality["Photo quality analysis<br/>[photoQuality.ts]"]
  node_lowquality["Low quality photos"]
  node_grading["Color grading<br/>[colorGrading.ts]"]
end

subgraph group_collage["Collage creation"]
  node_collageeditor["Collage editor<br/>[AlbumCollage.tsx]"]
  node_templates["Collage templates"]
  node_collagestoreclient["Collage state and types<br/>[collageStore.ts]"]
  node_collagehook["Saved collage workflow<br/>[useCollages.ts]"]
  node_collageapi["Collage API client<br/>[collageApi.ts]"]
  node_preview["Preview and export<br/>[AlbumPreview.tsx]"]
  node_export["Collage export<br/>[collageExport.ts]"]
end

subgraph group_backend["API and persistence"]
  node_serverentry["API startup<br/>[server.ts]"]
  node_http["HTTP API and handlers<br/>[http.ts]"]
  node_albumdomain["Album operations<br/>[albums.ts]"]
  node_photodomain["Photo operations<br/>[photos.ts]"]
  node_duplicateserver["Upload duplicate support<br/>[duplicates.ts]"]
  node_photodetails["Photo details validation<br/>[photo-details.ts]"]
  node_users["Account operations<br/>[users.ts]"]
  node_collageserver["Collage operations<br/>[collages.ts]"]
  node_albumdata[("Album JSON store<br/>[store.ts]")]
  node_photodata[("Photo and upload store<br/>[photo-store.ts]")]
end

node_user(("Account user"))

node_user -->|"uses"| node_app
node_app -->|"resolves routes"| node_routing
node_app -->|"renders"| node_auth
node_auth -->|"validates signup"| node_signup
node_app -->|"renders"| node_albummanager
node_app -->|"renders"| node_albumpage
node_albumpage -->|"renders"| node_gallery
node_app -->|"renders"| node_upload
node_app -->|"fetches data"| node_api
node_albummanager -.->|"manages albums"| node_api
node_albumpage -->|"manages photos"| node_api
node_gallery -->|"updates photos"| node_api
node_upload -->|"uploads photos"| node_api
node_app -->|"renders"| node_duplicate
node_app -->|"renders"| node_lowquality
node_app -->|"renders"| node_similar
node_similar -->|"uses"| node_photoapi
node_similar -->|"analyzes"| node_similarity
node_lowquality -->|"uses"| node_photoapi
node_lowquality -->|"analyzes"| node_quality
node_gallery -->|"analyzes"| node_quality
node_gallery -->|"applies grading"| node_grading
node_app -->|"loads collages"| node_collagehook
node_albummanager -->|"opens editor"| node_collageeditor
node_collageeditor -->|"selects layouts"| node_templates
node_collageeditor -->|"uses types"| node_collagestoreclient
node_collagehook -->|"persists collages"| node_collageapi
node_collageapi -->|"uses types"| node_collagestoreclient
node_app -->|"renders"| node_preview
node_preview -->|"resolves layouts"| node_collagestoreclient
node_preview -->|"renders and downloads"| node_export
node_api -.->|"requests API"| node_http
node_serverentry -->|"creates server"| node_http
node_serverentry -->|"loads and saves"| node_albumdata
node_serverentry -->|"loads and saves"| node_photodata
node_http -->|"calls operations"| node_albumdomain
node_http -->|"resolves uploads"| node_duplicateserver
node_http -->|"validates patches"| node_photodetails
node_http -->|"validates signup"| node_users
node_http -->|"validates collages"| node_collageserver
node_http -.->|"reads and writes"| node_photodata
node_http -.->|"reads and writes"| node_albumdata
node_http -->|"finds duplicates"| node_duplicateserver

click node_app "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/App.tsx"
click node_routing "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/route.ts"
click node_auth "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/LoginPage.tsx"
click node_signup "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/signUpValidation.ts"
click node_albummanager "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumManager.tsx"
click node_albumpage "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumPage.tsx"
click node_gallery "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/PhotoGallery.tsx"
click node_upload "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/PhotoUpload.tsx"
click node_api "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/api.ts"
click node_photoapi "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoApi.ts"
click node_duplicate "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/DuplicatePhotos.tsx"
click node_similar "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/SimilarPhotos.tsx"
click node_similarity "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoSimilarity.ts"
click node_quality "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoQuality.ts"
click node_lowquality "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/LowQualityPhotos.tsx"
click node_grading "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/colorGrading.ts"
click node_collageeditor "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumCollage.tsx"
click node_templates "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageTemplates.ts"
click node_collagestoreclient "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageStore.ts"
click node_collagehook "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/useCollages.ts"
click node_collageapi "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageApi.ts"
click node_preview "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumPreview.tsx"
click node_export "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageExport.ts"
click node_serverentry "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/server.ts"
click node_http "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/http.ts"
click node_albumdomain "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/albums.ts"
click node_photodomain "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photos.ts"
click node_duplicateserver "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/duplicates.ts"
click node_photodetails "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photo-details.ts"
click node_users "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/users.ts"
click node_collageserver "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/collages.ts"
click node_albumdata "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/store.ts"
click node_photodata "https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photo-store.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_app,node_routing,node_auth,node_signup,node_api,node_photoapi,node_user toneBlue
class node_albummanager,node_albumpage,node_gallery,node_upload toneAmber
class node_duplicate,node_similar,node_similarity,node_quality,node_lowquality,node_grading toneMint
class node_collageeditor,node_templates,node_collagestoreclient,node_collagehook,node_collageapi,node_preview,node_export toneRose
class node_serverentry,node_http,node_albumdomain,node_photodomain,node_duplicateserver,node_photodetails,node_users,node_collageserver,node_albumdata,node_photodata toneIndigo
```

## Components

### Browser application

- [Application shell](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Hash routing](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/route.ts): `frontend/src/app/route.ts`
- [Sign in and signup](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/LoginPage.tsx): `frontend/src/app/LoginPage.tsx`
- [Signup validation](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/signUpValidation.ts): `frontend/src/app/signUpValidation.ts`
- [API client](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/api.ts): `frontend/src/app/api.ts`
- [Photo API helpers](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoApi.ts): `frontend/src/app/photoApi.ts`

### Album and photo management

- [Album manager](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumManager.tsx): `frontend/src/app/AlbumManager.tsx`
- [Album details](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumPage.tsx): `frontend/src/app/AlbumPage.tsx`
- [Photo gallery](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/PhotoGallery.tsx): `frontend/src/app/PhotoGallery.tsx`
- [Photo upload](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/PhotoUpload.tsx): `frontend/src/app/PhotoUpload.tsx`

### Photo analysis

- [Duplicate detection](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/DuplicatePhotos.tsx): `frontend/src/app/DuplicatePhotos.tsx`
- [Photo similarity](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/SimilarPhotos.tsx): `frontend/src/app/SimilarPhotos.tsx`
- [Similarity engine](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoSimilarity.ts): `frontend/src/app/photoSimilarity.ts`
- [Photo quality analysis](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/photoQuality.ts): `frontend/src/app/photoQuality.ts`
- [Low quality photos](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/LowQualityPhotos.tsx): `frontend/src/app/LowQualityPhotos.tsx`
- [Color grading](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/colorGrading.ts): `frontend/src/app/colorGrading.ts`

### Collage creation

- [Collage editor](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumCollage.tsx): `frontend/src/app/AlbumCollage.tsx`
- [Collage templates](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageTemplates.ts): `frontend/src/app/collageTemplates.ts`
- [Collage state and types](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageStore.ts): `frontend/src/app/collageStore.ts`
- [Saved collage workflow](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/useCollages.ts): `frontend/src/app/useCollages.ts`
- [Collage API client](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageApi.ts): `frontend/src/app/collageApi.ts`
- [Preview and export](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/AlbumPreview.tsx): `frontend/src/app/AlbumPreview.tsx`
- [Collage export](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/frontend/src/app/collageExport.ts): `frontend/src/app/collageExport.ts`

### API and persistence

- [API startup](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/server.ts): `server/src/server.ts`
- [HTTP API and handlers](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/http.ts): `server/src/http.ts`
- [Album operations](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/albums.ts): `server/src/albums.ts`
- [Photo operations](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photos.ts): `server/src/photos.ts`
- [Upload duplicate support](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/duplicates.ts): `server/src/duplicates.ts`
- [Photo details validation](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photo-details.ts): `server/src/photo-details.ts`
- [Account operations](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/users.ts): `server/src/users.ts`
- [Collage operations](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/collages.ts): `server/src/collages.ts`
- [Album JSON store](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/store.ts): `server/src/store.ts`
- [Photo and upload store](https://github.com/rachelalba-tech/stsweng_smartalbum/blob/main/server/src/photo-store.ts): `server/src/photo-store.ts`

### Other components

- **Account user**

## Connections

- Account user → Application shell: uses
- Application shell → Hash routing: resolves routes (evidence: `frontend/src/app/App.tsx`)
- Application shell → Sign in and signup: renders (evidence: `frontend/src/app/App.tsx`)
- Sign in and signup → Signup validation: validates signup (evidence: `frontend/src/app/LoginPage.tsx`)
- Application shell → Album manager: renders (evidence: `frontend/src/app/App.tsx`)
- Application shell → Album details: renders (evidence: `frontend/src/app/App.tsx`)
- Album details → Photo gallery: renders (evidence: `frontend/src/app/AlbumPage.tsx`)
- Application shell → Photo upload: renders (evidence: `frontend/src/app/App.tsx`)
- Application shell → API client: fetches data (evidence: `frontend/src/app/App.tsx`)
- Album manager → API client: manages albums
- Album details → API client: manages photos (evidence: `frontend/src/app/AlbumPage.tsx`)
- Photo gallery → API client: updates photos (evidence: `frontend/src/app/PhotoGallery.tsx`)
- Photo upload → API client: uploads photos (evidence: `frontend/src/app/PhotoUpload.tsx`)
- Application shell → Duplicate detection: renders (evidence: `frontend/src/app/App.tsx`)
- Application shell → Low quality photos: renders (evidence: `frontend/src/app/App.tsx`)
- Application shell → Photo similarity: renders (evidence: `frontend/src/app/App.tsx`)
- Photo similarity → Photo API helpers: uses (evidence: `frontend/src/app/SimilarPhotos.tsx`)
- Photo similarity → Similarity engine: analyzes (evidence: `frontend/src/app/SimilarPhotos.tsx`)
- Low quality photos → Photo API helpers: uses (evidence: `frontend/src/app/LowQualityPhotos.tsx`)
- Low quality photos → Photo quality analysis: analyzes (evidence: `frontend/src/app/LowQualityPhotos.tsx`)
- Photo gallery → Photo quality analysis: analyzes (evidence: `frontend/src/app/PhotoGallery.tsx`)
- Photo gallery → Color grading: applies grading (evidence: `frontend/src/app/PhotoGallery.tsx`)
- Application shell → Saved collage workflow: loads collages (evidence: `frontend/src/app/App.tsx`)
- Album manager → Collage editor: opens editor (evidence: `frontend/src/app/AlbumManager.tsx`)
- Collage editor → Collage templates: selects layouts (evidence: `frontend/src/app/AlbumCollage.tsx`)
- Collage editor → Collage state and types: uses types (evidence: `frontend/src/app/AlbumCollage.tsx`)
- Saved collage workflow → Collage API client: persists collages (evidence: `frontend/src/app/useCollages.ts`)
- Collage API client → Collage state and types: uses types (evidence: `frontend/src/app/collageApi.ts`)
- Application shell → Preview and export: renders (evidence: `frontend/src/app/App.tsx`)
- Preview and export → Collage state and types: resolves layouts (evidence: `frontend/src/app/AlbumPreview.tsx`)
- Preview and export → Collage export: renders and downloads (evidence: `frontend/src/app/AlbumPreview.tsx`)
- API client → HTTP API and handlers: requests API
- API startup → HTTP API and handlers: creates server (evidence: `server/src/server.ts`)
- API startup → Album JSON store: loads and saves (evidence: `server/src/server.ts`)
- API startup → Photo and upload store: loads and saves (evidence: `server/src/server.ts`)
- HTTP API and handlers → Album operations: calls operations (evidence: `server/src/http.ts`)
- HTTP API and handlers → Upload duplicate support: resolves uploads (evidence: `server/src/http.ts`)
- HTTP API and handlers → Photo details validation: validates patches (evidence: `server/src/http.ts`)
- HTTP API and handlers → Account operations: validates signup (evidence: `server/src/http.ts`)
- HTTP API and handlers → Collage operations: validates collages (evidence: `server/src/http.ts`)
- HTTP API and handlers → Photo and upload store: reads and writes
- HTTP API and handlers → Album JSON store: reads and writes
- HTTP API and handlers → Upload duplicate support: finds duplicates (evidence: `server/src/http.ts`)
