# codesagarrr/celebare-project-01 architecture

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

- Interactive diagram: https://gitdiagram.com/codesagarrr/celebare-project-01
- Repository: https://github.com/codesagarrr/celebare-project-01

## Overview

This is a Next.js photo-ordering and UPI-payment application: guests choose event photos, create an order, pay through a QR/link, and wait for bank-email processing to confirm payment and unlock photo links. The graph also preserves photographer setup, dashboard, and payment-ingestion capabilities. Relationship evidence is limited to the supplied excerpts and SOURCE INDEX; unsampled route and page behavior is not expanded beyond what those references support.

Main entry points: [`src/lib/db.ts`](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/db.ts) (Database client), [`src/app/api/orders/route.ts`](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/route.ts) (Order endpoints), [`src/components/PhotoGrid.tsx`](https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PhotoGrid.tsx) (Photo selection), [`src/components/PaymentStatus.tsx`](https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PaymentStatus.tsx) (Payment status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_home["Photo storefront<br/>[page.tsx]"]
  node_photo_grid["Photo selection<br/>[PhotoGrid.tsx]"]
  node_pay_page["Checkout page<br/>[page.tsx]"]
  node_payment_status["Payment status<br/>[PaymentStatus.tsx]"]
  node_countdown["Expiry countdown<br/>[Countdown.tsx]"]
  node_api_client["Client API helpers<br/>[api.ts]"]
  node_dashboard["Operations dashboard<br/>[page.tsx]"]
end

subgraph group_orders["Orders and payments"]
  node_photographers_api["Photographer setup<br/>[route.ts]"]
  node_orders_api["Order endpoints<br/>[route.ts]"]
  node_order_status_api["Order status endpoint<br/>[route.ts]"]
  node_photos_api["Order photo endpoint<br/>[route.ts]"]
  node_order_rules["Order rules<br/>[orders.ts]"]
  node_upi["UPI link and QR<br/>[upi.ts]"]
end

subgraph group_ingestion["Bank email ingestion"]
  node_ingest_api["Email ingest endpoint<br/>[route.ts]"]
  node_verification["Email verification<br/>[verify.ts]"]
  node_parser_registry["Bank parser dispatch<br/>[index.ts]"]
  node_bank_a["Bank A parser<br/>[fakebank-a.ts]"]
  node_bank_b["Bank B parser<br/>[fakebank-b.ts]"]
  node_payment_match["Payment matching<br/>[match.ts]"]
end

subgraph group_data["Persistence and operations"]
  node_events_api["Event endpoint<br/>[route.ts]"]
  node_database_client["Database client<br/>[db.ts]"]
  node_database[("Application database<br/>[schema.prisma]")]
  node_email_worker["Email worker<br/>[email-worker.ts]"]
end

node_guest(("Guest"))

node_guest -->|"selects photos"| node_photo_grid
node_home -.->|"renders"| node_photo_grid
node_photo_grid -->|"creates order"| node_orders_api
node_photo_grid -->|"opens checkout"| node_pay_page
node_pay_page -.->|"renders"| node_payment_status
node_payment_status -->|"renders"| node_countdown
node_payment_status -->|"polls through"| node_api_client
node_dashboard -->|"reads"| node_database_client
node_dashboard -->|"uses status UI"| node_payment_status
node_photographers_api -->|"reads and writes"| node_database_client
node_orders_api -->|"reads and writes"| node_database_client
node_orders_api -->|"chooses amount"| node_order_rules
node_orders_api -->|"builds checkout QR"| node_upi
node_order_status_api -->|"reads order"| node_database_client
node_order_status_api -->|"computes status"| node_order_rules
node_order_status_api -->|"builds checkout QR"| node_upi
node_photos_api -->|"accesses photos"| node_database_client
node_events_api -->|"accesses events"| node_database_client
node_ingest_api -->|"records delivery"| node_database_client
node_ingest_api -->|"verifies email"| node_verification
node_ingest_api -->|"matches transaction"| node_payment_match
node_verification -->|"parses bank email"| node_parser_registry
node_parser_registry -->|"dispatches"| node_bank_a
node_parser_registry -->|"dispatches"| node_bank_b
node_payment_match -->|"matches and updates"| node_database_client
node_database_client -.->|"persists data"| node_database

click node_home "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/page.tsx"
click node_photo_grid "https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PhotoGrid.tsx"
click node_pay_page "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/pay/%5BorderId%5D/page.tsx"
click node_payment_status "https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PaymentStatus.tsx"
click node_countdown "https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/Countdown.tsx"
click node_api_client "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/api.ts"
click node_dashboard "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/dashboard/page.tsx"
click node_photographers_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/photographers/route.ts"
click node_orders_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/route.ts"
click node_order_status_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/%5Bid%5D/route.ts"
click node_photos_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/%5Bid%5D/photos/route.ts"
click node_order_rules "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/orders.ts"
click node_upi "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/upi.ts"
click node_ingest_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/ingest/route.ts"
click node_verification "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/verify.ts"
click node_parser_registry "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/index.ts"
click node_bank_a "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/fakebank-a.ts"
click node_bank_b "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/fakebank-b.ts"
click node_payment_match "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/match.ts"
click node_events_api "https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/events/route.ts"
click node_database_client "https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/db.ts"
click node_database "https://github.com/codesagarrr/celebare-project-01/blob/master/prisma/schema.prisma"
click node_email_worker "https://github.com/codesagarrr/celebare-project-01/blob/master/worker/email-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_home,node_photo_grid,node_pay_page,node_payment_status,node_countdown,node_api_client,node_dashboard toneBlue
class node_photographers_api,node_orders_api,node_order_status_api,node_photos_api,node_order_rules,node_upi toneAmber
class node_ingest_api,node_verification,node_parser_registry,node_bank_a,node_bank_b,node_payment_match toneMint
class node_events_api,node_database_client,node_database,node_email_worker toneRose
class node_guest toneIndigo
```

## Components

### Guest experience

- [Photo storefront](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Photo selection](https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PhotoGrid.tsx): `src/components/PhotoGrid.tsx`
- [Checkout page](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/pay/%5BorderId%5D/page.tsx): `src/app/pay/[orderId]/page.tsx`
- [Payment status](https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/PaymentStatus.tsx): `src/components/PaymentStatus.tsx`
- [Expiry countdown](https://github.com/codesagarrr/celebare-project-01/blob/master/src/components/Countdown.tsx): `src/components/Countdown.tsx`
- [Client API helpers](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/api.ts): `src/lib/api.ts`
- [Operations dashboard](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`

### Orders and payments

- [Photographer setup](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/photographers/route.ts): `src/app/api/photographers/route.ts`
- [Order endpoints](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/route.ts): `src/app/api/orders/route.ts`
- [Order status endpoint](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/%5Bid%5D/route.ts): `src/app/api/orders/[id]/route.ts`
- [Order photo endpoint](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/orders/%5Bid%5D/photos/route.ts): `src/app/api/orders/[id]/photos/route.ts`
- [Order rules](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/orders.ts): `src/lib/orders.ts`
- [UPI link and QR](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/upi.ts): `src/lib/upi.ts`

### Bank email ingestion

- [Email ingest endpoint](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/ingest/route.ts): `src/app/api/ingest/route.ts`
- [Email verification](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/verify.ts): `src/lib/ingest/verify.ts`
- [Bank parser dispatch](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/index.ts): `src/lib/ingest/parsers/index.ts`
- [Bank A parser](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/fakebank-a.ts): `src/lib/ingest/parsers/fakebank-a.ts`
- [Bank B parser](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/parsers/fakebank-b.ts): `src/lib/ingest/parsers/fakebank-b.ts`
- [Payment matching](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/ingest/match.ts): `src/lib/ingest/match.ts`

### Persistence and operations

- [Event endpoint](https://github.com/codesagarrr/celebare-project-01/blob/master/src/app/api/events/route.ts): `src/app/api/events/route.ts`
- [Database client](https://github.com/codesagarrr/celebare-project-01/blob/master/src/lib/db.ts): `src/lib/db.ts`
- [Application database](https://github.com/codesagarrr/celebare-project-01/blob/master/prisma/schema.prisma): `prisma/schema.prisma`
- [Email worker](https://github.com/codesagarrr/celebare-project-01/blob/master/worker/email-worker.ts): `worker/email-worker.ts`

### Other components

- **Guest**

## Connections

- Guest → Photo selection: selects photos (evidence: `src/components/PhotoGrid.tsx`)
- Photo storefront → Photo selection: renders (evidence: `src/app/page.tsx`)
- Photo selection → Order endpoints: creates order (evidence: `src/components/PhotoGrid.tsx`)
- Photo selection → Checkout page: opens checkout (evidence: `src/components/PhotoGrid.tsx`)
- Checkout page → Payment status: renders (evidence: `src/app/pay/[orderId]/page.tsx`)
- Payment status → Expiry countdown: renders (evidence: `src/components/PaymentStatus.tsx`)
- Payment status → Client API helpers: polls through (evidence: `src/components/PaymentStatus.tsx`)
- Operations dashboard → Database client: reads (evidence: `src/app/dashboard/page.tsx`)
- Operations dashboard → Payment status: uses status UI (evidence: `src/app/dashboard/page.tsx`)
- Photographer setup → Database client: reads and writes (evidence: `src/app/api/photographers/route.ts`)
- Order endpoints → Database client: reads and writes (evidence: `src/app/api/orders/route.ts`)
- Order endpoints → Order rules: chooses amount (evidence: `src/app/api/orders/route.ts`)
- Order endpoints → UPI link and QR: builds checkout QR (evidence: `src/app/api/orders/route.ts`)
- Order status endpoint → Database client: reads order (evidence: `src/app/api/orders/[id]/route.ts`)
- Order status endpoint → Order rules: computes status (evidence: `src/app/api/orders/[id]/route.ts`)
- Order status endpoint → UPI link and QR: builds checkout QR (evidence: `src/app/api/orders/[id]/route.ts`)
- Order photo endpoint → Database client: accesses photos (evidence: `src/app/api/orders/[id]/photos/route.ts`)
- Event endpoint → Database client: accesses events (evidence: `src/app/api/events/route.ts`)
- Email ingest endpoint → Database client: records delivery (evidence: `src/app/api/ingest/route.ts`)
- Email ingest endpoint → Email verification: verifies email (evidence: `src/app/api/ingest/route.ts`)
- Email ingest endpoint → Payment matching: matches transaction (evidence: `src/app/api/ingest/route.ts`)
- Email verification → Bank parser dispatch: parses bank email (evidence: `src/lib/ingest/verify.ts`)
- Bank parser dispatch → Bank A parser: dispatches (evidence: `src/lib/ingest/parsers/index.ts`)
- Bank parser dispatch → Bank B parser: dispatches (evidence: `src/lib/ingest/parsers/index.ts`)
- Payment matching → Database client: matches and updates (evidence: `src/lib/ingest/match.ts`)
- Database client → Application database: persists data
