DocBook is a Django-based web application that allows patients to book appointments with doctors. It provides an intuitive platform for managing doctor schedules and patient bookings, offering seamless workflows for both parties.
- User Authentication: Patients can log in and manage their appointments.
- Search Doctors: Dynamic search functionality to find doctors by name or specialization.
- View Doctor Schedules: Patients can view available time slots and select a convenient one.
- Appointment Management: Patients can book, view, and confirm their appointments.
- REST API: Integrated API endpoints for searching doctors and managing data.
- AI help: Using Deepseek APIs for a simple Doctor recommendation system.
-
Login/Registration:
-
Search Doctors:
-
View Doctor Schedule:
-
Book Appointment:
-
Dashboard Management:
-
AI Recommendations:
- Login/Registration:
-
Admin login page.
-
Admin users can manage doctors, appointments, and other related data through the Django admin panel.
- Home:
/
- Login:
/login/
- Register:
/register/
- Logout:
/logout/
- Dashboard:
/dashboard/
- Doctor Details:
/doctor/<doctor_id>/
- List Doctors:
GET /api/doctors/
- Search Doctors:
GET /api/doctors/search/
- Get Doctor Availability:
GET /api/doctors/<doctor_id>/availability/
- Set Unavailability:
POST /api/doctors/<doctor_id>/set_unavailability/
- Book Appointment:
POST /api/appointments/book/
- Set Unavailability:
POST /set_unavailability/
- Set Slot Duration for Specific Day:
POST /set_slot_duration_specific_day/
- Get Report Data:
GET /get_report_data/
- Get Doctor Recommendation:
GET /api/get_doctor_recommendation/
- Backend: Django, Django REST Framework (DRF)
- Frontend: HTML, CSS, JavaScript
- Database: PostgreSQL
- Authentication: Django's built-in authentication system
- Containerization: Docker, Docker Compose
- Management Commands:
create_test_users.py
: Creates sample doctors and patients for testing.create_random_data_for_ai_test.py
: Populates the database with random doctors, patients, appointments, ratings, and slots for AI testing.- Run them using:
docker-compose exec web python manage.py <command_name>
To run this project, you need Docker installed and running on your system.
-
Clone the repository:
git clone https://github.com/hannanrazzaghi/DocBook.git cd DocBook
-
Create a .env file in the root of the project (the directory that includes Dockerfile):
- Open the .env file and configure the following variables according to your preferences:
# Example .env configuration DATABASE_NAME=docbook # Name of the PostgreSQL database DATABASE_USER=admin # Database username DATABASE_PASSWORD=password # Database password DATABASE_HOST=db # Hostname for the database container DATABASE_PORT=5432 # Port for connecting to the database DEBUG=1 # Debug mode (set to 0 for production) DEEPSEEK_API_KEY=your_api_key # your api key for connecting to the deepseek
-
Build and Start the Docker Containers:
docker-compose up --build -d
-
Run Migrations:
- Initialize the database schema.
docker-compose exec web python manage.py migrate
-
Create a Superuser:
- Set up an admin user to access the admin panel.
docker-compose exec web python manage.py createsuperuser
-
Access the Application:
- Open your browser and go to
http://localhost:8000/
. - Admin panel is accessible at
http://localhost:8000/admin/
.
- Open your browser and go to
-
Stopping the Project:
- To stop and remove the containers:
docker-compose down