A comprehensive web-based hospital management system designed to streamline healthcare operations in Kenya. The system facilitates efficient management of appointments, doctors, departments, and patient interactions while providing real-time notifications and analytics.
AfyaCare is a modern hospital management solution built to address the challenges faced by healthcare facilities in managing patient appointments and medical staff coordination. The system provides three distinct user interfaces tailored to the needs of administrators, doctors, and patients, ensuring smooth workflow and enhanced patient care delivery.
The platform enables hospitals to digitize their appointment booking process, manage doctor schedules, track patient visits, and maintain organized department structures. By providing real-time notifications and comprehensive dashboards, AfyaCare helps reduce administrative overhead while improving patient experience and operational efficiency.
- Complete hospital dashboard with analytics and statistics
- Doctor profile management (add, edit, remove doctors)
- Department management and organization
- Appointment oversight and monitoring
- Real-time system metrics and reporting
- User access control and management
- Personal dashboard with appointment overview
- View all scheduled appointments with patient details
- Confirm or decline appointment requests
- Provide reasons for declined appointments with alternative date suggestions
- Mark appointments as completed
- Add medical notes and observations to patient records
- Direct patient contact capabilities (call/email)
- Filter appointments by status (pending, confirmed, completed)
- User-friendly appointment booking interface
- Browse available doctors by department and specialization
- View doctor profiles including qualifications and consultation fees
- Track appointment history and status
- Real-time notification system for appointment updates
- Dashboard showing upcoming and completed appointments
- Notification center with read/unread status management
- Automated notifications for appointment confirmations
- Alerts for appointment declinations with doctor's reasoning
- Notifications for completed appointments
- Suggested alternative dates from doctors
- Mark notifications as read/unread
- Delete old notifications
- Unread notification counter in navigation
- Laravel 11 - PHP web application framework
- PHP 8.2 - Server-side scripting language
- MySQL - Relational database management system
- Bootstrap 5 - Frontend CSS framework
- JavaScript - Client-side interactivity
- Blade - Laravel templating engine
- PHP >= 8.2
- Composer
- MySQL >= 5.7 or MariaDB >= 10.3
- Apache or Nginx web server
- Node.js and NPM (for asset compilation)
git clone https://github.com/YOUR-USERNAME/afyacare.git
cd afyacarecomposer installcp .env.example .envEdit the .env file and configure your database connection:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=afyacare_db
DB_USERNAME=your_username
DB_PASSWORD=your_password
php artisan key:generatephp artisan migratephp artisan db:seedphp artisan storage:linkphp artisan serveThe application will be available at http://127.0.0.1:8000
- users: User authentication and profile information
- patients: Patient-specific data
- doctors: Doctor profiles and specializations
- departments: Hospital departments
- appointments: Appointment bookings and details
- notifications: User notification management
- One user can be one patient, doctor, or admin
- Doctors belong to departments
- Appointments link patients to doctors
- Notifications belong to users
After installation, you can create test accounts or use seeded data:
Administrator
- Email: admin@afyacare.co.ke
- Password: admin123
Doctor
- Email: doctor@afyacare.co.ke
- Password: doctor123
Patient
- Email: patient@afyacare.co.ke
- Password: patient123
Note: Change these credentials in production environment.
- Full system access
- Manage doctors and departments
- View all appointments
- System configuration
- User management
- View assigned appointments
- Confirm/decline appointments
- Add medical notes
- Update appointment status
- View patient contact information
- Book appointments
- View appointment history
- Receive notifications
- View doctor profiles
- Update personal information
- Patient registers/logs into the system
- Patient browses available doctors by department
- Patient selects a doctor and books an appointment
- Appointment status set to "pending"
- Doctor receives notification of new appointment
- Doctor reviews and confirms or declines appointment
- Patient receives notification of doctor's decision
- If declined, doctor can suggest alternative dates
- Confirmed appointments appear in both doctor and patient dashboards
- After consultation, doctor marks appointment as completed
- Patient receives completion notification
- Password hashing using bcrypt
- CSRF protection on all forms
- Role-based access control
- Session management
- SQL injection prevention through Eloquent ORM
- XSS protection via Blade templating
- Secure authentication system
Potential features for future development:
- Medical records management
- Prescription management
- Billing and invoicing system
- SMS notifications via Africa's Talking API
- Email notifications
- Online payment integration (M-Pesa)
- Patient medical history tracking
- Doctor schedule management
- Video consultation capabilities
- Report generation and export
- Multi-language support (English, Swahili)
afyacare/
├── app/
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Admin/
│ │ │ ├── Doctor/
│ │ │ └── Patient/
│ │ └── Middleware/
│ └── Models/
├── database/
│ ├── migrations/
│ └── seeders/
├── resources/
│ └── views/
│ ├── admin/
│ ├── doctor/
│ ├── patient/
│ └── layouts/
├── routes/
│ └── web.php
└── public/
This project is currently maintained for academic purposes. For suggestions or improvements, please contact the project owner.
Issue: "Class not found" errors
Solution: Run composer dump-autoload
Issue: "No application encryption key has been specified"
Solution: Run php artisan key:generate
Issue: Database connection errors
Solution: Verify database credentials in .env file and ensure MySQL service is running
Issue: 404 errors on routes
Solution: Run php artisan route:clear and php artisan cache:clear
Issue: Permission denied on storage
Solution: Set proper permissions chmod -R 775 storage bootstrap/cache
The system follows the MVC (Model-View-Controller) architecture pattern:
- Models: Represent database tables and business logic
- Views: Blade templates for user interface
- Controllers: Handle HTTP requests and application logic
Authentication and authorization are managed through Laravel's built-in authentication system with custom role-based middleware.
Currently, the system uses web routes. RESTful API endpoints can be added for mobile application integration in future versions.
Run the test suite:
php artisan test- Set
APP_ENV=productionin.env - Set
APP_DEBUG=falsein.env - Configure production database
- Run
php artisan config:cache - Run
php artisan route:cache - Run
php artisan view:cache - Set up proper file permissions
- Configure web server (Apache/Nginx)
- Set up SSL certificate
- Configure backup strategy
- VPS: DigitalOcean, Linode, Vultr
- Shared Hosting: Compatible with cPanel hosting
- Cloud: AWS, Google Cloud, Azure
- Platform: Railway, Render, Heroku alternatives
This project is licensed for educational and academic use only. Commercial use requires explicit permission from the author.
For technical support, feature requests, or bug reports:
- GitHub Issues: https://github.com/YOUR-USERNAME/afyacare/issues
- Email: support@afyacare.co.ke
Built as a demonstration of modern web application development using Laravel framework, following best practices for healthcare management systems.
- Basic user authentication system
- Admin, Doctor, and Patient modules
- Appointment management
- Department management
- Notification system
- Responsive design
For detailed technical documentation, including database schema, API endpoints, and architecture diagrams, please refer to the /docs directory (to be added).
Screenshots and demo videos available upon request.
This system is designed for educational purposes and demonstration. For production use in healthcare settings, ensure compliance with local healthcare regulations and data protection laws (such as HIPAA, GDPR, or Kenya Data Protection Act).