VaxPlus is a secure and scalable RESTful API built using Django and Django REST Framework. This system allows users to register, book vaccination slots, view vaccine details, and manage appointments efficiently. It also includes admin-level capabilities to manage vaccine centers, doses, and more.
- 🔗 Base URL – https://vaxplus-backend.vercel.app/api/v1/auth/
- 🔗 API Root – https://vaxplus-backend.vercel.app/api/v1/
Infrastructure:
| Layer | Provider |
|---|---|
| Backend hosting | Vercel (serverless, Python 3.11) |
| Database | Supabase (managed PostgreSQL) |
| Cache | Upstash Redis (production) / Docker Redis (local dev) |
| Media storage | Cloudinary |
| Payments | SSLCommerz |
| SMTP (Djoser activation flow) |
- JWT Authentication – Secure, token-based login and access management
- Email Activation – Automatic account activation via email upon registration
- Role-Based Access – Patient / Doctor / Admin permissions across all endpoints
- User Management – Register, log in, and manage user profiles
- Doctor Applications – Apply as a doctor with certificate upload; admin approval workflow
- Campaign Management – Full CRUD operations for vaccination campaigns
- Vaccination Centers – Create, update, and manage vaccine center details
- Booking System – Book, reschedule, or cancel vaccination appointments
- Vaccination Records – Auto-generated history once a booking is marked completed
- Campaign Reviews – Ratings & comments, restricted to patients who booked/completed a campaign
- Payment Integration (SSLCommerz) – Secure online payments for vaccination booking
- Admin Panel – Manage users, vaccine info, and appointment data
- Advanced Filters – Filter campaigns by category, date, status, and more
- Search & Ordering – Search by campaign or vaccine title and description; order by date or relevance
- API Documentation – Integrated Swagger and ReDoc for easy API exploration
- Reduced repeated API response latency by 82% (2.51s → 0.45s) using Redis (Upstash) response caching with version-based cache invalidation.
- Reduced Campaign List API database queries by 62.5% (8 → 3) using Django ORM optimization (
select_related(),prefetch_related(),Prefetch()). - Minimized database overhead by retrieving only required fields with Django's
only()QuerySet optimization. - Improved API scalability with pagination, filtering, searching, and ordering support.
- Backend: Django 5.2.1, Django REST Framework 3.16.0
- Authentication: JWT (SimpleJWT), Djoser
- Caching: django-redis, Upstash Redis (prod), Docker Redis w/ ACL (local)
- Database: PostgreSQL via Supabase
- Docs: drf-yasg (Swagger/ReDoc)
- Image Handling: Pillow
- Filtering: django-filter
- Payment Gateway: SSLCommerz
- Dependencies: See requirements.txt
- 🔍 Swagger UI – https://vaxplus-backend.vercel.app/swagger/
- 📘 ReDoc UI – https://vaxplus-backend.vercel.app/redoc/
-
Clone the repository
git clone https://github.com/anis191/vaxplus-backend.git cd vaxplus-backend -
Create & activate virtual environment
python -m venv .example_env # For Windows source .example_env/Scripts/activate # For macOS/Linux source .example_env/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables Create a
.envfile in the project root:# Database (Supabase Postgres or local Postgres) dbname=your_db_name user=your_db_user password=your_db_password host=your_db_host port=5432 # Redis (must match the ACL user/password set in redis.conf) REDIS_URL=redis://djangoapp:your_local_password@localhost:6379/0 # Cloudinary cloud_name=your_cloud_name cloudinary_api_key=your_key api_secret=your_secret # Email EMAIL_HOST=smtp.example.com EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_HOST_USER=your_email EMAIL_HOST_PASSWORD=your_app_password # Djoser frontend URLs FRONTEND_PROTOCOL=http FRONTEND_DOMAIN=localhost:5173 FRONTEND_URL=http://localhost:5173 BACKEND_URL=http://127.0.0.1:8000 # SSLCommerz STORE_ID=your_store_id STORE_PASS=your_store_pass IS_SANDBOX=True
-
Run migrations
python manage.py migrate
-
Start development server
python manage.py runserver
- API Access: http://127.0.0.1:8000/ (Localhost only)
- Redis check:
docker exec -it <container_name> redis-cli -u redis://djangoapp:your_password@localhost:6379 PING→ should returnPONG
This API uses JWT (JSON Web Tokens) for secure, stateless user authentication.
Base URL: http://127.0.0.1:8000/api/v1 (Localhost)
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/jwt/create/ |
Login – Obtain access & refresh tokens |
| POST | /auth/jwt/refresh/ |
Refresh access token |
| POST | /auth/users/ |
Register a new user (Sign up) ✅ |
💡 Note: After registration, use the
/auth/jwt/create/endpoint to log in and receive your JWT tokens.
Payments are required only for premium vaccination campaigns.
- User selects a premium vaccination campaign.
- At checkout, the system redirects to the SSLCommerz hosted payment page.
- Upon successful payment, SSLCommerz notifies the system via IPN (Instant Payment Notification).
- The campaign booking is confirmed and marked as Paid.
vaxplus-backend/
├── vaxplus/ – Django settings & core configuration
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
│
├── api/ – API root and endpoint routing
│ └── (views, urls, models)
│
├── booking/ – Vaccination booking management
│ └── (models, views, serializers)
│
├── campaigns/ – Vaccine campaigns, categories, vaccines, and centers
│ └── (models, views, serializers)
│
├── core/ – Shared utilities (Redis caching, decorators, cache helpers)
│ └── (cache.py, decorators.py, etc.)
│
├── payments/ – SSLCommerz payment integration and payment management
│ └── (models, views, serializers)
│
├── users/ – Custom user authentication, profiles, and roles
│ └── (models, views, serializers, urls)
│
├── fixtures/ – Demo/sample data for development
│ └── campaigns_data.json
│
├── media/ – Uploaded media files
│
├── requirements.txt – Project dependencies
├── manage.py – Django management script
└── README.md – Project documentation
Contributions help make this project better and are always welcome!
- ⭐ Star the repo
- 🍴 Fork the project
- 📥 Clone your fork
- 💡 Create a feature branch:
git checkout -b feature/awesome-feature - ✅ Commit your changes:
git commit -m 'Add some feature' - 📤 Push your branch:
git push origin feature/awesome-feature - 🛠️ Open a Pull Request
Ensure your code follows the project standards and passes all tests.
Anisul Alam
Full-Stack Developer | Django | React | PostgreSQL