# prodip-shadow/digital-life-lessons architecture

> Architecture diagram of the GitHub repository prodip-shadow/digital-life-lessons, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prodip-shadow/digital-life-lessons
- Repository: https://github.com/prodip-shadow/digital-life-lessons

## Overview

1. This is a Next.js App Router application with a clear separation between public-facing pages, authenticated dashboard pages, and API route handlers. The app lives under `src/app`, with `layout.jsx` files defining global and section-level shells.

2. The route structure is split into two main UI zones:
   - `(common)`: landing and browse-oriented pages such as the homepage, “browse wisdom,” profile viewing, and upgrade messaging.
   - `(dashboard)`: authenticated product areas like adding lessons, editing lessons, favorites, earnings history, my lessons, and an admin panel.

3. The core domain appears to be “lessons” or “wisdom” content. That domain is surfaced both in the public browsing experience and in the dashboard where creators manage their own content. The presence of `browse-wisdom/[id]`, lesson editing, likes, comments, and favorites suggests a content marketplace/community model.

4. Server-side API routes are the main integration boundary. The `src/app/api/lessons` tree provides CRUD-style lesson endpoints plus interaction endpoints for likes, favorites, comments, and a “today-count” metric. This is likely the primary data access layer used by the UI pages.

5. Authentication is handled as a dedicated backend concern under `src/app/api/auth/[...all]/route.js`, with client/server helper modules in `src/lib/auth-client.js` and `src/lib/auth.js`. The `proxy.js` file likely protects certain routes or performs request-time auth gating for the dashboard/admin areas.

6. Payments and premium access are a separate subsystem. There is a checkout route, a checkout verification route, a Stripe webhook handler, a payment success page, and a `scripts/update-premium.js` maintenance script. Together these imply an external payment provider updates user entitlements, probably premium status or access unlocks.

7. User and analytics data are exposed through dedicated endpoints:
   - `api/users/[id]` for user profile data
   - `api/dashboard/metrics` for creator-facing stats
   - `api/admin/metrics` for administrative reporting
   - `api/dashboard/favorites` and `api/dashboard/earnings-history` for personalized account views
   This indicates separate metric scopes for end users versus admins.

8. The data persistence boundary is centralized in `src/lib/db.js`, which likely contains the database client/connection used by route handlers. From the file layout, server routes are the main consumers of persistence rather than client components talking directly to storage.

9. The UI is built from a small set of reusable component families under `src/components`: navbar, footer, sidebar, cards, buttons, forms, loader, and homepage-specific sections like hero, marquee, pillars, and featured lessons. This suggests a design-system-like component layer rather than page-specific duplication.

10. Styling and presentation are handled with the standard Next.js stack plus a global stylesheet (`src/app/globals.css`) and PostCSS config. There is also a shader background component and a `/shader` page, which looks like a visual/experimental feature isolated from the main product flow.

11. Public authentication pages are separate from the dashboard: `/sign-in` and `/sign-up` live alongside the main app rather than inside the dashboard group. That keeps the auth entry points lightweight and outside the protected workspace.

12. The overall request flow is: browser hits a page route, the page composes shared components, and any interactive or data-heavy action goes through the matching API route. Payments, auth, content management, and analytics are all mediated server-side, which keeps the client layer mostly presentational and interaction-oriented.

13. Operationally, this is a Vercel-friendly Next.js project with standard package/tooling files and a repository-local script for premium updates. The architecture is optimized for serverless route handlers, authenticated dashboard views, and external webhook-driven state changes.

Main entry points: [`src/app/(common)/layout.jsx`](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/layout.jsx) (Public shell), [`src/app/(dashboard)/layout.jsx`](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/layout.jsx) (Dashboard shell), [`src/lib/db.js`](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/db.js) (Database), [`src/app/api/lessons/route.js`](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/route.js) (Lessons API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_public["Public UI"]
  node_n_root_layout["App shell<br/>next layout<br/>[layout.jsx]"]
  node_n_public_layout["Public shell<br/>route group layout<br/>[layout.jsx]"]
  node_n_home["Home<br/>landing page<br/>[page.jsx]"]
  node_n_browse["Browse<br/>[page.jsx]"]
  node_n_browse_detail["Lesson view<br/>lesson detail page<br/>[page.jsx]"]
  node_n_profile["Profile<br/>[page.jsx]"]
  node_n_upgrade["Upgrade<br/>premium info page<br/>[page.jsx]"]
  node_n_signin["Sign in<br/>auth page<br/>[page.jsx]"]
  node_n_signup["Sign up<br/>auth page<br/>[page.jsx]"]
  node_n_payment_success["Payment done<br/>checkout result page<br/>[page.jsx]"]
  node_n_shader["Shader demo<br/>visual page<br/>[page.jsx]"]
end

subgraph group_g_dashboard["Dashboard UI"]
  node_n_dashboard_layout["Dashboard shell<br/>route group layout<br/>[layout.jsx]"]
  node_n_dashboard_home["Dashboard<br/>workspace home<br/>[page.jsx]"]
  node_n_add_lesson["Add lesson<br/>creator form page<br/>[page.jsx]"]
  node_n_edit_lesson["Edit lesson<br/>creator edit page<br/>[page.jsx]"]
  node_n_my_lessons["My lessons<br/>creator list page<br/>[page.jsx]"]
  node_n_favorites["Favorites<br/>account page<br/>[page.jsx]"]
  node_n_earnings["Earnings<br/>account page<br/>[page.jsx]"]
  node_n_admin_panel["Admin panel<br/>admin page<br/>[page.jsx]"]
end

subgraph group_g_api["API & Backend"]
  node_n_api_lessons["Lessons API<br/>content CRUD API<br/>[route.js]"]
  node_n_api_lesson["Lesson API<br/>lesson detail API<br/>[route.js]"]
  node_n_api_interactions["Lesson actions<br/>interaction API<br/>[route.js]"]
  node_n_api_users["Users API<br/>user profile API<br/>[route.js]"]
  node_n_api_dashboard_metrics["Creator metrics<br/>analytics API<br/>[route.js]"]
  node_n_api_dashboard_favorites["Dashboard favorites<br/>account API<br/>[route.js]"]
  node_n_api_admin_metrics["Admin metrics<br/>reporting API<br/>[route.js]"]
  node_n_api_auth["Auth API<br/>auth backend<br/>[route.js]"]
  node_n_api_checkout["Checkout API<br/>payments API<br/>[route.js]"]
  node_n_api_verify["Verify payment<br/>payments API<br/>[route.js]"]
  node_n_api_webhook["Stripe webhook<br/>payments webhook<br/>[route.js]"]
  node_n_db[("Database<br/>db client<br/>[db.js]")]
  node_n_auth_server["Auth server<br/>auth helper<br/>[auth.js]"]
  node_n_auth_client["Auth client<br/>auth helper<br/>[auth-client.js]"]
  node_n_proxy["Route proxy<br/>request gate<br/>[proxy.js]"]
end

subgraph group_g_shared["Shared UI"]
end

node_n_root_layout -->|"wraps"| node_n_public_layout
node_n_root_layout -->|"wraps"| node_n_dashboard_layout
node_n_public_layout -->|"serves"| node_n_home
node_n_public_layout -->|"serves"| node_n_browse
node_n_public_layout -->|"serves"| node_n_browse_detail
node_n_public_layout -->|"serves"| node_n_profile
node_n_public_layout -->|"serves"| node_n_upgrade
node_n_public_layout -->|"serves"| node_n_signin
node_n_public_layout -->|"serves"| node_n_signup
node_n_public_layout -->|"serves"| node_n_payment_success
node_n_public_layout -->|"serves"| node_n_shader
node_n_dashboard_layout -->|"serves"| node_n_dashboard_home
node_n_dashboard_layout -->|"serves"| node_n_add_lesson
node_n_dashboard_layout -->|"serves"| node_n_edit_lesson
node_n_dashboard_layout -->|"serves"| node_n_my_lessons
node_n_dashboard_layout -->|"serves"| node_n_favorites
node_n_dashboard_layout -->|"serves"| node_n_earnings
node_n_dashboard_layout -->|"serves"| node_n_admin_panel
node_n_home -->|"loads content"| node_n_api_lessons
node_n_browse -->|"lists"| node_n_api_lessons
node_n_browse_detail -->|"reads"| node_n_api_lesson
node_n_browse_detail -->|"interacts"| node_n_api_interactions
node_n_profile -->|"loads"| node_n_api_users
node_n_add_lesson -->|"creates"| node_n_api_lessons
node_n_edit_lesson -->|"updates"| node_n_api_lesson
node_n_my_lessons -->|"manages"| node_n_api_lessons
node_n_favorites -->|"loads"| node_n_api_dashboard_favorites
node_n_earnings -->|"loads"| node_n_api_dashboard_metrics
node_n_admin_panel -->|"loads"| node_n_api_admin_metrics
node_n_signin -->|"authenticates"| node_n_api_auth
node_n_signup -->|"authenticates"| node_n_api_auth
node_n_payment_success -->|"confirms"| node_n_api_verify
node_n_upgrade -->|"starts checkout"| node_n_api_checkout
node_n_api_checkout -->|"completes via"| node_n_api_webhook
node_n_api_webhook -->|"persists"| node_n_db
node_n_api_lessons -->|"reads/writes"| node_n_db
node_n_api_lesson -->|"reads/writes"| node_n_db
node_n_api_interactions -->|"records"| node_n_db
node_n_api_users -->|"reads"| node_n_db
node_n_api_dashboard_metrics -->|"aggregates"| node_n_db
node_n_api_dashboard_favorites -->|"reads"| node_n_db
node_n_api_admin_metrics -->|"aggregates"| node_n_db
node_n_api_auth -->|"uses"| node_n_auth_server
node_n_auth_server -->|"sessions"| node_n_db
node_n_auth_client -->|"calls"| node_n_api_auth
node_n_proxy -->|"guards"| node_n_dashboard_layout
node_n_proxy -->|"guards"| node_n_admin_panel

click node_n_root_layout "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/layout.jsx"
click node_n_public_layout "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/layout.jsx"
click node_n_dashboard_layout "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/layout.jsx"
click node_n_home "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/page.jsx"
click node_n_browse "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/browse-wisdom/page.jsx"
click node_n_browse_detail "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/browse-wisdom/[id]/page.jsx"
click node_n_profile "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/profile/[id]/page.jsx"
click node_n_upgrade "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/upgrade/page.jsx"
click node_n_signin "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/sign-in/page.jsx"
click node_n_signup "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/sign-up/page.jsx"
click node_n_payment_success "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/payment-success/page.jsx"
click node_n_shader "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/shader/page.jsx"
click node_n_dashboard_home "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/page.jsx"
click node_n_add_lesson "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/add-lesson/page.jsx"
click node_n_edit_lesson "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/edit-lesson/[id]/page.jsx"
click node_n_my_lessons "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/my-lessons/page.jsx"
click node_n_favorites "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/favorites/page.jsx"
click node_n_earnings "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/earnings-history/page.jsx"
click node_n_admin_panel "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/admin-panel/page.jsx"
click node_n_api_lessons "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/route.js"
click node_n_api_lesson "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/[id]/route.js"
click node_n_api_interactions "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/[id]/comments/route.js"
click node_n_api_users "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/users/[id]/route.js"
click node_n_api_dashboard_metrics "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/dashboard/metrics/route.js"
click node_n_api_dashboard_favorites "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/dashboard/favorites/route.js"
click node_n_api_admin_metrics "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/admin/metrics/route.js"
click node_n_api_auth "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/auth/[...all]/route.js"
click node_n_api_checkout "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/checkout/route.js"
click node_n_api_verify "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/checkout/verify/route.js"
click node_n_api_webhook "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/webhooks/stripe/route.js"
click node_n_db "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/db.js"
click node_n_auth_server "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/auth.js"
click node_n_auth_client "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/auth-client.js"
click node_n_proxy "https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/proxy.js"

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_n_root_layout,node_n_public_layout,node_n_home,node_n_browse,node_n_browse_detail,node_n_profile,node_n_upgrade,node_n_signin,node_n_signup,node_n_payment_success,node_n_shader toneBlue
class node_n_dashboard_layout,node_n_dashboard_home,node_n_add_lesson,node_n_edit_lesson,node_n_my_lessons,node_n_favorites,node_n_earnings,node_n_admin_panel toneAmber
class node_n_api_lessons,node_n_api_lesson,node_n_api_interactions,node_n_api_users,node_n_api_dashboard_metrics,node_n_api_dashboard_favorites,node_n_api_admin_metrics,node_n_api_auth,node_n_api_checkout,node_n_api_verify,node_n_api_webhook,node_n_db,node_n_auth_server,node_n_auth_client,node_n_proxy toneMint
```

## Components

### Public UI

Landing, browse, profile, auth entry pages, and experimental views.

- [App shell](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/layout.jsx): next layout · Global app layout and top-level shell for all routes. · `src/app/layout.jsx`
- [Public shell](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/layout.jsx): route group layout · Layout for the common public-facing route group. · `src/app/(common)/layout.jsx`
- [Home](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/page.jsx): landing page · Public homepage and entry point. · `src/app/(common)/page.jsx`
- [Browse](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/browse-wisdom/page.jsx): content browse page · Public lesson browsing and discovery list. · `src/app/(common)/browse-wisdom/page.jsx`
- [Lesson view](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/browse-wisdom/[id]/page.jsx): lesson detail page · Public lesson detail view with social interaction context. · `src/app/(common)/browse-wisdom/[id]/page.jsx`
- [Profile](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/profile/[id]/page.jsx): user profile page · Public profile view for a specific user. · `src/app/(common)/profile/[id]/page.jsx`
- [Upgrade](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(common)/upgrade/page.jsx): premium info page · Public upgrade messaging and premium conversion entry. · `src/app/(common)/upgrade/page.jsx`
- [Sign in](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/sign-in/page.jsx): auth page · Public sign-in entry point. · `src/app/sign-in/page.jsx`
- [Sign up](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/sign-up/page.jsx): auth page · Public sign-up entry point. · `src/app/sign-up/page.jsx`
- [Payment done](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/payment-success/page.jsx): checkout result page · Post-payment success page. · `src/app/payment-success/page.jsx`
- [Shader demo](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/shader/page.jsx): visual page · Isolated shader/visual experiment page. · `src/app/shader/page.jsx`

### Dashboard UI

Protected creator/admin workspace and account management pages.

- [Dashboard shell](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/layout.jsx): route group layout · Layout for the protected dashboard route group. · `src/app/(dashboard)/layout.jsx`
- [Dashboard](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/page.jsx): workspace home · Authenticated dashboard landing page. · `src/app/(dashboard)/dashboard/page.jsx`
- [Add lesson](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/add-lesson/page.jsx): creator form page · Dashboard page for creating lessons. · `src/app/(dashboard)/add-lesson/page.jsx`
- [Edit lesson](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/edit-lesson/[id]/page.jsx): creator edit page · Dashboard page for editing a specific lesson. · `src/app/(dashboard)/dashboard/edit-lesson/[id]/page.jsx`
- [My lessons](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/my-lessons/page.jsx): creator list page · Dashboard page for owned lessons. · `src/app/(dashboard)/dashboard/my-lessons/page.jsx`
- [Favorites](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/favorites/page.jsx): account page · Dashboard page for saved lessons. · `src/app/(dashboard)/dashboard/favorites/page.jsx`
- [Earnings](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/dashboard/earnings-history/page.jsx): account page · Dashboard page for earnings history. · `src/app/(dashboard)/dashboard/earnings-history/page.jsx`
- [Admin panel](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/(dashboard)/admin-panel/page.jsx): admin page · Administrative dashboard page. · `src/app/(dashboard)/admin-panel/page.jsx`

### API & Backend

Route handlers, auth, persistence, payments, and server-side integration points.

- [Lessons API](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/route.js): content CRUD API · Primary lesson collection endpoints for create, read, update, and delete. · `src/app/api/lessons/route.js`
- [Lesson API](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/[id]/route.js): lesson detail API · Per-lesson read and update endpoint. · `src/app/api/lessons/[id]/route.js`
- [Lesson actions](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/lessons/[id]/comments/route.js): interaction API · Like, favorite, comment, and daily-count endpoints for lessons. · `src/app/api/lessons/[id]/comments/route.js`
- [Users API](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/users/[id]/route.js): user profile API · User profile data endpoint. · `src/app/api/users/[id]/route.js`
- [Creator metrics](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/dashboard/metrics/route.js): analytics API · Dashboard-scoped metrics endpoint. · `src/app/api/dashboard/metrics/route.js`
- [Dashboard favorites](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/dashboard/favorites/route.js): account API · Authenticated favorites endpoint for dashboard views. · `src/app/api/dashboard/favorites/route.js`
- [Admin metrics](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/admin/metrics/route.js): reporting API · Administrative metrics endpoint. · `src/app/api/admin/metrics/route.js`
- [Auth API](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/auth/[...all]/route.js): auth backend · Catch-all authentication backend route. · `src/app/api/auth/[...all]/route.js`
- [Checkout API](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/checkout/route.js): payments API · Payment checkout initiation endpoint. · `src/app/api/checkout/route.js`
- [Verify payment](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/checkout/verify/route.js): payments API · Checkout verification and entitlement update endpoint. · `src/app/api/checkout/verify/route.js`
- [Stripe webhook](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/app/api/webhooks/stripe/route.js): payments webhook · External payment-provider webhook handler. · `src/app/api/webhooks/stripe/route.js`
- [Database](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/db.js): db client · Central database connection and persistence helper. · `src/lib/db.js`
- [Auth server](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/auth.js): auth helper · Server-side auth helpers and session logic. · `src/lib/auth.js`
- [Auth client](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/lib/auth-client.js): auth helper · Client-side auth helper module. · `src/lib/auth-client.js`
- [Route proxy](https://github.com/prodip-shadow/digital-life-lessons/blob/main/src/proxy.js): request gate · Request-time protection and routing guard for protected areas. · `src/proxy.js`

## Connections

- App shell → Public shell: wraps · Global shell delegates into the public route group layout.
- App shell → Dashboard shell: wraps · Global shell delegates into the protected dashboard layout.
- Public shell → Home: serves · Public layout frames the landing page.
- Public shell → Browse: serves · Public layout frames browsing.
- Public shell → Lesson view: serves · Public layout frames lesson detail pages.
- Public shell → Profile: serves · Public layout frames profile viewing.
- Public shell → Upgrade: serves · Public layout frames upgrade messaging.
- Public shell → Sign in: serves · Public layout includes sign-in entry.
- Public shell → Sign up: serves · Public layout includes sign-up entry.
- Public shell → Payment done: serves · Public layout includes checkout success page.
- Public shell → Shader demo: serves · Public layout includes the isolated visual page.
- Dashboard shell → Dashboard: serves · Dashboard layout frames the workspace landing page.
- Dashboard shell → Add lesson: serves · Dashboard layout frames lesson creation.
- Dashboard shell → Edit lesson: serves · Dashboard layout frames lesson editing.
- Dashboard shell → My lessons: serves · Dashboard layout frames owned lessons.
- Dashboard shell → Favorites: serves · Dashboard layout frames saved lessons.
- Dashboard shell → Earnings: serves · Dashboard layout frames earnings views.
- Dashboard shell → Admin panel: serves · Dashboard layout frames admin tools.
- Home → Lessons API: loads content · Homepage surfaces featured lessons and browse content.
- Browse → Lessons API: lists · Browse page reads lesson collection data.
- Lesson view → Lesson API: reads · Lesson view loads a single lesson.
- Lesson view → Lesson actions: interacts · Lesson detail uses social actions and counts.
- Profile → Users API: loads · Profile page reads user data.
- Add lesson → Lessons API: creates · Creator form posts new lessons.
- Edit lesson → Lesson API: updates · Lesson editor saves changes to a specific lesson.
- My lessons → Lessons API: manages · Owned lessons list is backed by lesson CRUD data.
- Favorites → Dashboard favorites: loads · Saved lessons view reads dashboard favorites.
- Earnings → Creator metrics: loads · Earnings history is paired with creator metrics.
- Admin panel → Admin metrics: loads · Admin panel consumes administrative reporting.
- Sign in → Auth API: authenticates · Sign-in is backed by the auth route handler.
- Sign up → Auth API: authenticates · Sign-up is backed by the auth route handler.
- Payment done → Verify payment: confirms · Success page aligns with checkout verification.
- Upgrade → Checkout API: starts checkout · Upgrade flow initiates payment checkout.
- Checkout API → Stripe webhook: completes via · Checkout state is finalized through webhook-driven updates.
- Stripe webhook → Database: persists · Webhook updates payment and entitlement state in storage.
- Lessons API → Database: reads/writes · Lesson CRUD is backed by the database layer.
- Lesson API → Database: reads/writes · Single-lesson route persists lesson changes.
- Lesson actions → Database: records · Interactions are stored through the database layer.
- Users API → Database: reads · User profiles are read from storage.
- Creator metrics → Database: aggregates · Creator metrics are computed from persisted data.
- Dashboard favorites → Database: reads · Dashboard favorites come from storage.
- Admin metrics → Database: aggregates · Admin metrics are computed from persisted data.
- Auth API → Auth server: uses · Auth backend delegates to server-side auth helpers.
- Auth server → Database: sessions · Server auth state depends on persistence.
- Auth client → Auth API: calls · Client auth helper talks to the auth backend.
- Route proxy → Dashboard shell: guards · Request-time proxy protects dashboard routes.
- Route proxy → Admin panel: guards · Proxy also protects admin access.
