A robust, enterprise-grade backend API for a Doctor Appointment Management System. Built with a focus on clean architecture, scalability, and strict security standards.
This project follows professional software engineering standards:
- Service-Repository Pattern: Decoupling business logic from data access for high maintainability.
- RBAC (Role-Based Access Control): Powered by
spatie/laravel-permissionwith dedicated roles for Patients, Doctors, and Admins. - Atomic Operations: Ensuring data integrity during appointment bookings and payment processing.
- Idempotent Scheduling: Intelligent slot management that handles overlaps gracefully.
The following diagram illustrates the core relationships within the system:
erDiagram
User ||--o{ Role : "has roles"
User ||--o| Doctor : "has profile"
User ||--o{ Appointment : "as patient"
User ||--o{ Payment : "makes"
Doctor ||--o{ TimeSlot : defines
Doctor ||--o{ Appointment : receives
Doctor }|--|| Specialty : "belongs to"
Appointment ||--|| Payment : payment
Appointment ||--o{ Review : reviews
Appointment }|--|| TimeSlot : uses
User {
string id
string name
string email
}
Doctor {
string id
string specialty_id
decimal session_price
}
Appointment {
string id
string patient_id
string doctor_id
string status
}
- Smart Scheduling: Bulk-create/update available time slots for doctors with collision detection.
- Appointment Lifecycle: Seamless flow from Booking -> Confirmation -> Payment -> Review.
- Payment Integration: Webhook support for payment gateways and automated transaction tracking.
- Search & Filter: Find doctors by specialty, availability, or ratings.
- Advanced Auth: JWT-based authentication with automatic role assignments.
- Docker Installed (Desktop/Engine)
- Laravel Sail
# 1. Clone the repository
git clone https://github.com/your-username/Doctor-Booking-API.git
cd Doctor-Booking-API
# 2. Start the environment
./vendor/bin/sail up -d
# 3. Install dependencies
./vendor/bin/sail composer install
# 4. Setup environment
cp .env.example .env
./vendor/bin/sail artisan key:generate
./vendor/bin/sail artisan jwt:secret
# 5. Run migrations and seed the system
./vendor/bin/sail artisan migrate --seedA comprehensive Postman Collection is included in the root directory:
Docto-Rbooking-Api.postman_collection.json- Includes pre-configured environment variables and one-click testing for Admin, Doctor, and Patient flows.
Muhammad Taha
Backend Developer
Built with ❤️ using Clean Code principles.