This project implements a system for scheduling appointments with two doctors. Appointments can vary in length and are subject to the working hours of each doctor.
-
Appointment Model:
- Represents an appointment with one of the two doctors.
- Appointments can be of arbitrary length (e.g., 20 mins, 45 mins, 60 mins).
-
Doctor Schedule Model:
- Represents the working hours of each doctor.
- Doctor Strange works from 9 AM to 5 PM, Monday to Friday.
- Doctor Who works from 8 AM to 4 PM, Monday to Friday.
- Assumption: Working hours remain consistent every week.
-
Create Appointment API:
- Allows creating appointments, ensuring no conflicts with existing appointments.
- Rejects appointment creation if there's a scheduling conflict.
-
Get Appointments within Time Window API:
- Retrieves all appointments within a specified time window for a given doctor.
- Useful for querying appointments for a specific doctor within a particular timeframe.
-
Get First Available Appointment API:
- Enables patients to find the first available appointment after a specified time.
- Useful for patients seeking immediate appointments.
To deploy the project to Google Cloud Platform (GCP), follow these steps:
- Ensure you have a valid
project_id
set up in your GCP account. - Set up a Cloud SQL instance.
- Run the following commands for deployment:
Replace
gcloud builds submit --tag gcr.io/PROJECT-ID/opp_appointment gcloud run deploy --image gcr.io/PROJECT-ID/opp_appointment --platform managed
PROJECT-ID
with your actual GCP project ID.
- This system assumes a simple scheduling scenario with fixed working hours for each doctor.
- Further enhancements can include support for recurring appointments, notifications, and user authentication.
- Continuous testing and monitoring are recommended to ensure the reliability and scalability of the system.
All the tests can be run via pytest
inside of the src/tests directory
python -m pytest tests
python3 src/app.py