# royceeealt/photobooth-website architecture

> Architecture diagram of the GitHub repository royceeealt/photobooth-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/royceeealt/photobooth-website
- Repository: https://github.com/royceeealt/photobooth-website

## Overview

This repository implements a browser-based photo-strip creator with account access, strip setup, avatar design, image capture, and export, plus an Express backend for authentication, item retrieval, and optional strip persistence. The frontend’s route definitions establish the available stages, but sampled evidence does not show the pages’ internal transitions or how export communicates with the backend. Strip storage is explicitly marked optional and its upload implementation is unfinished; those limits are reflected in the graph.

Main entry points: [`frontend/src/App.jsx`](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/App.jsx) (Route application), [`server/controllers/auth.controller.js`](https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/auth.controller.js) (Auth controller), [`server/controllers/strips.controller.js`](https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/strips.controller.js) (Strips controller), [`server/middleware/authGuard.js`](https://github.com/royceeealt/photobooth-website/blob/main/server/middleware/authGuard.js) (Auth guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web_flow["Web app flow"]
  node_app["Route application<br/>[App.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_strip_count["Strip setup<br/>[StripCount.jsx]"]
  node_avatar_design["Avatar design<br/>[AvatarDesign.jsx]"]
  node_capture["Image capture<br/>[ImageCapture.jsx]"]
  node_export["Strip export<br/>[Export.jsx]"]
end

subgraph group_web_state["Browser state and tools"]
  node_auth_store["Auth state<br/>[useAuthStore.js]"]
  node_session_store["Session state<br/>[useSessionStore.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_canvas_tools["Canvas utilities<br/>[canvasUtils.js]"]
  node_strip_assembler["Strip assembler<br/>[stripAssembler.js]"]
  node_item_catalog["Item catalog<br/>[itemCatalog.js]"]
  node_avatar_widget["Draggable avatar"]
  node_strip_preview["Strip preview<br/>[StripPreview.jsx]"]
end

subgraph group_http["Backend HTTP"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_item_routes["Item routes<br/>[items.routes.js]"]
  node_strip_routes["Strip routes<br/>[strips.routes.js]"]
end

subgraph group_backend_logic["Backend services"]
  node_auth_controller["Auth controller<br/>[auth.controller.js]"]
  node_items_controller["Items controller"]
  node_strips_controller["Strips controller"]
  node_auth_guard["Auth guard<br/>[authGuard.js]"]
  node_auth_service["Auth service<br/>[auth.service.js]"]
  node_error_handler["Error handler<br/>[errorHandler.js]"]
end

subgraph group_persistence["Data and storage"]
  node_user_model[("User records<br/>[User.js]")]
  node_item_model[("Item records<br/>[Item.js]")]
  node_strip_model[("Photo strips<br/>[PhotoStrip.js]")]
  node_db_config["Database config<br/>[db.js]"]
  node_storage_service["Storage service<br/>[storage.service.js]"]
  node_storage_config["Storage config<br/>[storage.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_strip_count
node_app -->|"routes to"| node_avatar_design
node_app -->|"routes to"| node_capture
node_app -->|"routes to"| node_export
node_auth_store -->|"requests"| node_api_client
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"guards"| node_auth_guard
node_item_routes -->|"dispatches"| node_items_controller
node_strip_routes -->|"dispatches"| node_strips_controller
node_strip_routes -->|"guards"| node_auth_guard
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"uses"| node_auth_service
node_auth_guard -->|"verifies token"| node_auth_service
node_items_controller -->|"reads"| node_item_model
node_strips_controller -->|"reads and writes"| node_strip_model
node_strips_controller -->|"uploads image"| node_storage_service
node_storage_service -->|"reads config"| node_storage_config

click node_app "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Home.jsx"
click node_login "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Login.jsx"
click node_signup "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Signup.jsx"
click node_strip_count "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/StripCount.jsx"
click node_avatar_design "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/AvatarDesign.jsx"
click node_capture "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/ImageCapture.jsx"
click node_export "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Export.jsx"
click node_auth_store "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/store/useAuthStore.js"
click node_session_store "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/store/useSessionStore.js"
click node_api_client "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/api.js"
click node_canvas_tools "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/canvasUtils.js"
click node_strip_assembler "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/stripAssembler.js"
click node_item_catalog "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/itemCatalog.js"
click node_avatar_widget "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/components/DraggableAvatar.jsx"
click node_strip_preview "https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/components/StripPreview.jsx"
click node_auth_routes "https://github.com/royceeealt/photobooth-website/blob/main/server/routes/auth.routes.js"
click node_item_routes "https://github.com/royceeealt/photobooth-website/blob/main/server/routes/items.routes.js"
click node_strip_routes "https://github.com/royceeealt/photobooth-website/blob/main/server/routes/strips.routes.js"
click node_auth_controller "https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/auth.controller.js"
click node_items_controller "https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/items.controller.js"
click node_strips_controller "https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/strips.controller.js"
click node_auth_guard "https://github.com/royceeealt/photobooth-website/blob/main/server/middleware/authGuard.js"
click node_auth_service "https://github.com/royceeealt/photobooth-website/blob/main/server/services/auth.service.js"
click node_error_handler "https://github.com/royceeealt/photobooth-website/blob/main/server/middleware/errorHandler.js"
click node_user_model "https://github.com/royceeealt/photobooth-website/blob/main/server/models/User.js"
click node_item_model "https://github.com/royceeealt/photobooth-website/blob/main/server/models/Item.js"
click node_strip_model "https://github.com/royceeealt/photobooth-website/blob/main/server/models/PhotoStrip.js"
click node_db_config "https://github.com/royceeealt/photobooth-website/blob/main/server/config/db.js"
click node_storage_service "https://github.com/royceeealt/photobooth-website/blob/main/server/services/storage.service.js"
click node_storage_config "https://github.com/royceeealt/photobooth-website/blob/main/server/config/storage.js"

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_home,node_login,node_signup,node_strip_count,node_avatar_design,node_capture,node_export toneBlue
class node_auth_store,node_session_store,node_api_client,node_canvas_tools,node_strip_assembler,node_item_catalog,node_avatar_widget,node_strip_preview toneAmber
class node_auth_routes,node_item_routes,node_strip_routes toneMint
class node_auth_controller,node_items_controller,node_strips_controller,node_auth_guard,node_auth_service,node_error_handler toneRose
class node_user_model,node_item_model,node_strip_model,node_db_config,node_storage_service,node_storage_config,node_visitor toneIndigo
```

## Components

### Web app flow

- [Route application](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Login](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Signup](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Signup.jsx): `frontend/src/pages/Signup.jsx`
- [Strip setup](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/StripCount.jsx): `frontend/src/pages/StripCount.jsx`
- [Avatar design](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/AvatarDesign.jsx): `frontend/src/pages/AvatarDesign.jsx`
- [Image capture](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/ImageCapture.jsx): `frontend/src/pages/ImageCapture.jsx`
- [Strip export](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/pages/Export.jsx): `frontend/src/pages/Export.jsx`

### Browser state and tools

- [Auth state](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/store/useAuthStore.js): `frontend/src/store/useAuthStore.js`
- [Session state](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/store/useSessionStore.js): `frontend/src/store/useSessionStore.js`
- [API client](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Canvas utilities](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/canvasUtils.js): `frontend/src/lib/canvasUtils.js`
- [Strip assembler](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/stripAssembler.js): `frontend/src/lib/stripAssembler.js`
- [Item catalog](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/lib/itemCatalog.js): `frontend/src/lib/itemCatalog.js`
- [Draggable avatar](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/components/DraggableAvatar.jsx): `frontend/src/components/DraggableAvatar.jsx`
- [Strip preview](https://github.com/royceeealt/photobooth-website/blob/main/frontend/src/components/StripPreview.jsx): `frontend/src/components/StripPreview.jsx`

### Backend HTTP

- [Auth routes](https://github.com/royceeealt/photobooth-website/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Item routes](https://github.com/royceeealt/photobooth-website/blob/main/server/routes/items.routes.js): `server/routes/items.routes.js`
- [Strip routes](https://github.com/royceeealt/photobooth-website/blob/main/server/routes/strips.routes.js): `server/routes/strips.routes.js`

### Backend services

- [Auth controller](https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Items controller](https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/items.controller.js): `server/controllers/items.controller.js`
- [Strips controller](https://github.com/royceeealt/photobooth-website/blob/main/server/controllers/strips.controller.js): `server/controllers/strips.controller.js`
- [Auth guard](https://github.com/royceeealt/photobooth-website/blob/main/server/middleware/authGuard.js): `server/middleware/authGuard.js`
- [Auth service](https://github.com/royceeealt/photobooth-website/blob/main/server/services/auth.service.js): `server/services/auth.service.js`
- [Error handler](https://github.com/royceeealt/photobooth-website/blob/main/server/middleware/errorHandler.js): `server/middleware/errorHandler.js`

### Data and storage

- [User records](https://github.com/royceeealt/photobooth-website/blob/main/server/models/User.js): `server/models/User.js`
- [Item records](https://github.com/royceeealt/photobooth-website/blob/main/server/models/Item.js): `server/models/Item.js`
- [Photo strips](https://github.com/royceeealt/photobooth-website/blob/main/server/models/PhotoStrip.js): `server/models/PhotoStrip.js`
- [Database config](https://github.com/royceeealt/photobooth-website/blob/main/server/config/db.js): `server/config/db.js`
- [Storage service](https://github.com/royceeealt/photobooth-website/blob/main/server/services/storage.service.js): `server/services/storage.service.js`
- [Storage config](https://github.com/royceeealt/photobooth-website/blob/main/server/config/storage.js): `server/config/storage.js`

### Other components

- **Visitor**

## Connections

- Visitor → Route application: opens
- Route application → Home: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Login: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Signup: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Strip setup: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Avatar design: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Image capture: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Strip export: routes to (evidence: `frontend/src/App.jsx`)
- Auth state → API client: requests (evidence: `frontend/src/store/useAuthStore.js`)
- Auth routes → Auth controller: dispatches (evidence: `server/routes/auth.routes.js`)
- Auth routes → Auth guard: guards (evidence: `server/routes/auth.routes.js`)
- Item routes → Items controller: dispatches (evidence: `server/routes/items.routes.js`)
- Strip routes → Strips controller: dispatches (evidence: `server/routes/strips.routes.js`)
- Strip routes → Auth guard: guards (evidence: `server/routes/strips.routes.js`)
- Auth controller → User records: reads and writes (evidence: `server/controllers/auth.controller.js`)
- Auth controller → Auth service: uses (evidence: `server/controllers/auth.controller.js`)
- Auth guard → Auth service: verifies token (evidence: `server/middleware/authGuard.js`)
- Items controller → Item records: reads (evidence: `server/controllers/items.controller.js`)
- Strips controller → Photo strips: reads and writes (evidence: `server/controllers/strips.controller.js`)
- Strips controller → Storage service: uploads image (evidence: `server/controllers/strips.controller.js`)
- Storage service → Storage config: reads config (evidence: `server/services/storage.service.js`)
