The runnable application is the MERN app in client/ and server/. The older
neonatal-milk-management/ folder is a separate Flask/MySQL scaffold; it is not
used by the React/Vite front end.
In PowerShell, configure the API:
Set-Location .\server
Copy-Item .env.example .env
Edit server/.env and set MONGO_URI to a development database, for example:
MONGO_URI=mongodb://127.0.0.1:27017/neonatal_milk_mgmt
Install dependencies and start the API:
npm install
npm run dev
In a second PowerShell window, start the web app:
Set-Location .\client
Copy-Item .env.example .env
npm install
npm run dev
Open the Vite URL printed in the client terminal (default:
http://localhost:5173). The Vite development proxy forwards /api requests to
http://localhost:5000. For a deployed client, set VITE_API_URL to the
deployed API base URL.
With MongoDB running and server/.env configured, run:
Set-Location .\server
npm run seed
Seeding is additive and safe to re-run: it creates missing demo accounts and
records but does not drop the database, replace existing passwords, or reset
workflow state. Use a dedicated development database in MONGO_URI; do not
use these demonstration credentials in production.
The demo password for accounts newly created by the seed script is
password123:
| Role | Seeded state | |
|---|---|---|
| Admin | admin@nmm.com |
Active |
| Hospital | hospital1@nmm.com |
Approved, 300 ml O+ in stock |
| Hospital | hospital2@nmm.com |
Approved |
| Hospital | hospital3@nmm.com |
Pending admin approval |
| Donor | donor1@nmm.com |
Screening approved; collected donation |
| Donor | donor2@nmm.com |
Screening approved; verified donation |
| Donor | donor3@nmm.com |
Screening pending; pending donation |
| Recipient | recipient1@nmm.com |
Registered O+ baby and emergency request |
| Recipient | recipient2@nmm.com |
Registered A+ baby |
If an account with one of these emails already exists, the seeder preserves its password. Use a fresh development database if you need to guarantee the demo passwords.
admin@nmm.com, approve hospital3@nmm.com, and confirm it can
then sign in as a hospital.hospital1@nmm.com. In Donor Screening, approve the pending
screening for Donor 3. In Donation Queue, verify that donor’s pending
donation. The donor will see its token and QR code.recipient1@nmm.com. The seeded emergency 150 ml request is
already in the hospital queue. Try the 400 ml request to confirm that an
over-stock acceptance is rejected; accept the 150 ml request to generate
its token and reserve the required stock.The expiry cron runs daily at midnight. To run the same expiry check
immediately after setting a collected donation’s expiryDate in the past, use:
Set-Location .\server
npm run check-expiry
Set-Location .\client
npm run build
See DEPLOYMENT.md for production environment settings, hosting guidance, and a post-deployment verification checklist.