How monishatbaishnab/trektales-client works
Main System Components
a) Client Layer:
• Next.js Frontend (src/app directory structure)
• Public Routes ((root) group)
• Protected Routes (dashboard, user-profile)
• Authentication Routes ((auth) group)
b) Server Layer:
• Express.js Backend (referenced in README)
• REST API Endpoints
• JWT Authentication Service
c) External Services:
• Cloudinary (image storage)
• Aamarpay Payment Gateway
• MongoDB Database
Component Organization
a) Frontend Architecture:
• Route groups:
• Public Routes (home, blogs, authors)
• Auth Routes (login, register)
• Protected Routes (dashboard, user-profile)
• User Dashboard
• Admin Dashboard
b) Core Services (src/services):
• Auth Service
• Post Service
• Comment Service
• User Service
c) State Management:
• Context Providers (UserInfoProvider, FilterProvider)
• TanStack Query Integration
Data Flow Representation
• Client-Server Communication (via Axios)
• Authentication Flow
• Image Upload Flow to Cloudinary
• Payment Processing Flow
Specific Implementation Details
Specialized components:
• Form Components (src/components/form)
• UI Components (src/components/ui)
• Module Components (src/components/modules)
• Client Layer |
• [Next.js Frontend] |
• Public Routes |
• Protected Routes |
• Admin Dashboard |
• ↕
• Service Layer |
• [Express Backend] |
• API Endpoints |
• Auth Service |
• ↕
• External Services |
• MongoDB |
• Cloudinary |
• Aamarpay |
Important Details
• Authentication flow with JWT
• Role-based access control (Admin vs Regular users)
• Premium content access flow
• Image upload and storage process
• Payment processing flow
• Data caching strategy with TanStack Query