How reactocoding/weddix works
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: db Content modules · layout.tsx App shell · SectionShell.tsx Section shell · route.ts Revalidate API
Components 28
Public site
Marketing pages, shared chrome, and landing-page sections
- App shell · Global Next.js shell and styling baseline
src/app/layout.tsx - Navbar · Public site navigation
src/components/Navbar.tsx - Footer · Public site footer
src/components/Footer.tsx - Home · Landing page assembled from section blocks
src/app/page.tsx - Home blocks · Hero, services, testimonials, gallery, contact, and about teaser
src/app/_home - About · Public about page
src/app/about/page.tsx - Services · Public services page
src/app/services/page.tsx - Portfolio · Public gallery page
src/app/portfolio/page.tsx - Contact · Public contact page with form and info
src/app/contact/page.tsx
Admin CMS
Protected content editing and account management surface
- Admin shell · Admin-only layout and navigation frame
src/app/admin/layout.tsx - Admin sidebar · Primary navigation for CMS sections
src/app/admin/AdminSidebar.tsx - Admin home · Admin landing page for content management
src/app/admin/page.tsx - Login · Admin authentication entry point
src/app/admin/login/page.tsx - Section shell · Shared framing for editor pages
src/app/admin/_shared/SectionShell.tsx - Hero editor · Edits the home hero content
src/app/admin/hero/HeroEditor.tsx - Home services · Edits the homepage services section
src/app/admin/home-services/HomeServicesEditor.tsx - Testimonials · Manages homepage testimonials
src/app/admin/testimonials/TestimonialsManager.tsx - Gallery · Manages gallery items and imagery
src/app/admin/gallery/GalleryManager.tsx - Site settings · Edits about, contact, footer, social, and services page content
src/app/admin/about-page/AboutPageEditor.tsx - Users · Manages administrative users
src/app/admin/users/UsersManager.tsx - Middleware · Protects admin routes and enforces session checks
src/middleware.ts
Data layer
Supabase-backed content access and type definitions
- Content modules · Domain data modules for gallery, sections, settings, and testimonials
src/lib/db - Supabase access · Browser and server Supabase entry points
src/lib/supabase - DB types · Generated database typings
src/types/database.ts - Schema SQL · Supabase schema definition
supabase/schema.sql
API boundary
Server routes for submissions, revalidation, and user management
- Contact API · Processes contact form submissions
src/app/api/contact/route.ts - Revalidate API · Refreshes cached public pages after content updates
src/app/api/revalidate/route.ts - Users API · Server-side admin user management
src/app/api/admin/users/route.ts
Connections 35
- 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