# reactocoding/weddix architecture

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

- Interactive diagram: https://gitdiagram.com/reactocoding/weddix
- Repository: https://github.com/reactocoding/weddix

## Overview

1. **Overall shape**
   - This is a **Next.js App Router** application in TypeScript.
   - It has two major surfaces: a **public marketing website** and a **protected admin/CMS area**.
   - The public site is composed of route-based pages and reusable section components; the admin area edits site content that is stored externally.

2. **Public site routes**
   - `src/app/page.tsx` is the home page and is assembled from the `_home` section components.
   - Additional public routes exist for `about`, `services`, `portfolio`, and `contact`.
   - These pages are mostly presentation-focused and use shared layout components plus page-specific sections.

3. **Home page composition**
   - The home page is broken into discrete content blocks under `src/app/_home`: hero, services, testimonials, gallery, contact section, and an about teaser.
   - This suggests a section-based landing page architecture where the page shell is stable but the content is editable in the admin interface.

4. **Shared UI and layout**
   - `src/components/Navbar.tsx` and `src/components/Footer.tsx` are cross-site chrome used across public pages.
   - `src/app/layout.tsx` and `src/app/globals.css` define the global application shell and styling baseline.
   - `src/app/admin/layout.tsx` provides a separate admin shell with its own navigation via `AdminSidebar.tsx`.

5. **Admin/CMS subsystem**
   - The `src/app/admin` subtree is the content management layer.
   - Each major content area has its own editor or manager page: hero, home services, testimonials, gallery, about page, about teaser, contact page, footer, social links, services page, and users.
   - The admin UI appears to be organized by content domain rather than by CRUD abstraction, which makes the CMS closely mirror the public site structure.

6. **Data access layer**
   - `src/lib/db/*` contains domain-specific data modules for `gallery`, `sections`, `settings`, and `testimonials`.
   - `src/lib/supabase.ts` plus `src/lib/supabase/browser.ts` and `src/lib/supabase/server.ts` indicate a split between **client-side** and **server-side** Supabase access.
   - This implies a boundary where public/admin UI components call into server utilities for authenticated reads/writes and browser utilities for user-facing interactions when needed.

7. **Backend services and persistence**
   - The presence of `supabase/schema.sql` and `src/types/database.ts` shows that **Supabase** is the backing platform for both data and type-safe schema access.
   - The architecture likely relies on Supabase for content storage and authentication, with the app acting as the presentation/admin layer on top.
   - `middleware.ts` suggests request-time protection, likely to guard admin routes and/or enforce session checks.

8. **API routes and server-side flows**
   - `src/app/api/contact/route.ts` handles contact form submission from `src/app/contact/ContactForm.tsx`.
   - `src/app/api/revalidate/route.ts` exists to invalidate or refresh cached public pages after admin content changes.
   - `src/app/api/admin/users/route.ts` exposes server-side user administration logic, separated from the UI.

9. **Content update flow**
   - The main content flow is: **admin editor → server/API or Supabase write → database update → public page reads updated data**.
   - For content that affects cached pages, the app likely triggers the revalidation endpoint so the public site reflects changes quickly.
   - This makes the public site effectively a dynamic marketing site with CMS-backed content and cache invalidation.

10. **Authentication and access control**
   - `src/app/admin/login/page.tsx` is the entry point for admin authentication.
   - `middleware.ts` likely enforces protected access to admin routes and may redirect unauthenticated users to login.
   - The browser/server Supabase split reinforces that auth/session state is handled differently in public client contexts versus protected server contexts.

11. **Media and static assets**
   - `src/images/*` contains grouped asset sets for home, about, contact, gallery, layout, logo, and services.
   - `public/` holds static files that are served directly.
   - The site is therefore a content-heavy marketing/property site where imagery is a first-class part of the information architecture.

12. **Key boundaries to show in a diagram**
   - Public pages and shared chrome on one side.
   - Admin CMS routes and editors on another, protected by middleware/login.
   - Supabase as the persistence/auth layer.
   - API routes as the server-side integration boundary for contact submission, user management, and cache revalidation.

Main entry points: [`src/lib/db`](https://github.com/reactocoding/weddix/tree/main/src/lib/db) (Content modules), [`src/app/layout.tsx`](https://github.com/reactocoding/weddix/blob/main/src/app/layout.tsx) (App shell), [`src/app/admin/_shared/SectionShell.tsx`](https://github.com/reactocoding/weddix/blob/main/src/app/admin/_shared/SectionShell.tsx) (Section shell), [`src/app/api/revalidate/route.ts`](https://github.com/reactocoding/weddix/blob/main/src/app/api/revalidate/route.ts) (Revalidate API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_app_layout["App shell<br/>layout<br/>[layout.tsx]"]
  node_navbar["Navbar<br/>chrome<br/>[Navbar.tsx]"]
  node_footer["Footer<br/>chrome<br/>[Footer.tsx]"]
  node_home_page["Home<br/>route page<br/>[page.tsx]"]
  node_home_sections["Home blocks<br/>section set"]
  node_about_page["About<br/>route page<br/>[page.tsx]"]
  node_services_page["Services<br/>route page<br/>[page.tsx]"]
  node_portfolio_page["Portfolio<br/>route page<br/>[page.tsx]"]
  node_contact_page["Contact<br/>route page<br/>[page.tsx]"]
end

subgraph group_admin["Admin CMS"]
  node_admin_layout["Admin shell<br/>layout<br/>[layout.tsx]"]
  node_admin_sidebar["Admin sidebar<br/>admin nav<br/>[AdminSidebar.tsx]"]
  node_admin_home["Admin home<br/>dashboard page<br/>[page.tsx]"]
  node_login_page["Login<br/>auth page<br/>[page.tsx]"]
  node_section_shell["Section shell<br/>admin component<br/>[SectionShell.tsx]"]
  node_hero_editor["Hero editor<br/>content editor<br/>[HeroEditor.tsx]"]
  node_services_editor["Home services<br/>content editor"]
  node_testimonials_editor["Testimonials<br/>content manager"]
  node_gallery_manager["Gallery<br/>content manager<br/>[GalleryManager.tsx]"]
  node_settings_editor["Site settings<br/>content editor"]
  node_users_manager["Users<br/>admin manager<br/>[UsersManager.tsx]"]
  node_middleware["Middleware<br/>access control<br/>[middleware.ts]"]
end

subgraph group_data["Data layer"]
  node_content_modules["Content modules<br/>data access"]
  node_supabase_entry["Supabase access<br/>sdk boundary"]
  node_database_types["DB types<br/>schema types<br/>[database.ts]"]
  node_schema_sql[("Schema SQL<br/>database schema<br/>[schema.sql]")]
end

subgraph group_api["API boundary"]
  node_contact_api["Contact API<br/>route handler<br/>[route.ts]"]
  node_revalidate_api["Revalidate API<br/>route handler<br/>[route.ts]"]
  node_admin_users_api["Users API<br/>route handler<br/>[route.ts]"]
end

node_app_layout -->|"wraps"| node_navbar
node_app_layout -->|"wraps"| node_footer
node_home_page -->|"composes"| node_home_sections
node_home_page -->|"shares"| node_navbar
node_home_page -->|"shares"| node_footer
node_about_page -->|"uses"| node_app_layout
node_services_page -->|"uses"| node_app_layout
node_portfolio_page -->|"uses"| node_app_layout
node_contact_page -->|"uses"| node_app_layout
node_admin_layout -->|"wraps"| node_admin_sidebar
node_admin_home -->|"uses"| node_admin_layout
node_login_page -->|"protected by"| node_middleware
node_hero_editor -->|"uses"| node_section_shell
node_services_editor -->|"uses"| node_section_shell
node_testimonials_editor -->|"uses"| node_section_shell
node_gallery_manager -->|"uses"| node_section_shell
node_settings_editor -->|"uses"| node_section_shell
node_users_manager -->|"uses"| node_section_shell
node_hero_editor -->|"reads/writes"| node_content_modules
node_services_editor -->|"reads/writes"| node_content_modules
node_testimonials_editor -->|"reads/writes"| node_content_modules
node_gallery_manager -->|"reads/writes"| node_content_modules
node_settings_editor -->|"reads/writes"| node_content_modules
node_users_manager -->|"uses"| node_admin_users_api
node_content_modules -->|"calls"| node_supabase_entry
node_supabase_entry -->|"targets"| node_schema_sql
node_database_types -->|"types"| node_schema_sql
node_content_modules -->|"typed by"| node_database_types
node_login_page -->|"authenticates with"| node_supabase_entry
node_contact_page -->|"submits to"| node_contact_api
node_hero_editor -->|"triggers"| node_revalidate_api
node_services_editor -->|"triggers"| node_revalidate_api
node_testimonials_editor -->|"triggers"| node_revalidate_api
node_gallery_manager -->|"triggers"| node_revalidate_api
node_settings_editor -->|"triggers"| node_revalidate_api

click node_app_layout "https://github.com/reactocoding/weddix/blob/main/src/app/layout.tsx"
click node_navbar "https://github.com/reactocoding/weddix/blob/main/src/components/Navbar.tsx"
click node_footer "https://github.com/reactocoding/weddix/blob/main/src/components/Footer.tsx"
click node_home_page "https://github.com/reactocoding/weddix/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/reactocoding/weddix/tree/main/src/app/_home"
click node_about_page "https://github.com/reactocoding/weddix/blob/main/src/app/about/page.tsx"
click node_services_page "https://github.com/reactocoding/weddix/blob/main/src/app/services/page.tsx"
click node_portfolio_page "https://github.com/reactocoding/weddix/blob/main/src/app/portfolio/page.tsx"
click node_contact_page "https://github.com/reactocoding/weddix/blob/main/src/app/contact/page.tsx"
click node_admin_layout "https://github.com/reactocoding/weddix/blob/main/src/app/admin/layout.tsx"
click node_admin_sidebar "https://github.com/reactocoding/weddix/blob/main/src/app/admin/AdminSidebar.tsx"
click node_admin_home "https://github.com/reactocoding/weddix/blob/main/src/app/admin/page.tsx"
click node_login_page "https://github.com/reactocoding/weddix/blob/main/src/app/admin/login/page.tsx"
click node_section_shell "https://github.com/reactocoding/weddix/blob/main/src/app/admin/_shared/SectionShell.tsx"
click node_hero_editor "https://github.com/reactocoding/weddix/blob/main/src/app/admin/hero/HeroEditor.tsx"
click node_services_editor "https://github.com/reactocoding/weddix/blob/main/src/app/admin/home-services/HomeServicesEditor.tsx"
click node_testimonials_editor "https://github.com/reactocoding/weddix/blob/main/src/app/admin/testimonials/TestimonialsManager.tsx"
click node_gallery_manager "https://github.com/reactocoding/weddix/blob/main/src/app/admin/gallery/GalleryManager.tsx"
click node_settings_editor "https://github.com/reactocoding/weddix/blob/main/src/app/admin/about-page/AboutPageEditor.tsx"
click node_users_manager "https://github.com/reactocoding/weddix/blob/main/src/app/admin/users/UsersManager.tsx"
click node_content_modules "https://github.com/reactocoding/weddix/tree/main/src/lib/db"
click node_supabase_entry "https://github.com/reactocoding/weddix/tree/main/src/lib/supabase"
click node_database_types "https://github.com/reactocoding/weddix/blob/main/src/types/database.ts"
click node_schema_sql "https://github.com/reactocoding/weddix/blob/main/supabase/schema.sql"
click node_contact_api "https://github.com/reactocoding/weddix/blob/main/src/app/api/contact/route.ts"
click node_revalidate_api "https://github.com/reactocoding/weddix/blob/main/src/app/api/revalidate/route.ts"
click node_admin_users_api "https://github.com/reactocoding/weddix/blob/main/src/app/api/admin/users/route.ts"
click node_middleware "https://github.com/reactocoding/weddix/blob/main/src/middleware.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_app_layout,node_navbar,node_footer,node_home_page,node_home_sections,node_about_page,node_services_page,node_portfolio_page,node_contact_page toneBlue
class node_admin_layout,node_admin_sidebar,node_admin_home,node_login_page,node_section_shell,node_hero_editor,node_services_editor,node_testimonials_editor,node_gallery_manager,node_settings_editor,node_users_manager,node_middleware toneAmber
class node_content_modules,node_supabase_entry,node_database_types,node_schema_sql toneMint
class node_contact_api,node_revalidate_api,node_admin_users_api toneRose
```

## Components

### Public site

Marketing pages, shared chrome, and landing-page sections

- [App shell](https://github.com/reactocoding/weddix/blob/main/src/app/layout.tsx): layout · Global Next.js shell and styling baseline · `src/app/layout.tsx`
- [Navbar](https://github.com/reactocoding/weddix/blob/main/src/components/Navbar.tsx): chrome · Public site navigation · `src/components/Navbar.tsx`
- [Footer](https://github.com/reactocoding/weddix/blob/main/src/components/Footer.tsx): chrome · Public site footer · `src/components/Footer.tsx`
- [Home](https://github.com/reactocoding/weddix/blob/main/src/app/page.tsx): route page · Landing page assembled from section blocks · `src/app/page.tsx`
- [Home blocks](https://github.com/reactocoding/weddix/tree/main/src/app/_home): section set · Hero, services, testimonials, gallery, contact, and about teaser · `src/app/_home`
- [About](https://github.com/reactocoding/weddix/blob/main/src/app/about/page.tsx): route page · Public about page · `src/app/about/page.tsx`
- [Services](https://github.com/reactocoding/weddix/blob/main/src/app/services/page.tsx): route page · Public services page · `src/app/services/page.tsx`
- [Portfolio](https://github.com/reactocoding/weddix/blob/main/src/app/portfolio/page.tsx): route page · Public gallery page · `src/app/portfolio/page.tsx`
- [Contact](https://github.com/reactocoding/weddix/blob/main/src/app/contact/page.tsx): route page · Public contact page with form and info · `src/app/contact/page.tsx`

### Admin CMS

Protected content editing and account management surface

- [Admin shell](https://github.com/reactocoding/weddix/blob/main/src/app/admin/layout.tsx): layout · Admin-only layout and navigation frame · `src/app/admin/layout.tsx`
- [Admin sidebar](https://github.com/reactocoding/weddix/blob/main/src/app/admin/AdminSidebar.tsx): admin nav · Primary navigation for CMS sections · `src/app/admin/AdminSidebar.tsx`
- [Admin home](https://github.com/reactocoding/weddix/blob/main/src/app/admin/page.tsx): dashboard page · Admin landing page for content management · `src/app/admin/page.tsx`
- [Login](https://github.com/reactocoding/weddix/blob/main/src/app/admin/login/page.tsx): auth page · Admin authentication entry point · `src/app/admin/login/page.tsx`
- [Section shell](https://github.com/reactocoding/weddix/blob/main/src/app/admin/_shared/SectionShell.tsx): admin component · Shared framing for editor pages · `src/app/admin/_shared/SectionShell.tsx`
- [Hero editor](https://github.com/reactocoding/weddix/blob/main/src/app/admin/hero/HeroEditor.tsx): content editor · Edits the home hero content · `src/app/admin/hero/HeroEditor.tsx`
- [Home services](https://github.com/reactocoding/weddix/blob/main/src/app/admin/home-services/HomeServicesEditor.tsx): content editor · Edits the homepage services section · `src/app/admin/home-services/HomeServicesEditor.tsx`
- [Testimonials](https://github.com/reactocoding/weddix/blob/main/src/app/admin/testimonials/TestimonialsManager.tsx): content manager · Manages homepage testimonials · `src/app/admin/testimonials/TestimonialsManager.tsx`
- [Gallery](https://github.com/reactocoding/weddix/blob/main/src/app/admin/gallery/GalleryManager.tsx): content manager · Manages gallery items and imagery · `src/app/admin/gallery/GalleryManager.tsx`
- [Site settings](https://github.com/reactocoding/weddix/blob/main/src/app/admin/about-page/AboutPageEditor.tsx): content editor · Edits about, contact, footer, social, and services page content · `src/app/admin/about-page/AboutPageEditor.tsx`
- [Users](https://github.com/reactocoding/weddix/blob/main/src/app/admin/users/UsersManager.tsx): admin manager · Manages administrative users · `src/app/admin/users/UsersManager.tsx`
- [Middleware](https://github.com/reactocoding/weddix/blob/main/src/middleware.ts): access control · Protects admin routes and enforces session checks · `src/middleware.ts`

### Data layer

Supabase-backed content access and type definitions

- [Content modules](https://github.com/reactocoding/weddix/tree/main/src/lib/db): data access · Domain data modules for gallery, sections, settings, and testimonials · `src/lib/db`
- [Supabase access](https://github.com/reactocoding/weddix/tree/main/src/lib/supabase): sdk boundary · Browser and server Supabase entry points · `src/lib/supabase`
- [DB types](https://github.com/reactocoding/weddix/blob/main/src/types/database.ts): schema types · Generated database typings · `src/types/database.ts`
- [Schema SQL](https://github.com/reactocoding/weddix/blob/main/supabase/schema.sql): database schema · Supabase schema definition · `supabase/schema.sql`

### API boundary

Server routes for submissions, revalidation, and user management

- [Contact API](https://github.com/reactocoding/weddix/blob/main/src/app/api/contact/route.ts): route handler · Processes contact form submissions · `src/app/api/contact/route.ts`
- [Revalidate API](https://github.com/reactocoding/weddix/blob/main/src/app/api/revalidate/route.ts): route handler · Refreshes cached public pages after content updates · `src/app/api/revalidate/route.ts`
- [Users API](https://github.com/reactocoding/weddix/blob/main/src/app/api/admin/users/route.ts): route handler · Server-side admin user management · `src/app/api/admin/users/route.ts`

## Connections

- App shell → Navbar: wraps · Global layout provides shared public navigation
- App shell → Footer: wraps · Global layout provides shared public footer
- Home → Home blocks: composes · Home page is assembled from reusable section blocks
- Home → Navbar: shares · Home page uses shared public chrome
- Home → Footer: shares · Home page uses shared public chrome
- About → App shell: uses · Public route renders within the main app shell
- Services → App shell: uses · Public route renders within the main app shell
- Portfolio → App shell: uses · Public route renders within the main app shell
- Contact → App shell: uses · Public route renders within the main app shell
- Admin shell → Admin sidebar: wraps · Admin layout provides dedicated navigation
- Admin home → Admin shell: uses · Admin pages render inside the CMS shell
- Login → Middleware: protected by · Admin access is guarded at request time
- Hero editor → Section shell: uses · Editors are organized through a shared section frame
- Home services → Section shell: uses · Editors are organized through a shared section frame
- Testimonials → Section shell: uses · Editors are organized through a shared section frame
- Gallery → Section shell: uses · Editors are organized through a shared section frame
- Site settings → Section shell: uses · Editors are organized through a shared section frame
- Users → Section shell: uses · Editors are organized through a shared section frame
- Hero editor → Content modules: reads/writes · Editors operate on domain content modules
- Home services → Content modules: reads/writes · Editors operate on domain content modules
- Testimonials → Content modules: reads/writes · Editors operate on domain content modules
- Gallery → Content modules: reads/writes · Editors operate on domain content modules
- Site settings → Content modules: reads/writes · Editors operate on domain content modules
- Users → Users API: uses · User management delegates to the server route
- Content modules → Supabase access: calls · Data modules use Supabase access utilities
- Supabase access → Schema SQL: targets · Supabase utilities persist to the backing schema
- DB types → Schema SQL: types · Generated types reflect the Supabase schema
- Content modules → DB types: typed by · Domain data modules use generated database typings
- Login → Supabase access: authenticates with · Admin login relies on Supabase session access
- Contact → Contact API: submits to · Contact form posts to the server handler
- Hero editor → Revalidate API: triggers · Content changes can refresh cached pages
- Home services → Revalidate API: triggers · Content changes can refresh cached pages
- Testimonials → Revalidate API: triggers · Content changes can refresh cached pages
- Gallery → Revalidate API: triggers · Content changes can refresh cached pages
- Site settings → Revalidate API: triggers · Content changes can refresh cached pages
