A secure, role-based patient case management system for NHS doctors with patient invitation and management capabilities.
- Doctor registration with email verification
- Secure JWT-based authentication
- Doctor can invite patients via email
- Patient registration via invite links
- Role-based access control (RBAC)
- Secure password handling with bcrypt
- Email notifications using MailHog (development)
- Docker and Docker Compose
- Node.js (for development)
- Postman (for testing, optional)
-
Clone the repository:
git clone https://github.com/burrows99/Patient-Case-Notes-System.git cd Patient-Case-Notes-System -
Start the services:
docker-compose up -d
-
The application will be available at:
- API: http://localhost:4000
- MailHog (for viewing sent emails): http://localhost:8025
All API endpoints are prefixed with /api
curl -X POST http://localhost:4000/api/doctor/register \
-H "Content-Type: application/json" \
-d '{
"email": "doctor@example.com",
"password": "SecurePass123!"
}'# Use the verification link sent to the doctor's email
curl -X GET "http://localhost:4000/api/doctor/verify?token=VERIFICATION_TOKEN"curl -X POST http://localhost:4000/api/doctor/login \
-H "Content-Type: application/json" \
-d '{
"email": "doctor@example.com",
"password": "SecurePass123!"
}'curl -X POST http://localhost:4000/api/doctor/invite \
-H "Content-Type: application/json" \
-H "Authorization: Bearer DOCTOR_JWT_TOKEN" \
-d '{
"email": "patient@example.com"
}'curl -X POST http://localhost:4000/api/patient/register \
-H "Content-Type: application/json" \
-d '{
"inviteToken": "INVITE_TOKEN_FROM_EMAIL",
"password": "PatientPass123!"
}'curl -X POST http://localhost:4000/api/patient/login \
-H "Content-Type: application/json" \
-d '{
"email": "patient@example.com",
"password": "PatientPass123!"
}'A Postman collection is included in the repository at server/Patient_Case_Notes_System.json. You can import this collection into Postman to test all the API endpoints with pre-configured requests.
To import:
- Open Postman
- Click "Import"
- Select the
Patient_Case_Notes_System.jsonfile - Set up environment variables in Postman:
baseURL:http://localhost:4000token: (Will be set automatically after login)
Create a .env file in the server directory with the following variables:
NODE_ENV=development
PORT=4000
JWT_SECRET=your_jwt_secret_key
DB_HOST=postgres
DB_PORT=5432
DB_NAME=nhs
DB_USER=postgres
DB_PASSWORD=postgres
SMTP_HOST=mailhog
SMTP_PORT=1025
BASE_URL=http://localhost:4000docker-compose exec server npm testdocker-compose exec server npx sequelize-cli db:migrateThis project is licensed under the Apache License - see the LICENSE file for details.