In the project directory, you can run:
Installs all the dependencies required by the webapp. Run this right after cloning the repository in the root folder of the project.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs the backend in the development mode.
- Open Port: http://localhost:5000.
This will also run the seeding script required to populate the data with 10 patients.
You can use Postman to make POST and PATCH requests that are used to create and complete dialysis sessions.
-
URL for the POST requests http://localhost:5000/api/sessions?unitId=A1. Replace the unitID code with another number, whichever one you wish to provide the patient.
-
URL for the PATCH requests: http://localhost:5000/api/sessions/:id. Replace :id with the id acquired when making the POST request to send the data for the post-dialysis data. In BODY, use json format to share it in the payload.
{
"postWeight": int,
"systolicBP": int,
"diastolicBP": int,
"endTime": string,
"notes": string,
}
Launches the test runner.
See the section about running tests for more information.
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
- The source for the maximum weight gain interdialysis: PCMID- PMC9584995
- The source for the maximum systolic BP post-dialysis: PCMID- PMC3320527
- The source for the minimum dialysis session duration: PCMID- PMC3685306
- The source for the maximum dialysis session duration: PCMID- PMC5695674
-
Node.js + Express (TypeScript).
-
In-memory data store (assignment-allowed simplification).
-
Layered architecture (routes → controllers → services).
-
Jest + Supertest for testing.
-
React (TypeScript).
-
React Query for server state management.
-
Modular CSS styling (no UI framework).
server/
├── controllers/
├── routes/
├── services/
├── config/
├── data/
├── scripts/
src/
├── api/
├── components/
├── config/
├── pages/
├── styles/
├── types/
Separation of concerns
-
Routes → HTTP layer
-
Clinical thresholds stored in config (no magic numbers).
-
Anomaly detection is a pure function and fully unit tested.
-
App/server split for testability.
Displays:
-
All patients scheduled today
-
Status: not_started / in_progress / completed
Key session fields:
-
Pre-weight
-
Post-weight
-
Blood pressure
-
Duration
Visual anomaly banner when detected.
Data is saved in memory for assignment purposes.
-
Fast setup
-
No DB dependency
-
No persistence
-
No indexing
-
Not scalable
In production, MongoDB would be appropriate due to:
-
Flexible document schema
-
Natural embedding of session data
-
Indexing on unitId and scheduledDate
On server start:
- 10 synthetic patients generated
Mixed session states:
-
Not started
-
In progress
-
Completed
-
Randomized vitals and anomaly cases
-
Allows instant demo without manual API setup.
Unit Tests:
-
Anomaly detection edge cases
-
Weight mismatch
-
High BP
-
Abnormal duration
POST /api/sessions
Verifies:
-
201 response
-
Correct session structure
Component Test
-
PatientCard
-
Verifies anomaly banner renders conditionally
Majority of the help was taken in describing the visual stricture of the webpage as no mockups were provided and no experience in handling or viewing nurse dashboards.
Besides it, some help was garnished during debugging and defining the data structures for quality improvement and some help with the overall workflow describing for such a project, what should be done first and what not.
Also the description of a good Readme and what it should include and what not were taken from ChatGPT.
During this project, there was an assumption taken by Claude that adding a patient and starting a dialysis session could be combined into a single action. I initially followed that idea and implemented a composite endpoint that created a patient and started a session simultaneously. However, after thinking through the domain model more carefully, I realized that patient registration and session initiation are distinct domain events.
In real clinical workflows, patients may be registered in advance, scheduled for the day, and only later begin treatment. Coupling those two operations tightly could introduce partial state issues and reduce flexibility.
So I refactored the design to:
- Keep patient creation independent
- Automatically schedule them for today
- Allow sessions to be started separately via the dashboard.