This repository contains two related projects: Delman API and Delman Scheduler.
-
Delman API
- A REST API for CRUD operations on employee, patient, doctor, and appointment data.
- Includes login functionality.
- Located in the
delman-apidirectory.
-
Delman Scheduler
- A scheduler that updates vaccine_type and vaccine_count for patient data based on no_ktp every 3 hours.
- Located in the
delman-schedulerdirectory.
- Docker and Docker Compose installed on your system
Before running the applications, please follow these crucial steps:
-
Read the README files in both project folders:
These README files contain important project-specific information and setup instructions.
-
Create a
credentials.jsonfile:- In the
delman-schedulerfolder, create a file namedcredentials.json. - This file should contain the service account credentials for querying BigQuery.
- If you don't have the credentials, please contact your system administrator or refer to the Google Cloud Console to create a service account with appropriate permissions.
- In the
-
Clone this repository:
git clone https://github.com/pragusga/delman.git cd delman -
Adjust the environment variables:
- Open the existing
.envfile in bothdelman-apianddelman-schedulerdirectories. - Review and update the values if necessary to match your specific configurations.
- Open the existing
-
Ensure you've created the
credentials.jsonfile in thedelman-schedulerdirectory as mentioned in the "Before You Begin" section. -
Run both projects using Docker Compose:
docker-compose up -dThis command will start both the API and the scheduler, along with a PostgreSQL database.
-
Access the API at
http://localhost:3000
For more detailed information about each project, including how to run unit tests, check coverage, or make modifications, please refer to the README files in their respective directories as mentioned above.
To stop both projects:
docker-compose down
To stop the projects and remove all data (including the database volume):
docker-compose down -v
If you encounter any issues:
-
Ensure you've read and followed the instructions in both project-specific README files.
-
Verify that the
credentials.jsonfile is correctly set up in thedelman-schedulerdirectory. -
Ensure all environment variables in the
.envfiles are correctly set and appropriate for your setup. -
Check the logs of the services:
docker-compose logs api docker-compose logs scheduler -
Verify that the database is running and accessible to both services.