How bilalshabbir31/akw-consultants-assessment works
Main Components
• Frontend (Client):
• Components: A React (Vite-based) application structured under the client directory.
• Key folders: src (contains components like admin, auth, user, common, pages, assets, config, and state management files found in the store directory).
• Purpose: Provide separate views for users (home page, KYC submission) and admins (dashboard, requests review).
• Backend (Server):
• Components: Express.js (or similar Node-based server) application located in the server directory.
• Key folders and files:
▪ config (includes DB configuration for MongoDB and Cloudinary integration)
▪ controllers (divided into admin, auth, and user handling KYC actions)
▪ models (defines data schemas for User and KYC)
▪ routes (defines endpoints organized by user role – admin, auth, and user)
▪ middleware and utilities (auth verification and file uploading logic)
• Purpose: Handle API requests, authentication, KYC processing, and file management.
• Database:
• MongoDB is used with Mongoose ORM for flexibility in managing unstructured data.
• External Services:
• Cloudinary: Used for document storage, integrated via configuration and utility modules.
• Render: Deployment platform for both the client and server applications.
Relationships and Interactions
• Data Flow:
• The client interacts with the server using HTTP requests (Axios is configured in the client’s src/config directory).
• On the frontend, user actions (login, registration, submitting KYC requests) send requests to the appropriate API routes on the backend.
• The backend processes these requests using controllers, communicates with the database to store or retrieve data, and uses Cloudinary via utility functions for file uploads.
• Component Interaction:
• The admin panel on the frontend communicates with the server endpoints under routes/admin for request verification.
• The user pages communicate with the endpoints under routes/user to submit and track requests.
• Auth components interact with routes/auth to manage user authentication and registration.
Architectural Patterns and Technical Stack
• Use of a clear separation between frontend and backend (full-stack application) with dedicated directories.
• Patterns observed in MVC-like organization on the backend (models, controllers, and routes).
• State management on the client is separated into slices (auth-slice, admin KYC, user KYC) indicating a Redux or similar architecture.
• Clear modular division that supports scalability (e.g., separate admin and user functionalities).