How m-manish-thakur/dribble-clone works
Main Components
A. Frontend Layer:
• Next.js Application (Client-Side)
• Auth Pages (/auth/signin, /auth/signup)
• Main Application Pages (/[username], /account)
• Components (Common, UI, Account)
• UI Components Layer (Shadcn UI integration)
B. Backend Layer:
• Next.js API Routes (/api)
• Authentication endpoints
• User management endpoints
• Middleware (src/middleware.js)
• Service Layer (src/lib)
C. Data Layer:
• Prisma ORM
• PostgreSQL Database
• User Model
• Profile Model
• Session Model
• Followers/Following Models
D. Authentication System:
• NextAuth.js integration
• Google OAuth provider
• Email/Password authentication
Component Relationships
• Frontend → API Routes (HTTP requests)
• API Routes → Prisma Client
• Prisma Client → PostgreSQL
• NextAuth → Authentication Providers
• Middleware → API Routes (for request validation)
Specific Implementation Details
• Image Upload System (src/utils/uploadImage.js)
• Email Services (src/lib/emailServices.js)
• Input Validation (src/lib/emailValidator.js)
[Client Layer (Browser)]
• ↓
[Next.js Frontend]
• ↓
[API Routes Layer]
• ↓
[Service Layer]
• ↓
[Data Access Layer]
• ↓
[Database Layer]
Notes for Implementation
• Use clear boundaries between different layers
• File structure organization where relevant
• Scalability points
• Security boundaries
• Error handling flows
Remember to emphasize the full-stack nature of Next.js in this application, showing how it handles both client and server-side concerns in a unified way.