3.0 KiB
3.0 KiB
I am working on a full-stack MERN (MongoDB, Express, React, Node.js) web application for tracking vaccination schedules. We are a team of 4, and I need you to act as our Lead Developer.
Here is the full context of the project. Please memorize this architecture and constraints before answering my request.
1. Project Overview
- Name: "Vax-Track" (Vaccination Management System).
- Users: Admins (Government), Hospital Staff, and Public Citizens (Parents/Guardians).
- Core Feature: A "Family/Dependent" architecture where one registered User (Parent) can manage vaccination records and appointments for multiple Dependents (Children/Elders).
2. Tech Stack & Architecture
- Backend: Node.js with Express.js.
- Database: MongoDB (NoSQL) using Mongoose ODM.
- Auth: JWT (JSON Web Tokens) with role-based middleware (Admin, Staff, User).
- Architecture: Monolithic Repo but with "Microservice-style" modular folders. Each module has its own Controllers, Routes, and Models.
3. Team Roles & Responsibilities (STRICT SEPARATION)
We must keep our code contributions distinct to get individual marks. Do not mix these responsibilities when generating code.
-
Minidu (Inventory & Family Identity):
- Features: User Auth, Adding Dependents (Child/Spouse), Managing Vaccine Brands, Managing Stock Batches.
- 3rd Party API: Cloudinary (for uploading vaccine vial images).
- Key Models:
User,Dependent,Vaccine,Batch.
-
Nethmi (Locations & Scheduling):
- Features: Registering Hospitals, Creating Clinic Dates/Events, Managing Capacity.
- 3rd Party API: LocationIQ or Mapbox (converts address strings to Lat/Long coordinates).
- Key Models:
Hospital,Clinic.
-
Saniru (Appointments & Queue):
- Features: Booking Appointments (checking quota), Canceling, Viewing Schedule.
- Logic: Must handle booking for "Self" OR "Dependent".
- 3rd Party API: goqr.me API (generates QR code for appointment pass).
- Key Models:
Appointment.
-
Kaveen (Records & Notifications):
- Features: Marking patients as "Vaccinated" (Doctor view), Digital Vaccination Card, Email Alerts.
- 3rd Party API: SendGrid or Nodemailer (sends confirmation emails).
- Key Models:
Record,SideEffect.
4. Database Relationships (The Logic)
- Users have 0 or more Dependents.
- Appointments link to a
Clinicand aUser. They optionally link to aDependent.- Logic: If
dependentIdis null, it's for the User. If set, it's for the child.
- Logic: If
- Records link to a specific
Batch(for tracking) and a specificPatient(User or Dependent).
5. Current Goal
- We are working on Milestone 1 (Backend Focus).
- We need RESTful APIs that return JSON.
- All endpoints must handle errors gracefully (400, 404, 500).
MY REQUEST: [TYPE YOUR QUESTION HERE - e.g., "Create the Mongoose schema for Minidu's Vaccine module" or "Write the Controller logic for Saniru's appointment booking"]