A comprehensive healthcare appointment management system built with React, Django, and PostgreSQL. This system supports both patient and doctor roles with advanced appointment booking, conflict detection, and role-based access control.
- User Registration & Login: Separate registration flows for patients and doctors
- Role-based Access: Patients and doctors have different dashboards and permissions
- JWT Authentication: Secure token-based authentication
- Session Management: Proper logout and token refresh handling
- Doctor Registration: Complete doctor profile with specializations, license numbers, and experience
- Profile Management: Update doctor information and availability status
- Availability Scheduling: Set working hours for different days of the week
- Appointment Management: View and manage patient appointments
- Status Updates: Confirm, cancel, or mark appointments as completed
- Patient Registration: Simple patient account creation
- Doctor Discovery: Browse available doctors by specialization
- Appointment Booking: Book appointments with conflict detection
- Appointment History: View all past and upcoming appointments
- Real-time Availability: See available time slots for selected doctors
- Conflict Detection: Prevents double booking of the same time slot
- Appointment Status Workflow:
pendingβconfirmedβcompletedcancelledstatus available at any time
- Doctor-specific Rules: Respects doctor availability and working hours
- Time Slot Management: 30-minute appointment slots
- Role-based Access Control:
- Patients see only their own appointments
- Doctors see only their scheduled appointments
- Appointment Status Updates: Real-time status changes
- Notes and Comments: Doctors can add notes to appointments
- Responsive Design: Works on desktop and mobile devices
- Django 4.2.7: Web framework
- Django REST Framework: API development
- PostgreSQL: Database
- JWT Authentication: Secure token-based auth
- CORS Support: Cross-origin resource sharing
- React 18: User interface
- Vite: Build tool and dev server
- React Router: Client-side routing
- Axios: HTTP client
- CSS3: Styling and responsive design
- Python 3.8+
- Node.js 16+
- PostgreSQL 12+
-
Navigate to backend directory:
cd backend -
Create and activate virtual environment:
python -m venv venv source venv/Scripts/activate # On Windows # or source venv/bin/activate # On macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Configure database:
- Create a PostgreSQL database
- Update database settings in
userauth/settings.py
-
Run migrations:
python manage.py makemigrations python manage.py migrate
-
Create superuser (optional):
python manage.py createsuperuser
-
Start development server:
python manage.py runserver
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start development server:
npm run dev
POST /api/auth/register/- Patient registrationPOST /api/auth/register-doctor/- Doctor registrationPOST /api/auth/login/- User loginPOST /api/auth/logout/- User logoutGET /api/auth/profile/- Get user profile
GET /api/auth/doctor-profile/- Get doctor profilePUT /api/auth/doctor-profile/- Update doctor profileGET /api/auth/doctor-availability/- Get doctor availabilityPOST /api/auth/doctor-availability/- Add availabilityGET /api/auth/doctors/- List all doctors
GET /api/auth/appointments/- Get user appointmentsPOST /api/auth/appointments/- Create appointmentGET /api/auth/appointments/{id}/- Get appointment detailsPUT /api/auth/appointments/{id}/- Update appointmentGET /api/auth/available-slots/{doctor_id}/{date}/- Get available slots
-
Register as Patient:
- Visit the registration page
- Select "Patient" as account type
- Fill in personal information
- Create account
-
Book an Appointment:
- Login to your dashboard
- Select a doctor from the list
- Choose a date and available time slot
- Provide reason for visit
- Confirm booking
-
Manage Appointments:
- View all your appointments
- Check appointment status
- See doctor notes (if any)
-
Register as Doctor:
- Visit the registration page
- Select "Doctor" as account type
- Fill in personal and professional information
- Set specialization and consultation fee
- Create account
-
Set Availability:
- Login to doctor dashboard
- Configure working hours for each day
- Set availability status
-
Manage Appointments:
- View all patient appointments
- Confirm or cancel pending appointments
- Mark appointments as completed
- Add notes to appointments
- Extended with role, phone number, date of birth, address
- Supports both patient and doctor roles
- Specialization, license number, experience
- Consultation fee, bio, availability status
- Day of week, start/end times
- Availability status per time slot
- Patient and doctor references
- Date, time, status, reason, notes
- Automatic conflict detection
- JWT Authentication: Secure token-based authentication
- Role-based Access: Different permissions for patients and doctors
- Input Validation: Server-side validation for all inputs
- CORS Configuration: Proper cross-origin resource sharing
- Password Security: Django's built-in password validation
# Backend tests
cd backend
python manage.py test
# Frontend tests
cd frontend
npm test- ESLint for JavaScript/React
- Django's built-in validation
- TypeScript support (optional)
- Set production environment variables
- Configure production database
- Run migrations
- Collect static files
- Deploy to your preferred platform
- Build production bundle:
npm run build - Deploy to static hosting service
- Configure API endpoints
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions, please open an issue in the repository.