How abhinav-phi/medicalq works
Main Components
• Frontend: React 18+ + TypeScript, built with Vite, styled with Tailwind CSS.
• Pages/Features: Authentication (login/register), Home (Hero, Features, Stats), Dashboard (UserDashboard), Doctors (SpecialistDoctors, DoctorPopup), Community (CommunityPlatform, CommunityAds).
• Connects to backend via RESTful APIs.
• Backend: Node.js 20+ + Express.js.
• Modules:
– authController (register, login, profile)
– appointmentController (book, list)
– doctorController (list, filter, profiles)
– communityController (posts CRUD)
– messageController (conversations, send)
• Middleware: JWT+Firebase Auth validation, role-based (patient/doctor/admin), error handling, rate limiting.
• Uses Firebase Admin SDK to read/write Firestore.
• Database: Firebase Firestore.
• Collections: users, doctorProfiles, patientProfiles, credentials, messages, communityPosts, appointments.
• Authentication: Firebase Auth + JWT.
• Frontend obtains Firebase ID token → sends to backend.
• Backend verifies Firebase token, issues its own JWT or proxies Firebase claims.
• Role-based access control enforced in middleware.
• Deployment Platforms:
• Frontend → Vercel (automatic builds on git push).
• Backend → Heroku or Railway or DigitalOcean App Platform.
Relationships & Data Flows
• Frontend → Backend:
• Requests include JWT in Authorization header.
• Backend → Firestore:
• Frontend → Firebase Auth:
• Deployment Flows:
Architectural Patterns & Design Principles
• Three-Tier Architecture:
• Presentation Tier (SPA)
• Application Tier (RESTful API server)
• Data Tier (NoSQL document DB)
• Separation of Concerns:
• UI components vs. business logic vs. data access
• Stateless API:
• JWT-based sessions; horizontal scalability
• Context Providers (AuthContext, ThemeContext) for global state
Technologies & Layers
• Frontend:
• React + TS, Vite, Tailwind CSS, React Context API, Axios/fetch
• Backend:
• Express.js, Firebase Admin SDK, JSON-Web-Token, Winston logger
• Database:
• Firestore (document model)
• Auth:
• Firebase Auth (email/password, Google sign-in)
• JWT for Backend session management
• DevOps:
• CI/CD: GitHub Actions → Vercel & Heroku
• Environment Variables (.env)
Final Checklist
• [ ] All components labeled: Frontend, Backend, Firestore, Firebase Auth, Vercel, Heroku/Railway.
• User → Frontend (UI)
• Frontend → Firebase Auth (login/signup)
• Frontend → Backend (API)
• Backend → Firestore
• CI/CD → Vercel & Heroku/Railway
• [ ] Notes on role-based access (Patient, Doctor, Admin).