How genzz-dev/quickclinic works
Project Type & Purpose
• This is a full-stack MERN application called QuickClinic that streamlines clinic workflows for three user roles (Admin, Doctor, Patient).
• Frontend: React + Vite + TailwindCSS.
• Backend: Node.js + Express + MongoDB.
• Key features: role-based dashboards, JWT auth, Google Maps integration, geolocation, appointment booking, prescription tracking.
High-Level File Structure Analysis
• Top level:
• client/ → Vite-powered React UI (components/, pages/, routes/, service/, context/)
• server/ → Express API (Controllers/, Routes/, Middleware/, models/, services/, config/)
• This separation indicates a classic client ↔ REST API ↔ database architecture.
• Backend follows an MVC-style organization (Controllers → Services → Models) and middleware for auth, uploads, etc.
a. Main Components
• User Clients (Web Browser)
• Frontend App (React + Vite + Tailwind)
• API Gateway (Express Server)
• Business Logic Layer (Controllers & Services)
• Data Layer (MongoDB via Mongoose Models)
• External Services:
– Google Maps API
– IP Geolocation Service
– Email/OTP Service
– Cloudinary or file‐upload service
b. Relationships & Data Flows
1. Browser ↔ Frontend Routes & Components
2. Frontend (service/*) → HTTP(S) calls to Express endpoints with JWT
3. Express Middleware → Authentication & Role-Based Guards
4. Controllers invoke Services → talk to MongoDB (CRUD) and external APIs
5. Services → optional side-effects (send email/OTP, upload files, geocode address)
c. Architectural Patterns
• Client-Server (separate repo for client & server)
• MVC on backend (Controllers → Services → Models)
• Component-based UI with Context for auth state
• Route guards enforce RBAC
• Token-based stateless auth (JWT)
d. Key Technologies
• React, Vite, TailwindCSS
• Express, Mongoose, MongoDB
• JWT (access + refresh)
• Google Maps, IP Geolocation, Email/OTP, Cloudinary