Skip to content

Latest commit

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CareSync

A system for managing clinic appointments, doctor schedules, and resources, helping streamline operations and improve patient booking efficiency.

Database Setup

The API targets SQL Server LocalDB ((localdb)\mssqllocaldb, database CareSyncDb).

  1. Apply migrations — from the solution root:

    dotnet ef database update --project CareSyncSolution/CareSyncAPI
    

    (equivalent to Update-Database in the Visual Studio Package Manager Console).

  2. Seed data — seeding runs automatically on API startup. Program.cs calls DbSeeder.SeedAsync (CareSyncAPI/Data/DbSeeder.cs), so just run the API once:

    dotnet run --project CareSyncSolution/CareSyncAPI
    

    The seeder is idempotent — every section checks for existing rows first, so restarts are safe. It creates roles, appointment statuses, specializations, users, doctor/patient profiles, doctor availability, and sample appointments.

DbSeeder (run via Program.cs) is the source of truth for seed data. Scripts/SeedData.sql is a standalone SQL alternative covering the same data.

API Endpoints

RouteMethodAuthPurpose
/api/auth/loginPOSTNoneLogin, returns JWT token
/api/appointments/lookupGETNonePublic patient lookup by CPR (+ optional ref number)
/api/appointmentsGETJWTGet all appointments
/api/appointments/myGETJWT + PatientGet current patient's appointments
/api/appointments/todayGETJWT + Receptionist/ManagerToday's appointments queue
/api/appointments/available-slotsGETJWTAvailable time slots for a doctor on a date
/api/appointmentsPOSTJWT + Patient/ReceptionistCreate a new appointment
/api/appointments/{id}/statusPUTJWTUpdate appointment status (confirm, check-in, cancel)
/api/doctorsGETJWTGet all active doctors
/api/doctors/{id}GETJWTGet doctor by ID with availability
/api/doctors/by-specialization/{specId}GETJWTGet doctors filtered by specialization
/api/specializationsGETJWTList all specializations
/api/patients/meGETJWT + PatientGet current patient's profile
/api/patients/me/medical-recordsGETJWT + PatientGet patient's visit records and prescriptions
/api/patients/searchGETJWT + ReceptionistSearch patient by CPR
/api/reports/appointment-statsGETJWT + ManagerAppointment counts by status
/api/reports/doctor-utilizationGETJWT + ManagerAppointments per doctor

Test Credentials

RoleEmailPassword
Managermanager@caresync.localManager@123
Receptionistreception@caresync.localReception@123
Doctordr.smith@caresync.localDoctor@123
Doctordr.jones@caresync.localDoctor@123
Doctordr.ahmed@caresync.localDoctor@123
Doctordr.lee@caresync.localDoctor@123
Doctordr.khan@caresync.localDoctor@123
Patientpatient1@caresync.localPatient@123
Patientpatient2@caresync.localPatient@123
Patientpatient3@caresync.localPatient@123

Seeded Patients & Appointments

Patient CPRs (for the public tracking / lookup page):

PatientCPRRefLogin
Mohammed Ali880101234PAT-0001patient1@caresync.local
Fatima Al-Sayed920315567PAT-0002patient2@caresync.local
James Wilson750722891PAT-0003patient3@caresync.local

Sample appointments created by the seeder (only when the Appointment table is empty; dates are relative to the day the seeder first runs):

PatientDoctorSpecializationWhenTimeStatus
Mohammed AliDr. John SmithCardiology5 days ago10:00Completed
Mohammed AliDr. Ahmed KhalilGeneral Practicein 2 days09:00Requested
Fatima Al-SayedDr. Sarah JonesPediatrics3 days ago11:00Completed
Fatima Al-SayedDr. John SmithCardiology7 days ago09:00Cancelled
James WilsonDr. Ahmed KhalilGeneral Practicetoday14:00Confirmed
James WilsonDr. John SmithCardiologytoday15:00CheckedIn

About

A system for managing clinic appointments, doctor schedules, and resources, helping streamline operations and improve patient booking efficiency.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages