This is a patient management dashboard application with a React frontend and a Node.js (Express) backend.
patient-dashboard/
├── backend/
└── frontend/
- Node.js (v18 or later recommended)
- npm or yarn
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in thebackenddirectory and add the following Firebase configuration variables. You can get these from your Firebase project settings.FIREBASE_API_KEY=your_firebase_api_key FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com FIREBASE_PROJECT_ID=your_project_id FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id FIREBASE_APP_ID=your_app_id FIREBASE_MEASUREMENT_ID=your_measurement_id -
Run the backend server:
npm run dev
The server will start on the default port (usually 3000 or specified in your environment).
-
Navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.localfile in thefrontenddirectory and add the URL of your backend server.VITE_API_URL=http://localhost:3001Note: Make sure the port matches the one your backend server is running on.
-
Run the frontend development server:
npm run dev
The application will be available at
http://localhost:5173(or another port if 5173 is busy).
All endpoints are prefixed with /api. The main resource is /patients.
| Method | Endpoint | Description |
|---|---|---|
POST |
/patients |
Creates a new patient. |
GET |
/patients |
Retrieves all patients. |
GET |
/patients/:id |
Retrieves a single patient. |
PUT |
/patients/:id |
Updates a patient. |
DELETE |
/patients/:id |
Deletes a patient. |
The application uses Firestore. The patients collection has documents with the following structure:
| Field | Type | Description |
|---|---|---|
id |
string |
(auto-generated by Firestore) |
firstName |
string |
Patient's first name. |
middleName |
string |
(Optional) Patient's middle name. |
lastName |
string |
Patient's last name. |
dob |
string |
Patient's date of birth (YYYY-MM-DD). |
status |
string |
"Inquiry", "Onboarding", "Active", "Churned" |
city |
string |
Patient's city. |
state |
string |
Patient's state or province. |
zipCode |
string |
Patient's zip or postal code. |