How philip2death/it-hosting works
Project Type and Purpose
• This is a full-stack web application template (“IT Hosting Platform”) built with Next.js 15 App Router, Tailwind CSS v4, Turbopack, Prisma, and NextAuth.
• It provides user-facing pages (marketing, docs, dashboard) plus a suite of server/API routes for authentication, user management, support tickets, and settings.
Main Architectural Layers & Components
a. Client Layer (Browser)
• React UI components under src/app and src/components
• Tailwind CSS for styling
• Client-side state/hooks (e.g., SessionProviderWrapper)
b. Frontend / Edge Layer (Next.js App Router)
• Page routes (src/app/**/page.tsx) rendered server-side or statically
• API routes (src/app/api/**/route.ts) implemented as serverless functions
• NextAuth middleware in src/app/api/auth/[...nextauth]
c. Business / Domain Layer
• Route handlers (login, register, profile, settings, support-ticket) contain orchestration logic
• src/lib for shared utilities:
– prisma.ts (Prisma Client instantiation)
– security/env-check.ts (environment validation)
d. Data Layer
• Prisma ORM connected to a PostgreSQL (or MySQL) database
• Database schema and migrations under prisma/
• supabaseClient.js for optional direct Supabase interactions
e. External Services & Infrastructure
• NextAuth providers (OAuth, email, etc.)
• Supabase (optional storage/real-time service)
• Vercel (hosting/deployment)
• GitHub Actions & Playwright for CI/CD & E2E testing
Relationships and Data Flows
• User’s browser ↔ Next.js pages (HTTP/HTTPS)
• Next.js page/server code → API routes (internal fetch)
• API routes → Prisma Client → Database (SQL)
• NextAuth route ↔ Auth provider or credentials store
• supabaseClient ↔ Supabase REST/Realtime API
• CI/CD pipeline: GitHub Actions → build/test → deploy to Vercel
Architectural Patterns & Design Principles
• Layered architecture: presentation, API/business logic, data access
• Serverless functions for each API endpoint (One-to-one mapping: file-based API routing)
• Atomic CSS with Tailwind (no proprietary CSS architecture needed)
• Prisma migrations ensure schema versioning (declarative infra as code)
• App Router organizes code by route rather than by type