# rakeshdintakurthi/photostudio architecture

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

- Interactive diagram: https://gitdiagram.com/rakeshdintakurthi/photostudio
- Repository: https://github.com/rakeshdintakurthi/photostudio

## Overview

PhotoStudio is a regional photography-gallery platform with public event discovery, customer accounts and downloads, passcode-protected client albums, and a studio administration console. Visitors search and browse event galleries, view photos, and download individually or as ZIPs; customers can save favorites and access shared albums. Staff manage events, uploads, private-gallery access, and analytics. The frontend’s sampled services persist data in browser local storage; the README describes Workers, D1, and R2, but the sampled worker source does not establish how those services connect.

Main entry points: [`src/App.tsx`](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/App.tsx) (Public Routes), [`src/pages/customer/CustomerAccountPage.tsx`](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/customer/CustomerAccountPage.tsx) (Customer Account), [`src/pages/public/HomePage.tsx`](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/HomePage.tsx) (Home and Search), [`src/pages/public/EventDetailPage.tsx`](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/EventDetailPage.tsx) (Event Detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Public Discovery"]
  node_public_site["Public Routes<br/>[App.tsx]"]
  node_home["Home and Search<br/>[HomePage.tsx]"]
  node_discovery_pages["Event Discovery"]
  node_college_pages["College Events"]
end

subgraph group_gallery["Gallery Experience"]
  node_event_detail["Event Detail"]
  node_private_gallery["Private Gallery Access"]
  node_lightbox["Photo Lightbox<br/>[Lightbox.tsx]"]
  node_downloads["Photo and ZIP Downloads<br/>[zipDownloader.ts]"]
end

subgraph group_customer["Customer Accounts"]
  node_customer_routes["Customer Routes"]
  node_customer_account["Customer Account"]
end

subgraph group_admin["Studio Administration"]
  node_admin_routes["Admin Routes<br/>[App.tsx]"]
  node_admin_overview["Dashboard and Analytics"]
  node_admin_events["Event Management"]
  node_admin_colleges["College Management"]
  node_admin_upload["Photo Upload"]
  node_admin_private["Private Gallery Admin"]
end

subgraph group_core["Services and State"]
  node_customer_state["Customer State<br/>[customerStore.ts]"]
  node_admin_auth["Admin Authentication<br/>[authStore.ts]"]
  node_events[("Event Service<br/>[eventService.ts]")]
  node_colleges[("College Service<br/>[collegeService.ts]")]
  node_photos[("Photo Service<br/>[photoService.ts]")]
  node_private_service[("Private Gallery Service")]
  node_analytics[("Analytics Service")]
  node_mock_data["Seed Data<br/>[mockData.ts]"]
  node_worker["Worker Backend<br/>[worker.ts]"]
end

node_visitor(("Visitor"))
node_d1[("Cloudflare D1")]
node_r2[("Cloudflare R2")]

node_visitor -->|"opens"| node_public_site
node_public_site -->|"routes to"| node_home
node_public_site -->|"routes to"| node_discovery_pages
node_public_site -->|"routes to"| node_college_pages
node_public_site -->|"routes to"| node_event_detail
node_public_site -->|"routes to"| node_private_gallery
node_home -->|"loads events"| node_events
node_home -->|"loads colleges"| node_colleges
node_home -->|"links to"| node_event_detail
node_event_detail -.->|"loads photos"| node_photos
node_event_detail -.->|"opens viewer"| node_lightbox
node_lightbox -->|"downloads photo"| node_downloads
node_visitor -.->|"registers or signs in"| node_customer_routes
node_customer_routes -.->|"opens account"| node_customer_account
node_customer_account -->|"reads account state"| node_customer_state
node_customer_account -->|"loads favorites"| node_photos
node_customer_account -->|"loads shared galleries"| node_private_service
node_customer_account -->|"downloads album"| node_downloads
node_visitor -.->|"enters admin portal"| node_admin_routes
node_admin_routes -->|"routes to dashboard"| node_admin_overview
node_admin_overview -->|"loads metrics"| node_analytics
node_admin_overview -->|"loads recent events"| node_events
node_admin_routes -->|"routes to events"| node_admin_events
node_admin_routes -.->|"guards access"| node_admin_auth
node_admin_events -->|"manages events"| node_events
node_admin_colleges -.->|"manages colleges"| node_colleges
node_admin_upload -.->|"uploads photos"| node_photos
node_admin_private -.->|"manages access"| node_private_service
node_private_gallery -.->|"validates passcode"| node_private_service
node_events -->|"loads seed events"| node_mock_data
node_private_service -->|"loads seed access"| node_mock_data
node_worker -.->|"uses database"| node_d1
node_worker -.->|"uses object storage"| node_r2

click node_public_site "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/App.tsx"
click node_home "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/HomePage.tsx"
click node_discovery_pages "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/DiscoverEventsPage.tsx"
click node_college_pages "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/CollegeEventsPage.tsx"
click node_event_detail "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/EventDetailPage.tsx"
click node_private_gallery "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/PrivateGalleryPage.tsx"
click node_lightbox "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/components/common/Lightbox.tsx"
click node_downloads "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/utils/zipDownloader.ts"
click node_customer_routes "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/customer/CustomerLoginPage.tsx"
click node_customer_account "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/customer/CustomerAccountPage.tsx"
click node_customer_state "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/store/customerStore.ts"
click node_admin_routes "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/App.tsx"
click node_admin_overview "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminOverviewPage.tsx"
click node_admin_events "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminEventsPage.tsx"
click node_admin_colleges "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminCollegesPage.tsx"
click node_admin_upload "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminUploadPage.tsx"
click node_admin_private "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminPrivateGalleriesPage.tsx"
click node_admin_auth "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/store/authStore.ts"
click node_events "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/eventService.ts"
click node_colleges "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/collegeService.ts"
click node_photos "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/photoService.ts"
click node_private_service "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/privateGalleryService.ts"
click node_analytics "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/analyticsService.ts"
click node_mock_data "https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/mockData.ts"
click node_worker "https://github.com/rakeshdintakurthi/photostudio/blob/main/backend/worker.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_public_site,node_home,node_discovery_pages,node_college_pages toneBlue
class node_event_detail,node_private_gallery,node_lightbox,node_downloads,node_d1,node_r2 toneAmber
class node_customer_routes,node_customer_account toneMint
class node_admin_routes,node_admin_overview,node_admin_events,node_admin_colleges,node_admin_upload,node_admin_private toneRose
class node_customer_state,node_admin_auth,node_events,node_colleges,node_photos,node_private_service,node_analytics,node_mock_data,node_worker,node_visitor toneIndigo
```

## Components

### Public Discovery

- [Public Routes](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/App.tsx): `src/App.tsx`
- [Home and Search](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/HomePage.tsx): `src/pages/public/HomePage.tsx`
- [Event Discovery](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/DiscoverEventsPage.tsx): `src/pages/public/DiscoverEventsPage.tsx`
- [College Events](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/CollegeEventsPage.tsx): `src/pages/public/CollegeEventsPage.tsx`

### Gallery Experience

- [Event Detail](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/EventDetailPage.tsx): `src/pages/public/EventDetailPage.tsx`
- [Private Gallery Access](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/public/PrivateGalleryPage.tsx): `src/pages/public/PrivateGalleryPage.tsx`
- [Photo Lightbox](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/components/common/Lightbox.tsx): `src/components/common/Lightbox.tsx`
- [Photo and ZIP Downloads](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/utils/zipDownloader.ts): `src/utils/zipDownloader.ts`

### Customer Accounts

- [Customer Routes](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/customer/CustomerLoginPage.tsx): `src/pages/customer/CustomerLoginPage.tsx`
- [Customer Account](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/customer/CustomerAccountPage.tsx): `src/pages/customer/CustomerAccountPage.tsx`

### Studio Administration

- [Admin Routes](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard and Analytics](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminOverviewPage.tsx): `src/pages/admin/AdminOverviewPage.tsx`
- [Event Management](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminEventsPage.tsx): `src/pages/admin/AdminEventsPage.tsx`
- [College Management](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminCollegesPage.tsx): `src/pages/admin/AdminCollegesPage.tsx`
- [Photo Upload](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminUploadPage.tsx): `src/pages/admin/AdminUploadPage.tsx`
- [Private Gallery Admin](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/pages/admin/AdminPrivateGalleriesPage.tsx): `src/pages/admin/AdminPrivateGalleriesPage.tsx`

### Services and State

- [Customer State](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/store/customerStore.ts): `src/store/customerStore.ts`
- [Admin Authentication](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [Event Service](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/eventService.ts): `src/services/eventService.ts`
- [College Service](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/collegeService.ts): `src/services/collegeService.ts`
- [Photo Service](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/photoService.ts): `src/services/photoService.ts`
- [Private Gallery Service](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/privateGalleryService.ts): `src/services/privateGalleryService.ts`
- [Analytics Service](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/analyticsService.ts): `src/services/analyticsService.ts`
- [Seed Data](https://github.com/rakeshdintakurthi/photostudio/blob/main/src/services/mockData.ts): `src/services/mockData.ts`
- [Worker Backend](https://github.com/rakeshdintakurthi/photostudio/blob/main/backend/worker.ts): `backend/worker.ts`

### Other components

- **Visitor**
- **Cloudflare D1**
- **Cloudflare R2**

## Connections

- Visitor → Public Routes: opens (evidence: `src/App.tsx`)
- Public Routes → Home and Search: routes to (evidence: `src/App.tsx`)
- Public Routes → Event Discovery: routes to (evidence: `src/App.tsx`)
- Public Routes → College Events: routes to (evidence: `src/App.tsx`)
- Public Routes → Event Detail: routes to (evidence: `src/App.tsx`)
- Public Routes → Private Gallery Access: routes to (evidence: `src/App.tsx`)
- Home and Search → Event Service: loads events (evidence: `src/pages/public/HomePage.tsx`)
- Home and Search → College Service: loads colleges (evidence: `src/pages/public/HomePage.tsx`)
- Home and Search → Event Detail: links to (evidence: `src/pages/public/HomePage.tsx`)
- Event Detail → Photo Service: loads photos
- Event Detail → Photo Lightbox: opens viewer
- Photo Lightbox → Photo and ZIP Downloads: downloads photo (evidence: `src/components/common/Lightbox.tsx`)
- Visitor → Customer Routes: registers or signs in (evidence: `README.md`)
- Customer Routes → Customer Account: opens account (evidence: `README.md`)
- Customer Account → Customer State: reads account state (evidence: `src/pages/customer/CustomerAccountPage.tsx`)
- Customer Account → Photo Service: loads favorites (evidence: `src/pages/customer/CustomerAccountPage.tsx`)
- Customer Account → Private Gallery Service: loads shared galleries (evidence: `src/pages/customer/CustomerAccountPage.tsx`)
- Customer Account → Photo and ZIP Downloads: downloads album (evidence: `src/pages/customer/CustomerAccountPage.tsx`)
- Visitor → Admin Routes: enters admin portal (evidence: `README.md`)
- Admin Routes → Dashboard and Analytics: routes to dashboard (evidence: `src/App.tsx`)
- Dashboard and Analytics → Analytics Service: loads metrics (evidence: `src/pages/admin/AdminOverviewPage.tsx`)
- Dashboard and Analytics → Event Service: loads recent events (evidence: `src/pages/admin/AdminOverviewPage.tsx`)
- Admin Routes → Event Management: routes to events (evidence: `src/App.tsx`)
- Admin Routes → Admin Authentication: guards access (evidence: `src/App.tsx`)
- Event Management → Event Service: manages events (evidence: `src/pages/admin/AdminEventsPage.tsx`)
- College Management → College Service: manages colleges
- Photo Upload → Photo Service: uploads photos
- Private Gallery Admin → Private Gallery Service: manages access
- Private Gallery Access → Private Gallery Service: validates passcode
- Event Service → Seed Data: loads seed events (evidence: `src/services/eventService.ts`)
- Private Gallery Service → Seed Data: loads seed access (evidence: `src/services/privateGalleryService.ts`)
- Worker Backend → Cloudflare D1: uses database
- Worker Backend → Cloudflare R2: uses object storage
