How haseebshahbaz/morent_carrental_marketplace works
Main System Components
a) Frontend Layer:
• Next.js Application (Client-side)
• Components Structure
• Landing Page Components
• Admin Dashboard
• Authentication Components
• Car Details Components
• Payment Components
• Profile Management
• UI Components Library
b) Backend Layer:
• Next.js API Routes (/api)
• Authentication System (NextAuth.js)
• Sanity CMS Integration
c) Database Layer:
• Sanity.io (Content Management)
• Schema Types:
• Cars
• Bookings
• Reviews
• Customers
• Locations
• Admin
Component Relationships
a) Client-Server Flow:
• API routes handling different functionalities:
• Car Management
• Bookings
• Reviews
• Profile Updates
• Image Upload
• Search Functionality
b) Authentication Flow:
• NextAuth integration
• Sign-in process
• Protected routes
• Session management
c) Data Flow:
• Sanity Client interactions
• Image handling
• Real-time updates
Specific Implementation Details
Technical aspects:
a) Frontend Architecture:
• App Router structure (/src/app)
• Component hierarchy
• State management
• Client-side routing
b) API Layer:
• RESTful endpoints
• Authentication middleware
• Image upload handling
• Search functionality
a) User Interface Layer:
• Public pages (Home, Car Details, Category)
• Protected pages (Profile, Payment, Admin)
• Authentication views
b) Application Layer:
• API Routes
• Middleware
• Server-side functions
c) Data Layer:
• Sanity schemas
• Content management
• File storage
d) External Services:
• Authentication providers
• Image hosting
• Payment processing
Additional Notes
Aspects:
• Error handling flow
• Security measures
• Caching strategy
• Performance optimizations
• Scalability considerations