How amine-tayani/onyxapp works
Main System Components
a) Client Layer:
• Next.js Frontend (src/app directory structure)
• Marketing Pages (src/app/(marketing))
• Authentication Pages (src/app/(auth))
• Dashboard Interface (src/app/dashboard)
• UI Components (src/components/ui)
b) API Layer:
• Next.js API Routes (src/app/api)
• Authentication Endpoints
• Webhook Handlers (especially for Stripe)
• File Upload Handlers (UploadThing integration)
c) Database Layer:
• Prisma ORM (prisma/schema.prisma)
• Database Migrations
• Data Models
d) External Services:
• Stripe Payment Processing
• Email Service
• Authentication Providers
• File Storage (UploadThing)
Component Relationships
• Client → API: Show RESTful/API route connections
• API → Database: Illustrate Prisma ORM interactions
• API → External Services: Display third-party service integrations
• Authentication Flow: Highlight the auth process flow
Specific Implementation Details
Key architectural elements:
┌─────────────────────────────────────────────────────────┐
• Client Layer │
• ┌─────────────┐ ┌─────────────┐ ┌────────────────────┐ │
• Marketing │ │ Auth Pages │ │ Dashboard │ │
• Components │ │ (Login/ │ │ (Applications/ │ │
• Signup) │ │ Settings) │ │
• ┘ └─────────────┘ └────────────────────┘ │
• ┬─────────────────────────────┘
┌───────────────────────────┼─────────────────────────────┐
• API Layer │ │
• ┌─────────────┐ ┌────────┴────┐ ┌──────────────────┐ │
• Auth API │ │ Core API │ │ Webhook Handlers │ │
• Routes │ │ Endpoints │ │ (Stripe) │ │
• ┘ └─────────────┘ └──────────────────┘ │
• ┬─────────────────────────────┘
┌───────────────────────────┼─────────────────────────────┐
• Service Layer │ │
• ┌─────────────┐ ┌────────┴────┐ ┌──────────────────┐ │
• Prisma ORM │ │ Email │ │ Payment │ │
• Service │ │ Processing │ │
• ┘ └─────────────┘ └──────────────────┘ │
• ┬─────────────────────────────┘
┌───────────────────────────┼─────────────────────────────┐
• Database Layer │ │
• ┌─────────────────────────┴─────────────────────────┐ │
• PostgreSQL Database │ │
• ┘ │
• ┘
Notes for Implementation Details
Annotations for:
• Authentication strategies (NextAuth.js implementation)
• Database schema highlights
• API route security measures
• External service integration points
Remember to maintain a balance between detail and clarity, focusing on the core architecture while providing enough detail to understand the system's complete functionality.