A modular patient follow-up system for doctors and nurses to manage post-surgery patient follow-up calls.
- Framework: ASP.NET Core (.NET 10) Web API
- Database: SQLite with Entity Framework Core
- Authentication: JWT-based auth with ASP.NET Identity
- Orchestration: .NET Aspire
- Framework: React 19 with TypeScript
- Build Tool: Vite 7
- Routing: React Router v7
- Styling: CSS Modules
├── src/
│ ├── AppHost/ # .NET Aspire orchestration
│ ├── backend/ # ASP.NET Core Web API
│ ├── frontend/ # React + Vite frontend
│ └── ServiceDefaults/ # Shared Aspire service defaults
└── docs/ # Step-by-step implementation guides
This runs both backend and frontend together with automatic configuration:
cd src/AppHost
dotnet runThe Aspire dashboard will show you the URLs for both services.
cd src/backend
dotnet runThe API will be available at https://localhost:7022 (or the port shown in console).
cd src/frontend
npm install
npm run devThe frontend will be available at http://localhost:5173.
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=patient_followup.db"
},
"Jwt": {
"Key": "YourSuperSecretKeyThatIsAtLeast32CharactersLong!",
"Issuer": "PatientFollowup.Api",
"Audience": "PatientFollowup.Client",
"ExpiryInMinutes": 60
},
"N8n": {
"BaseUrl": "http://localhost:5678",
"StartFollowupPath": "/webhook/start-patient-followup",
"WebhookSecret": "your-n8n-webhook-secret"
},
"Backend": {
"BaseUrl": "https://localhost:7022"
}
}The frontend reads the API URL from the VITE_API_URL environment variable. When running with Aspire, this is automatically configured. When running separately, create a .env file:
VITE_API_URL=https://localhost:7022The system seeds the following users in development mode:
| Password | Role | |
|---|---|---|
| doctor@friya.com | Password123! | Doctor |
| nurse@friya.com | Password123! | Nurse |
The system integrates with n8n for automated follow-up calls:
- Runs every 1 minute
- Finds pending follow-ups where
ScheduledAt <= now - Sends POST request to n8n with patient information
POST /api/webhooks/followups/{followUpCallId}/result
{
"status": "Completed" | "Failed" | "NeedsEscalation",
"outcomeSummary": "string",
"needsEscalation": boolean
}Header: X-N8N-SECRET: your-n8n-webhook-secret
POST /api/webhooks/followups/{followUpCallId}/escalation-note
{
"nurseEmail": "optional",
"note": "string"
}Header: X-N8N-SECRET: your-n8n-webhook-secret
# Simulate a completed call
curl -X POST https://localhost:7022/api/webhooks/followups/{followUpCallId}/result \
-H "Content-Type: application/json" \
-H "X-N8N-SECRET: your-n8n-webhook-secret" \
-d '{"status": "Completed", "outcomeSummary": "Patient is doing well", "needsEscalation": false}'
# Simulate an escalation
curl -X POST https://localhost:7022/api/webhooks/followups/{followUpCallId}/result \
-H "Content-Type: application/json" \
-H "X-N8N-SECRET: your-n8n-webhook-secret" \
-d '{"status": "NeedsEscalation", "outcomeSummary": "Patient reported side effects", "needsEscalation": true}'POST /api/auth/login- Login with email/passwordPOST /api/auth/register- Register new user (dev only)GET /api/users/me- Get current user info
GET /api/patients- List patients (paginated, searchable)GET /api/patients/{id}- Get patient detailsPOST /api/patients- Create patientPUT /api/patients/{id}- Update patientDELETE /api/patients/{id}- Delete patient
GET /api/patients/{patientId}/followups- List patient's follow-upsPOST /api/patients/{patientId}/followups- Schedule follow-upGET /api/followups/{id}- Get follow-up detailsPUT /api/followups/{id}- Update follow-up statusGET /api/followups?status=NeedsEscalation- List escalationsGET /api/followups/{id}/escalation-notes- Get escalation notesPOST /api/followups/{id}/escalation-notes- Add escalation note
GET /api/dashboard/summary- Get dashboard metrics
- Patient Management: Add, edit, and manage patient records
- Follow-up Scheduling: Schedule and track follow-up calls
- Automated Calls: Integration with n8n for automated patient calls
- Escalation Workflow: Nurses can view and resolve escalated cases
- Dashboard: Overview of patients, upcoming calls, and escalations
- Role-based Access: Different views for Doctors and Nurses
cd src/backend
dotnet ef migrations add <MigrationName>
dotnet ef database update# Backend
cd src/backend
dotnet test
# Frontend
cd src/frontend
npm testMIT