# swapnil-srivastava/reimagined-guide architecture

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

- Interactive diagram: https://gitdiagram.com/swapnil-srivastava/reimagined-guide
- Repository: https://github.com/swapnil-srivastava/reimagined-guide

## Overview

Swapnil’s Odyssey is a Next.js blog and community platform with commerce, booking/event, profile, and administration features. Readers browse and filter posts; customers can progress through a cart and checkout; invitees can RSVP, while booking pages support appointment workflows. Supabase supplies authentication and application data, with payment and email integrations on server paths. The map preserves documented capabilities, but unsampled routes and components limit the detail of their runtime links.

Main entry points: [`apps/web/supa-client.ts`](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-client.ts) (Browser client), [`apps/web/pages/index.tsx`](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/index.tsx) (Post discovery), [`apps/web/pages/api/webhook.ts`](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/webhook.ts) (Stripe webhook), [`apps/web/supa-server-client.ts`](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-server-client.ts) (Server client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Content and discovery"]
  node_home["Post discovery<br/>[index.tsx]"]
  node_postpages["Post pages<br/>[&#91;slug&#93;.tsx]"]
  node_tagsearch["Tag filtering<br/>[tags.ts]"]
  node_popularity["Popular posts<br/>[views.ts]"]
  node_postrender["Post rendering<br/>[PostContent.tsx]"]
  node_video["Video embeds<br/>[videoEmbed.ts]"]
end

subgraph group_commerce["Commerce and payments"]
  node_catalog["Product catalog<br/>[index.tsx]"]
  node_productcard["Product display<br/>[ProductCard.tsx]"]
  node_cart["Shopping cart<br/>[CartPage.tsx]"]
  node_checkout["Checkout<br/>[index.tsx]"]
  node_checkoutapi["Checkout API<br/>[checkout.ts]"]
  node_stripehook["Stripe webhook<br/>[webhook.ts]"]
  node_paypalhook["PayPal webhook<br/>[paypal-webhook.ts]"]
  node_orders["Order services<br/>[orders.ts]"]
end

subgraph group_booking["Bookings and events"]
  node_bookingadmin["Booking administration<br/>[useBookingAdmin.ts]"]
  node_bookingapi["Booking API<br/>[index.ts]"]
  node_bookingservice["Booking services<br/>[booking.ts]"]
  node_invite["Event invitations<br/>[index.tsx]"]
  node_rsvp["RSVP management<br/>[RSVPList.tsx]"]
end

subgraph group_platform["Identity and administration"]
  node_db[("Supabase database<br/>[database.types.ts]")]
  node_supaclient["Browser client<br/>[supa-client.ts]"]
  node_serverclient["Server client"]
  node_auth["Anonymous authentication"]
  node_admin["Admin workspace<br/>[index.tsx]"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
end

node_reader(("Reader"))
node_shopper(("Shopper"))
node_supabase[("Supabase service")]
node_stripe["Stripe"]
node_paypal["PayPal"]
node_postmark["Postmark"]

node_reader -->|"browses"| node_home
node_home -->|"filters with"| node_tagsearch
node_home -->|"loads popular"| node_popularity
node_home -->|"renders posts"| node_postrender
node_postpages -.->|"renders content"| node_postrender
node_postrender -.->|"embeds video"| node_video
node_shopper -->|"browses"| node_catalog
node_catalog -->|"renders products"| node_productcard
node_shopper -->|"manages cart"| node_cart
node_shopper -->|"checks out"| node_checkout
node_checkout -.->|"submits order"| node_checkoutapi
node_checkoutapi -.->|"charges payment"| node_stripe
node_stripe -.->|"sends events"| node_stripehook
node_stripehook -.->|"records order"| node_orders
node_stripehook -->|"creates booking link"| node_bookingservice
node_stripehook -->|"sends stock notice"| node_mailer
node_paypal -.->|"sends events"| node_paypalhook
node_paypalhook -.->|"handles payment issues"| node_orders
node_supaclient -->|"uses schema"| node_db
node_serverclient -->|"uses schema"| node_db
node_supaclient -->|"connects"| node_supabase
node_serverclient -->|"connects"| node_supabase
node_auth -->|"authenticates with"| node_supaclient
node_admin -->|"uses"| node_supaclient
node_bookingadmin -->|"uses"| node_supaclient
node_invite -->|"renders RSVP list"| node_rsvp
node_bookingapi -.->|"serves booking actions"| node_bookingservice
node_bookingservice -.->|"accesses data"| node_serverclient
node_mailer -->|"sends email"| node_postmark

click node_home "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/index.tsx"
click node_postpages "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/%5Busername%5D/%5Bslug%5D.tsx"
click node_tagsearch "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/tags.ts"
click node_popularity "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/views.ts"
click node_postrender "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/PostContent.tsx"
click node_video "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/videoEmbed.ts"
click node_catalog "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/products/index.tsx"
click node_productcard "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/ProductCard.tsx"
click node_cart "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/CartPage.tsx"
click node_checkout "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/checkout/index.tsx"
click node_checkoutapi "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/checkout.ts"
click node_stripehook "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/webhook.ts"
click node_paypalhook "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/paypal-webhook.ts"
click node_orders "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/orders.ts"
click node_db "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/database.types.ts"
click node_supaclient "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-client.ts"
click node_serverclient "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-server-client.ts"
click node_auth "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/use-anonymous-auth.ts"
click node_admin "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/admin/index.tsx"
click node_bookingadmin "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/booking/admin/useBookingAdmin.ts"
click node_bookingapi "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/booking/%5Btoken%5D/index.ts"
click node_bookingservice "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/server/booking.ts"
click node_invite "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/invite/index.tsx"
click node_rsvp "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/RSVPList.tsx"
click node_mailer "https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/server/mailer.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_postpages,node_tagsearch,node_popularity,node_postrender,node_video toneBlue
class node_catalog,node_productcard,node_cart,node_checkout,node_checkoutapi,node_stripehook,node_paypalhook,node_orders,node_supabase toneAmber
class node_bookingadmin,node_bookingapi,node_bookingservice,node_invite,node_rsvp toneMint
class node_db,node_supaclient,node_serverclient,node_auth,node_admin,node_mailer toneRose
class node_reader,node_shopper,node_stripe,node_paypal,node_postmark toneIndigo
```

## Components

### Content and discovery

- [Post discovery](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/index.tsx): `apps/web/pages/index.tsx`
- [Post pages](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/%5Busername%5D/%5Bslug%5D.tsx): `apps/web/pages/[username]/[slug].tsx`
- [Tag filtering](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/tags.ts): `apps/web/lib/tags.ts`
- [Popular posts](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/views.ts): `apps/web/lib/views.ts`
- [Post rendering](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/PostContent.tsx): `apps/web/components/PostContent.tsx`
- [Video embeds](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/videoEmbed.ts): `apps/web/lib/videoEmbed.ts`

### Commerce and payments

- [Product catalog](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/products/index.tsx): `apps/web/pages/products/index.tsx`
- [Product display](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/ProductCard.tsx): `apps/web/components/ProductCard.tsx`
- [Shopping cart](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/CartPage.tsx): `apps/web/components/CartPage.tsx`
- [Checkout](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/checkout/index.tsx): `apps/web/pages/checkout/index.tsx`
- [Checkout API](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/checkout.ts): `apps/web/pages/api/checkout.ts`
- [Stripe webhook](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/webhook.ts): `apps/web/pages/api/webhook.ts`
- [PayPal webhook](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/paypal-webhook.ts): `apps/web/pages/api/paypal-webhook.ts`
- [Order services](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/orders.ts): `apps/web/lib/orders.ts`

### Bookings and events

- [Booking administration](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/booking/admin/useBookingAdmin.ts): `apps/web/components/booking/admin/useBookingAdmin.ts`
- [Booking API](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/api/booking/%5Btoken%5D/index.ts): `apps/web/pages/api/booking/[token]/index.ts`
- [Booking services](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/server/booking.ts): `apps/web/lib/server/booking.ts`
- [Event invitations](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/invite/index.tsx): `apps/web/pages/invite/index.tsx`
- [RSVP management](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/components/RSVPList.tsx): `apps/web/components/RSVPList.tsx`

### Identity and administration

- [Supabase database](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/database.types.ts): `apps/web/database.types.ts`
- [Browser client](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-client.ts): `apps/web/supa-client.ts`
- [Server client](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/supa-server-client.ts): `apps/web/supa-server-client.ts`
- [Anonymous authentication](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/use-anonymous-auth.ts): `apps/web/lib/use-anonymous-auth.ts`
- [Admin workspace](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/pages/admin/index.tsx): `apps/web/pages/admin/index.tsx`
- [Email delivery](https://github.com/swapnil-srivastava/reimagined-guide/blob/main/apps/web/lib/server/mailer.ts): `apps/web/lib/server/mailer.ts`

### Other components

- **Reader**
- **Shopper**
- **Supabase service**
- **Stripe**
- **PayPal**
- **Postmark**

## Connections

- Reader → Post discovery: browses
- Post discovery → Tag filtering: filters with (evidence: `apps/web/pages/index.tsx`)
- Post discovery → Popular posts: loads popular (evidence: `apps/web/pages/index.tsx`)
- Post discovery → Post rendering: renders posts (evidence: `apps/web/pages/index.tsx`)
- Post pages → Post rendering: renders content
- Post rendering → Video embeds: embeds video
- Shopper → Product catalog: browses
- Product catalog → Product display: renders products (evidence: `apps/web/pages/products/index.tsx`)
- Shopper → Shopping cart: manages cart
- Shopper → Checkout: checks out
- Checkout → Checkout API: submits order
- Checkout API → Stripe: charges payment
- Stripe → Stripe webhook: sends events
- Stripe webhook → Order services: records order
- Stripe webhook → Booking services: creates booking link (evidence: `apps/web/pages/api/webhook.ts`)
- Stripe webhook → Email delivery: sends stock notice (evidence: `apps/web/pages/api/webhook.ts`)
- PayPal → PayPal webhook: sends events
- PayPal webhook → Order services: handles payment issues
- Browser client → Supabase database: uses schema (evidence: `apps/web/supa-client.ts`)
- Server client → Supabase database: uses schema (evidence: `apps/web/supa-server-client.ts`)
- Browser client → Supabase service: connects
- Server client → Supabase service: connects
- Anonymous authentication → Browser client: authenticates with (evidence: `apps/web/lib/use-anonymous-auth.ts`)
- Admin workspace → Browser client: uses (evidence: `apps/web/pages/admin/index.tsx`)
- Booking administration → Browser client: uses (evidence: `apps/web/components/booking/admin/useBookingAdmin.ts`)
- Event invitations → RSVP management: renders RSVP list (evidence: `apps/web/pages/invite/index.tsx`)
- Booking API → Booking services: serves booking actions
- Booking services → Server client: accesses data
- Email delivery → Postmark: sends email (evidence: `apps/web/lib/server/mailer.ts`)
