# ashwinramakrishnan/sai-meera architecture

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

- Interactive diagram: https://gitdiagram.com/ashwinramakrishnan/sai-meera
- Repository: https://github.com/ashwinramakrishnan/sai-meera

## Overview

#### Purpose and Entry Points
This is a Vite-built React single-page site for a print/design business. It combines marketing and product/category pages, interactive visual “machine” showcases, contact/enquiry capture, image upload, and Razorpay payment initiation. Browser bootstrap is `src/main.jsx`; root composition and route-level orchestration are in `src/App.jsx`; the primary landing experience is `src/pages/HomePage.jsx`.

#### Application Shell and Navigation
The root app owns the persistent experience around page content: navigation, footer, loading/cursor effects, and scroll feedback. Layout components are separated from page modules, enabling route content to change without duplicating chrome.
- `src/App.jsx`
- `src/components/layout/Navbar.jsx`
- `src/components/layout/Preloader.jsx`
- `src/components/layout/Footer.jsx`

#### Page and Product Composition
Pages organize the domain-facing sections: home, product listing/category detail, printed-product-specific pages, and contact. Product/category metadata is locally defined and likely drives category presentation and navigation rather than being fetched from a CMS.
- `src/pages/ProductsPage.jsx`
- `src/pages/CategoryPage.jsx`
- `src/pages/GreetingCardsPage.jsx`
- `src/data/categories.js`

#### Marketing Showcase Layer
Reusable showcase modules construct the commercial portfolio and service narrative: featured work, design lab, print service cards, banners, galleries, invitations, and image framing. These are presentation-domain components consumed by landing or specialized pages.
- `src/components/showcases/FeaturedWork.jsx`
- `src/components/showcases/ServicesGrid.jsx`
- `src/components/showcases/WhatWePrint.jsx`

#### Interactive Production-Machine Experience
The site has a distinct visualization subsystem for print-production machinery. Machine-section/HUD/console UI components are paired with scene modules representing presses, cutters, printer output, and shared 3D-like environmental elements. This is a strong boundary from conventional page content and likely coordinates visual state through scroll and animation hooks.
- `src/components/machines/MachineSection.jsx`
- `src/components/machines/MachineConsole.jsx`
- `src/scenes/OffsetPress.jsx`
- `src/scenes/SharedLighting.jsx`

#### Interaction, Responsive Behavior, and Animation
Cross-cutting hooks encapsulate viewport detection, media queries, in-view activation, smooth scrolling, scroll ratios, and choreography. These form the control path for progressive visual effects and should remain independent of individual showcase content.
- `src/hooks/useScrollChoreography.js`
- `src/hooks/useLenis.js`
- `src/hooks/useInView.js`
- `src/styles/scroll-choreography.css`

#### Backend Boundary: Supabase, Uploads, and Enquiries
The frontend API layer communicates with Supabase. Supabase Edge Functions provide server-side trust boundaries for upload authorization and enquiry submission; database structure is represented in the project schema. Client secrets and service credentials should remain outside the browser, supplied through environment configuration.
- `src/lib/supabase.js`
- `src/lib/api.js`
- `supabase/functions/authorize-upload/index.ts`
- `supabase/functions/submit-enquiry/index.ts`
- `supabase/schema.sql`

#### Payments and Deployment
Razorpay checkout is initiated from the client but order creation, signature verification, and webhook processing occur in Supabase Edge Functions, keeping payment validation server-side. The static Vite build is configured for Firebase Hosting, while Supabase remains the backend runtime.
- `src/hooks/useRazorpayCheckout.js`
- `supabase/functions/create-razorpay-order/index.ts`
- `supabase/functions/verify-razorpay-payment/index.ts`
- `supabase/functions/razorpay-webhook/index.ts`
- `firebase.json`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_bootstrap(("Vite bootstrap<br/>entry point<br/>[main.jsx]"))
  node_app["App shell &amp; routing<br/>React root<br/>[App.jsx]"]
  node_layout["Persistent layout<br/>layout components<br/>[Navbar.jsx]"]
  node_home["Landing page<br/>[HomePage.jsx]"]
  node_product_pages["Product &amp; category pages<br/>page modules<br/>[ProductsPage.jsx]"]
  node_categories["Category metadata<br/>local data<br/>[categories.js]"]
  node_showcases["Marketing showcases<br/>presentation components<br/>[FeaturedWork.jsx]"]
  node_supabase_client["Supabase client<br/>browser integration<br/>[supabase.js]"]
  node_frontend_api["Frontend API<br/>API layer<br/>[api.js]"]
end

subgraph group_visuals["Visual experience"]
  node_machine_ui["Machine experience UI<br/>interactive components<br/>[MachineSection.jsx]"]
  node_machine_scenes["Production scenes<br/>scene modules<br/>[OffsetPress.jsx]"]
  node_scroll_system["Scroll choreography<br/>interaction hooks &amp; styles"]
end

subgraph group_backend["Supabase backend"]
  node_upload_auth{{"Upload authorization<br/>Edge Function<br/>[index.ts]"}}
  node_enquiry{{"Enquiry submission<br/>Edge Function<br/>[index.ts]"}}
  node_database[("Supabase database<br/>schema<br/>[schema.sql]")]
end

subgraph group_payments["Payment pipeline"]
  node_checkout["Razorpay checkout<br/>client hook"]
  node_create_order{{"Create payment order<br/>Edge Function<br/>[index.ts]"}}
  node_verify_payment{{"Verify payment<br/>Edge Function<br/>[index.ts]"}}
  node_webhook{{"Payment webhook<br/>Edge Function<br/>[index.ts]"}}
end

node_hosting["Firebase Hosting<br/>static deployment<br/>[firebase.json]"]

node_bootstrap -->|"mounts"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_product_pages
node_product_pages -->|"uses"| node_categories
node_home -->|"composes"| node_showcases
node_home -->|"composes"| node_machine_ui
node_machine_ui -->|"renders"| node_machine_scenes
node_scroll_system -->|"drives animation"| node_machine_ui
node_app -->|"enables"| node_scroll_system
node_frontend_api -->|"uses"| node_supabase_client
node_frontend_api -->|"authorizes uploads"| node_upload_auth
node_frontend_api -->|"submits enquiries"| node_enquiry
node_enquiry -->|"stores"| node_database
node_checkout -->|"requests order"| node_create_order
node_checkout -->|"submits payment proof"| node_verify_payment
node_create_order -.->|"order flow"| node_verify_payment
node_webhook -->|"records events"| node_database
node_verify_payment -->|"records payment"| node_database
node_hosting -->|"serves build"| node_bootstrap

click node_bootstrap "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/main.jsx"
click node_app "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/App.jsx"
click node_layout "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/layout/Navbar.jsx"
click node_home "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/pages/HomePage.jsx"
click node_product_pages "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/pages/ProductsPage.jsx"
click node_categories "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/data/categories.js"
click node_showcases "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/showcases/FeaturedWork.jsx"
click node_machine_ui "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/machines/MachineSection.jsx"
click node_machine_scenes "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/scenes/OffsetPress.jsx"
click node_scroll_system "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/hooks/useScrollChoreography.js"
click node_supabase_client "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/lib/supabase.js"
click node_frontend_api "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/lib/api.js"
click node_upload_auth "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/authorize-upload/index.ts"
click node_enquiry "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/submit-enquiry/index.ts"
click node_database "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/schema.sql"
click node_checkout "https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/hooks/useRazorpayCheckout.js"
click node_create_order "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/create-razorpay-order/index.ts"
click node_verify_payment "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/verify-razorpay-payment/index.ts"
click node_webhook "https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/razorpay-webhook/index.ts"
click node_hosting "https://github.com/ashwinramakrishnan/sai-meera/blob/main/firebase.json"

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_bootstrap,node_app,node_layout,node_home,node_product_pages,node_categories,node_showcases,node_supabase_client,node_frontend_api toneBlue
class node_machine_ui,node_machine_scenes,node_scroll_system toneAmber
class node_upload_auth,node_enquiry,node_database toneMint
class node_checkout,node_create_order,node_verify_payment,node_webhook toneRose
class node_hosting toneNeutral
```

## Components

### React frontend

- [Vite bootstrap](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/main.jsx): entry point · `src/main.jsx`
- [App shell & routing](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/App.jsx): React root · Owns persistent chrome and route-level composition. · `src/App.jsx`
- [Persistent layout](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/layout/Navbar.jsx): layout components · Navigation, preloader, and footer surround route content. · `src/components/layout/Navbar.jsx`
- [Landing page](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/pages/HomePage.jsx): page · `src/pages/HomePage.jsx`
- [Product & category pages](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/pages/ProductsPage.jsx): page modules · `src/pages/ProductsPage.jsx`
- [Category metadata](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/data/categories.js): local data · Locally defined category data drives product presentation. · `src/data/categories.js`
- [Marketing showcases](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/showcases/FeaturedWork.jsx): presentation components · Featured work, services, and print offerings. · `src/components/showcases/FeaturedWork.jsx`
- [Supabase client](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/lib/supabase.js): browser integration · `src/lib/supabase.js`
- [Frontend API](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/lib/api.js): API layer · Routes uploads and enquiries to backend functions. · `src/lib/api.js`

### Visual experience

- [Machine experience UI](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/components/machines/MachineSection.jsx): interactive components · Machine sections and console coordinate the production showcase. · `src/components/machines/MachineSection.jsx`
- [Production scenes](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/scenes/OffsetPress.jsx): scene modules · Press and shared lighting visual elements. · `src/scenes/OffsetPress.jsx`
- [Scroll choreography](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/hooks/useScrollChoreography.js): interaction hooks & styles · Viewport, in-view, smooth-scroll, and animation control path. · `src/hooks/useScrollChoreography.js`

### Supabase backend

- [Upload authorization](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/authorize-upload/index.ts): Edge Function · Server-side upload authorization boundary. · `supabase/functions/authorize-upload/index.ts`
- [Enquiry submission](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/submit-enquiry/index.ts): Edge Function · `supabase/functions/submit-enquiry/index.ts`
- [Supabase database](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/schema.sql): schema · Database structure for backend-managed data. · `supabase/schema.sql`

### Payment pipeline

- [Razorpay checkout](https://github.com/ashwinramakrishnan/sai-meera/blob/main/src/hooks/useRazorpayCheckout.js): client hook · Initiates browser checkout. · `src/hooks/useRazorpayCheckout.js`
- [Create payment order](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/create-razorpay-order/index.ts): Edge Function · Creates Razorpay orders outside the browser trust boundary. · `supabase/functions/create-razorpay-order/index.ts`
- [Verify payment](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/verify-razorpay-payment/index.ts): Edge Function · Verifies payment signatures server-side. · `supabase/functions/verify-razorpay-payment/index.ts`
- [Payment webhook](https://github.com/ashwinramakrishnan/sai-meera/blob/main/supabase/functions/razorpay-webhook/index.ts): Edge Function · Processes Razorpay payment events. · `supabase/functions/razorpay-webhook/index.ts`

### Other components

- [Firebase Hosting](https://github.com/ashwinramakrishnan/sai-meera/blob/main/firebase.json): static deployment · Hosts the Vite static build. · `firebase.json`

## Connections

- Vite bootstrap → App shell & routing: mounts
- App shell & routing → Persistent layout: renders
- App shell & routing → Landing page: routes to
- App shell & routing → Product & category pages: routes to
- Product & category pages → Category metadata: uses
- Landing page → Marketing showcases: composes
- Landing page → Machine experience UI: composes
- Machine experience UI → Production scenes: renders
- Scroll choreography → Machine experience UI: drives animation
- App shell & routing → Scroll choreography: enables
- Frontend API → Supabase client: uses
- Frontend API → Upload authorization: authorizes uploads
- Frontend API → Enquiry submission: submits enquiries
- Enquiry submission → Supabase database: stores
- Razorpay checkout → Create payment order: requests order
- Razorpay checkout → Verify payment: submits payment proof
- Create payment order → Verify payment: order flow
- Payment webhook → Supabase database: records events
- Verify payment → Supabase database: records payment
- Firebase Hosting → Vite bootstrap: serves build
