A comprehensive Django-based patient management and queue system for healthcare facilities with real-time updates and role-based access control.
- Role-Based Authentication: JWT-based authentication with three distinct roles (Form Manager, Doctor, Queue Manager)
- Patient Management: Complete patient registration with comprehensive data collection
- Real-Time Queue: Live queue updates via WebSocket for seamless patient flow
- Email Notifications: Automated email alerts on patient check-in
- Image Upload: Patient photo capture and storage
- RESTful API: Well-documented API endpoints for easy integration
Comprehensive documentation is available in the docs/ folder:
- Getting Started - Installation and setup guide
- Authentication - Authentication flow and JWT usage
- API Endpoints - Complete API reference with request/response examples
- WebSocket Events - Real-time event documentation
- Data Models - Database schema and model details
- Error Handling - Error codes and troubleshooting
- Examples - Code examples in JavaScript, Python, React
- Quick Reference - Cheat sheet for common tasks
- Production Deployment - Nginx, Gunicorn, systemd setup
- Backend: Django 5.2+ with Django REST Framework
- Authentication: JWT (Simple JWT)
- Real-time: Django Channels + Redis
- Task Queue: Celery
- Database: SQLite (dev) / PostgreSQL (prod)
- Admin: Django Unfold
# Create virtual environment
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
# Install packages
pip install -r requirements.txtCreate a .env file:
DEBUG=True
SECRET_KEY=your-secret-key-here
ALLOWED_HOSTS=127.0.0.1,localhost
CELERY_BROKER_URL=redis://localhost:6379/0python manage.py migrate
python manage.py createsuperuser# Terminal 1: Redis
redis-server
# Terminal 2: Celery
celery -A CheckIn worker -l info
# Terminal 3: ASGI Server (Daphne)
daphne -b 0.0.0.0 -p 8000 CheckIn.asgi:application- API: http://localhost:8000/api/
- Admin Panel: http://localhost:8000/admin/
- WebSocket: ws://localhost:8000/ws/queue/
# Login
POST /api/login/
{
"token": "12345678",
"password": "your-password"
}# Register patient
POST /api/patients/
# Requires: Form Manager role
# Accepts: multipart/form-data with patient details + optional image# Call next patient (completes immediately)
POST /api/doctors/
{
"action": "call_next"
}# Get current queue
GET /api/queue/| Role | Access Token Value | Permissions |
|---|---|---|
| Form Manager | form |
Register patients |
| Doctor | doctor |
Manage consultations |
| Queue Manager | queue |
View queue |
Create access tokens in the Django admin panel at /admin/.
Connect to ws://localhost:8000/ws/queue/ to receive real-time updates:
-
PATIENT_ADDED - New patient checked in
-
PATIENT_COMPLETED - Consultation finished
CheckIn/
├── CheckIn/ # Project settings
├── management/ # Main app (models, views, serializers)
├── docs/ # Documentation
├── media/ # Uploaded files
├── templates/ # Email templates
└── requirements.txt # Dependencies
python manage.py testSee Getting Started for a complete list of environment variables.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This is a client project. All rights reserved by the client.
Roni Ahamed
Backend Developer
For detailed API documentation and examples, please refer to the documentation folder.
Last Updated: October 28, 2025