How abdulwaheed16/thedigitalcoaching-v1225 works
1. This is a Next.js App Router application for “The Digital Coaching,” split into three major surfaces: a public marketing site, an authenticated auth flow, and an admin/dashboard area.
2. The public site lives under app/(public) and covers landing/home, about, blogs, courses, curriculum, fee structure, registration, contact, and tutors. These routes are mostly composition of reusable section components from components/pages/* and shared layout pieces in components/layouts/*.
3. Blog content is a first-class domain. Public blog listing and blog detail pages have route-level loading/error/not-found handling, while the dashboard provides create/edit/preview management for blog posts. This suggests a content workflow with separate public consumption and internal authoring paths.
4. The dashboard under app/dashboard is the operational backend for admins. It includes modules for blogs, bookings, enrollments, messages, media, tutors, and settings, with per-entity detail routes and list views. Most of the interactive UI is organized in components/dashboard/*, especially table, filters, detail panes, status controls, and bulk/action components.
5. Authentication is separated from both public and dashboard app routes. The app/auth area contains sign-in, forgot-password, and reset-password pages, while app/(server)/api/auth/[...nextauth] and auth.ts indicate NextAuth-based session handling. middleware.ts and components/auth/protected-route.tsx enforce access boundaries for protected areas.
6. The backend domain logic is concentrated in lib/actions/*. These actions cover blogs, bookings, enrollments, messages, newsletters, notifications, tutor applications, uploads, users, and auth. In this repo, many UI screens likely call these actions directly rather than going through a separate REST layer.
7. Data persistence appears to be Prisma-backed. prisma/schema.prisma, seed scripts, and config/prisma.ts indicate a relational database as the main system of record for application data such as users, posts, bookings, enrollments, and messages.
8. File and media handling is a separate subsystem. app/(server)/api/uploads/*, lib/supabase/*, lib/supabase-upload.ts, and the dashboard media library components show that uploaded images/files are stored and managed outside the core database, with Supabase used as the storage integration.
9. The app uses a mixed server/client architecture. Server-rendered route segments and route handlers handle data fetching, while client components power forms, tables, dialogs, upload progress, search, and dashboard interaction. React Query support in components/providers/query-provider.tsx and lib/react-query.ts suggests some data is also fetched and cached client-side.
10. Shared business rules are centralized in lib/validations/*, lib/rbac/*, and helper modules under lib/helpers/*. This creates a clear boundary between UI and domain rules such as input validation, permissions, date formatting, and status/color mapping.
11. Cross-cutting UI concerns are handled through providers and global shells: components/providers/* for theme/query/dashboard state, app/layout.tsx and route-specific layouts for app shells, and global styling via app/globals.css, styles/globals.css, and Tailwind config. The dashboard likely has its own header/sidebar layout distinct from the public header/footer.
12. There are also a few external integrations that affect architecture: email templates and transporter code under lib/emails/*, WhatsApp helpers/widgets in lib/whatsapp.ts and components/whatsapp-*, and pixel/analytics support in components/providers/facebook-pixel-provider.tsx and lib/fpixel.ts. These are side-effect systems around lead capture, notifications, and engagement.
13. Static/domain reference data is stored in data/* and public/images/*, including curriculum, programs, testimonials, and lead/message examples. This supports marketing and curriculum pages without requiring a full backend round-trip for every section.
14. Overall, the architecture is a monorepo-style Next.js web app with a strong separation between public content, authenticated admin operations, and server-side domain/data services. The most important diagram boundaries are: public vs dashboard routes, client UI vs server actions/route handlers, database vs file storage, and authentication/authorization as the gatekeeper for dashboard access.
Main entry points: (public) Public site · dashboard Dashboard · actions Server actions · layout.tsx App shell
Components 19
App routes
Public, auth, dashboard, and server route segments
- App shell · Global app layout and cross-cutting app shell
app/layout.tsx - Public site · Landing pages, blogs, curriculum, registration, tutors, and contact
app/(public) - Blog pages · Public blog listing and detail pages with loading/error/not-found states
app/(public)/blogs - Auth pages · Sign-in and password recovery flow
app/auth - Dashboard · Authenticated operational area for content and CRM workflows
app/dashboard - Blog admin · Create, edit, preview, and manage posts in the dashboard
app/dashboard/blogs - Ops modules · Bookings, enrollments, messages, tutors, media, and settings routes
app/dashboard - API routes · NextAuth and upload handlers on the server edge
app/(server)/api
Shared UI
Reusable page sections, layouts, dashboard widgets, and providers
- Page sections · Reusable marketing and content sections composing public pages
components/pages - Shell layouts · Header, footer, sidebar, and dashboard chrome
components/layouts - Dashboard UI · Tables, filters, dialogs, cards, charts, and detail panes for admin screens
components/dashboard - Auth forms · Protected-route wrapper and sign-in/reset/forgot forms
components/auth - Providers · Theme, query, dashboard state, analytics, and app context providers
components/providers
Domain services
Server actions, validation, auth, and integration logic
- Server actions · Blog, booking, enrollment, message, upload, user, auth, and dashboard actions
lib/actions - Validations · Input validation for auth, content, CRM, and notifications
lib/validations - Auth guard · Middleware, protected-route component, and role/permission logic
lib/auth - Integrations · Email, Supabase storage, WhatsApp, pixel tracking, and React Query support
lib
Data & assets
Database schema, seed data, and static media
- Prisma DB · Primary database schema and seeds for users, posts, bookings, enrollments, and messages
prisma/schema.prisma - Static data · Curriculum, programs, testimonials, leads, and public images
data
Connections 25
- App shell → Public site: renders · Root app shell includes the public route segment
- App shell → Auth pages: renders · Root app shell includes the auth route segment
- App shell → Dashboard: renders · Root app shell includes the dashboard route segment
- Public site → Page sections: composes · Public routes are built from reusable section components
- Public site → Shell layouts: uses shell · Public routes use shared header/footer layout pieces
- Blog pages → Page sections: renders · Blog list and detail pages reuse shared blog/content sections
- Dashboard → Blog admin: includes · Dashboard routes expose blog management screens
- Dashboard → Ops modules: includes · Dashboard routes expose operational modules
- Dashboard → Shell layouts: uses shell · Dashboard uses its own header/sidebar chrome
- Blog admin → Dashboard UI: composes · Blog admin pages are assembled from tables, filters, cards, and dialogs
- Ops modules → Dashboard UI: composes · Ops modules rely on the shared dashboard widget set
- Auth pages → Auth forms: uses · Auth pages are driven by shared form components
- Auth pages → Auth guard: protected by · Access to protected flows is gated by middleware and route guards
- API routes → Auth guard: enforces · Server auth endpoints participate in session and access control
- Dashboard → Server actions: calls · Admin screens invoke server actions for mutations and workflows
- Public site → Server actions: calls · Public forms and content pages call server actions for submissions and fetches
- Server actions → Validations: validates with · Server mutations share centralized input schemas and rules
- Server actions → Prisma DB: persists to · Actions read and write the Prisma-backed relational store
- API routes → Integrations: uses · API handlers connect to auth, upload, and storage integrations
- Server actions → Integrations: uses · Domain actions send email, upload files, track analytics, and cache client data
- Ops modules → Static data: reads · Admin and marketing screens draw on static curriculum and content data
- Public site → Static data: reads · Public pages use seeded curricula, testimonials, and media assets
- Auth guard → Prisma DB: reads · Session and permission checks depend on persisted user data
- Providers → Dashboard: wraps · App providers supply theme, query, and dashboard state
- Providers → Public site: wraps · Providers also support the public experience and shared UX systems