VaidyaSetu
A full-stack healthcare management platform featuring role-based clinical workflows, automated appointment scheduling, relational database architecture, Redis caching, asynchronous task processing, and containerized deployment.
- Flask
- Vue.js
- PostgreSQL
- Redis
- Celery
- Docker

Overview
VaidyaSetu is a full-stack hospital management platform designed to digitize and streamline healthcare operations through a unified system for appointment scheduling, doctor availability management, patient records, digital prescriptions, and administrative workflows.
The platform provides dedicated interfaces for patients, doctors, and hospital staff, enabling each user group to interact with healthcare services according to its responsibilities and permissions.
Built using Flask, Vue.js, SQLAlchemy, Redis, and Celery, the system incorporates a modular backend architecture, asynchronous task processing, caching, relational data modeling, and containerized deployment.
The project emphasizes backend engineering, domain-driven data modeling, workflow automation, and the architectural separation of application responsibilities.
Problem Statement
Healthcare management involves several interconnected workflows, including patient registration, doctor scheduling, appointment booking, clinical consultations, prescription management, and medical history tracking.
Managing these workflows through disconnected systems or manual processes can lead to:
- Fragmented patient records and medical histories.
- Inefficient appointment scheduling and conflicting bookings.
- Difficulty managing recurring doctor availability and schedule exceptions.
- Manual prescription management and administrative paperwork.
- Limited accessibility to historical medical information.
- Repetitive administrative tasks and communication overhead.
VaidyaSetu was developed to explore how these workflows could be integrated into a centralized digital platform.
The objective was to build a system capable of representing real healthcare workflows while maintaining a clear separation between frontend interfaces, backend business logic, persistent data, and background processing.
My Contribution
I independently designed and developed the application, covering requirement analysis, database architecture, backend implementation, frontend development, service integration, and containerized application configuration.
My key contributions include:
- Designed an interconnected relational database schema consisting of 18 core entities representing healthcare and administrative workflows.
- Developed a modular Flask backend using Blueprints to organize domain-specific REST APIs.
- Implemented JWT-based authentication and role-based authorization for patients, doctors, and hospital staff.
- Designed a doctor availability management system supporting recurring schedules, schedule exceptions, and automatic appointment-slot generation.
- Implemented appointment booking, conflict-prevention logic, cancellation tracking, and consultation workflows.
- Developed patient and family-member profiles, longitudinal medical histories, and digital prescription management.
- Integrated Redis caching for frequently accessed data, including doctor availability.
- Implemented asynchronous background processing using Celery and Redis for treatment-history exports, reminders, and appointment-slot automation.
- Developed a Vue.js single-page application with role-specific dashboards, centralized state management, and API integration.
- Configured a multi-container application environment using Docker Compose and Nginx.
System Architecture
VaidyaSetu follows a decoupled client-server architecture with a modular monolithic backend and dedicated background-processing services.
The frontend, backend, caching infrastructure, task workers, scheduler, and reverse proxy operate as distinct application components, allowing their responsibilities to remain separated.
| Component | Responsibility |
|---|---|
| Vue.js Frontend | Role-specific interfaces, application navigation, forms, and dashboards |
| Nginx | Reverse proxy and application request routing |
| Flask Backend | REST APIs, authentication, authorization, validation, and domain-specific business logic |
| SQLAlchemy ORM | Relational data modeling and database operations |
| Relational Database | Persistent storage of users, schedules, appointments, and medical records |
| Redis | Application caching and task-message brokering |
| Celery Worker | Asynchronous background task execution |
| Celery Beat | Periodic task scheduling |
| MailHog | Email testing during development |
| Docker Compose | Multi-container application orchestration |
This architecture separates synchronous request handling from background operations while maintaining a cohesive application structure.
flowchart TB
subgraph Client["Client Layer"]
USERS["Staff / Doctors / Patients"]
end
subgraph Frontend["Frontend Layer"]
FE["Vue.js SPA<br/>Pinia + Vue Router + Bootstrap"]
end
subgraph Gateway["Gateway Layer"]
NG["Nginx Reverse Proxy"]
end
subgraph Backend["Backend Layer"]
API["Flask REST API<br/>Authentication / Authorization / Business Logic"]
end
subgraph Data["Data Layer"]
DB[("PostgreSQL / SQLite")]
REDIS[("Redis Cache + Broker")]
end
subgraph Async["Async Processing"]
CELERY["Celery Worker"]
BEAT["Celery Beat Scheduler"]
end
subgraph Services["Services"]
MAIL["Email Service"]
REPORTS["Report Generator"]
SLOTS["Slot Generator"]
end
USERS --> FE
FE --> NG
NG --> API
API --> DB
API --> REDIS
API --> MAIL
API --> REPORTS
API --> SLOTS
REDIS --> CELERY
REDIS --> BEAT
CELERY --> APIBackend Architecture
The backend is organized into domain-specific modules using Flask Blueprints.
Each module is responsible for a particular application domain, including authentication, user management, doctor profiles, scheduling, appointments, consultations, prescriptions, medical records, notifications, and exports.
This modular organization improves maintainability by separating healthcare business logic into clearly defined functional areas.
The REST API serves as the communication boundary between the frontend and backend, enabling the user interface to evolve independently of the underlying application logic.
Database Design
The relational database consists of 18 core entities organized around five major application domains.
| Domain | Entities |
|---|---|
| Identity & Patient Management | Users, Family Members, Medical Conditions |
| Hospital Organization | Departments, Specialities, Doctors, Doctor Specialities |
| Scheduling & Booking | Recurring Availabilities, Recurring Availability Day, Availability Exceptions, Generated Slots, Appointments |
| Clinical Management | Visits, Prescriptions, Medications Prescribed, Lab Tests Advised |
| System Operations | Audit Logs, Notifications |
A key architectural decision was to separate user accounts from patient identities. A registered user can manage multiple associated patient profiles, allowing appointments and medical records to be maintained independently for different family members.
Doctor specializations are represented through a many-to-many relationship, enabling doctors to be associated with multiple medical specialities.
The scheduling domain separates recurring availability rules, exceptional schedule changes, generated appointment slots, and actual booking records.
Clinical consultations are represented through visit records, which can be associated with appointments or walk-in consultations. Prescriptions, medications, lab investigations, and medical conditions are linked through their corresponding clinical entities.
This separation allows the database to represent complex healthcare relationships without combining unrelated application responsibilities into a single entity.
Doctor Availability and Appointment Scheduling
One of the central components of VaidyaSetu is its appointment scheduling system.
Instead of treating doctor availability as a static list of timestamps, the system separates availability rules from actual appointment slots.
The scheduling workflow consists of:
- Defining recurring doctor availability schedules.
- Configuring availability for individual days of the week.
- Recording exceptions for leave, holidays, or modified working hours.
- Generating appointment slots based on the applicable schedule and slot duration.
- Exposing available slots to patients.
- Validating appointment booking requests against slot availability.
- Recording appointment status and cancellation information.
This approach allows recurring schedules to be managed independently from individual appointment bookings.
The generated-slot model also provides an explicit representation of bookable time intervals, simplifying availability queries and appointment management.
Clinical Workflow Management
The application models the patient-care journey beyond appointment booking.
The clinical workflow includes:
- Appointment-based and walk-in consultations.
- Creation and management of patient visit records.
- Recording patient vitals and clinical observations.
- Digital prescription creation and updates.
- Medication dosage, frequency, duration, and instruction management.
- Lab test recommendations.
- Medical condition and diagnosis tracking.
- Follow-up scheduling information.
- Patient-facing access to prescription and medical history information.
By separating appointments, visits, prescriptions, and medical conditions, the system maintains a distinction between scheduling events and the clinical records created during patient care.
Asynchronous Processing and Task Automation
Certain application operations do not require immediate completion within an HTTP request.
VaidyaSetu integrates Celery and Redis to support background processing and scheduled automation.
The implemented background workflows include:
| Task | Purpose |
|---|---|
| Appointment Reminders | Generate scheduled reminders for upcoming consultations |
| Treatment History Export | Generate downloadable CSV reports asynchronously |
| Appointment Slot Generation | Automate the generation of appointment slots |
| Scheduled Jobs | Execute recurring application tasks through Celery Beat |
The treatment-history export workflow demonstrates asynchronous request processing:
- The client submits an export request to the backend.
- The backend dispatches a background task.
- A Celery worker processes the export independently of the initiating request.
- The client checks task status using its task identifier.
- The generated report becomes available for download.
This design avoids requiring the original HTTP request to remain open until report generation is complete.
Caching Strategy
Redis is integrated into the application through Flask-Caching to support frequently accessed queries.
Doctor availability and other high-frequency application data are suitable caching candidates because they may be requested repeatedly during appointment discovery.
The caching layer reduces the need to repeatedly perform identical database queries when valid cached data is available.
Redis also serves as the message broker for Celery, supporting communication between the application and background-processing infrastructure.
This introduces two distinct uses of Redis within the same application architecture: temporary application data storage and asynchronous task coordination.
Containerized Application Environment
The application includes a Docker Compose configuration that orchestrates seven services:
- Vue.js frontend.
- Flask backend.
- Redis.
- Celery worker.
- Celery Beat scheduler.
- Nginx reverse proxy.
- MailHog email testing service.
Persistent application data and generated files are managed through mounted volumes, while environment-specific settings are supplied through configuration files.
The relational database uses SQLite for local development, with PostgreSQL identified as the intended database for a production-oriented configuration.
Containerization provides a reproducible application environment and reduces the complexity of manually configuring interconnected services.
Engineering Challenges
Modeling Complex Healthcare Relationships
Healthcare applications involve entities with different lifecycles and responsibilities.
A user account may represent multiple patients, a doctor may belong to multiple specialities, an appointment may result in a clinical visit, and a visit may produce prescriptions, medication instructions, and medical history updates.
Representing all these relationships required separating identity, scheduling, and clinical domains within the database.
The resulting relational schema establishes explicit relationships between these entities while allowing each domain to maintain its own application responsibilities.
Designing Recurring Availability and Schedule Exceptions
Doctor schedules cannot always be represented as fixed appointment timestamps.
Recurring working hours may change over time, and exceptions such as leave or modified availability must be represented separately.
The scheduling system addresses this by distinguishing:
- Recurring availability definitions.
- Day-specific working hours and slot durations.
- Date-specific availability exceptions.
- Generated appointment slots.
- Actual appointment bookings.
This separation provides a more flexible foundation for managing schedules than directly storing appointments against recurring working hours.
Preventing Appointment Conflicts
Appointment booking introduces consistency requirements because multiple users may attempt to access the same available time slot.
The application implements booking validation and slot-availability checks to prevent conflicting appointments within its intended workflow.
The generated-slot entity provides an explicit resource against which bookings can be recorded and validated.
This problem also highlights the importance of database transactions, uniqueness constraints, and concurrency control when extending the application to handle simultaneous booking requests at larger scales.
Separating Synchronous and Asynchronous Operations
Operations such as report generation and scheduled reminders have different execution requirements from interactive API requests.
Executing these operations synchronously can unnecessarily extend request-processing time and couple unrelated workloads to the web application.
By introducing Celery workers and a dedicated scheduler, the system separates background operations from the primary request-response lifecycle.
The asynchronous export workflow also required representing task progress and providing a separate mechanism for retrieving completed results.
Cache Consistency
Caching frequently accessed doctor availability introduces a trade-off between faster reads and data freshness.
Changes to doctor schedules, availability exceptions, and appointment bookings can affect previously retrieved availability information.
This makes cache expiration and invalidation important architectural considerations, particularly when working with time-sensitive application data.
The project provided practical exposure to the relationship between persistent database state, cached representations, and frequently accessed API resources.
Role-Based Authorization
Patients, doctors, and hospital staff have different responsibilities and data-access requirements.
The application uses JWT-based authentication alongside role-based authorization to distinguish between these workflows.
The backend must determine whether an authenticated user is permitted to perform a particular operation rather than relying exclusively on frontend route restrictions.
This distinction between authentication and authorization was particularly important in designing healthcare-related application workflows.
Multi-Service Application Configuration
Integrating a frontend application, API server, Redis, background workers, task scheduler, and reverse proxy introduces additional configuration requirements.
These services must communicate correctly, share relevant application settings, and access persistent resources where required.
Docker Compose provides a centralized mechanism for describing the application environment, service dependencies, configuration, and persistent volumes.
Technical Decisions
| Decision | Rationale |
|---|---|
| Modular monolithic backend | Maintains clear functional boundaries without introducing unnecessary microservice complexity |
| Flask and Blueprints | Flexible API development with domain-specific route organization |
| Vue.js SPA | Separates frontend interaction logic from backend services |
| Pinia | Centralizes shared frontend application state |
| SQLAlchemy ORM | Supports structured relational modeling and database interactions |
| SQLite for development | Simplifies local development and reduces infrastructure requirements |
| PostgreSQL as a production target | Provides a path toward stronger concurrent database workloads |
| JWT-based authentication | Supports authenticated communication between the decoupled frontend and REST API |
| Separate user and patient entities | Enables family-member management under a single registered account |
| Generated appointment slots | Provides explicit bookable resources derived from doctor availability |
| Redis caching | Reduces repetitive database reads for frequently accessed resources |
| Celery workers | Separates background workloads from synchronous HTTP processing |
| Celery Beat | Supports periodic reminders and scheduled application automation |
| Nginx | Centralizes request routing between application components |
| Docker Compose | Simplifies configuration and execution of interconnected services |
| MailHog | Enables local email testing without sending actual email messages |
The architectural decisions prioritize maintainability, clear separation of responsibilities, and practical application development while establishing a foundation for future performance and reliability improvements.
Results & Outcomes
The project resulted in a functional hospital management application covering administrative operations, appointment scheduling, patient consultations, clinical documentation, and background automation.
Implementation Outcomes
- 3 distinct user roles: Patients, doctors, and hospital staff.
- 18 core relational entities: Covering identity management, hospital organization, appointment scheduling, clinical records, and system operations.
- 13 documented API modules: Organizing authentication, user management, doctor management, scheduling, appointments, clinical workflows, notifications, and exports.
- 7 containerized services: Providing a reproducible multi-service application environment.
- 3 principal background workflows: Appointment reminders, CSV report generation, and automated slot generation.
- Dedicated dashboards for patients, doctors, and administrative staff.
- Recurring doctor schedules with availability exceptions.
- Appointment booking and cancellation workflows.
- Digital prescriptions, patient medical histories, and lab test recommendations.
- Redis-backed caching and asynchronous task processing.
Functional Outcomes
Patients can manage family-member profiles, discover doctors, book appointments, access prescriptions, and review medical history.
Doctors can manage availability, review appointments, record clinical visits, and create digital prescriptions with medication and lab test recommendations.
Hospital staff can manage user accounts, doctor profiles, departments, specialities, appointments, and administrative statistics.
The system demonstrates the integration of transactional application workflows, asynchronous processing, caching, and relational database design within a single full-stack application.
Lessons Learned
Developing VaidyaSetu significantly strengthened my understanding of backend engineering and the architectural considerations involved in building applications with interconnected business workflows.
The project provided practical experience in:
- Translating complex domain requirements into relational database models.
- Designing REST APIs around clearly defined application responsibilities.
- Understanding the distinction between authentication, authorization, and resource-level access.
- Modeling recurring schedules, exceptional availability, and transactional booking records.
- Integrating Redis for application caching and task-message brokering.
- Implementing asynchronous workflows using Celery workers.
- Automating recurring application operations through scheduled tasks.
- Designing frontend applications that consume independently developed backend APIs.
- Configuring reverse proxies and multi-container application environments.
- Understanding consistency, concurrency, and cache-invalidation considerations.
One of the most important lessons was that building a functional application requires more than implementing individual features. The relationships between data, application workflows, infrastructure components, and failure conditions must also be considered.
The project established a foundation for further exploration of system design, application reliability, performance optimization, and production-oriented backend engineering.
Future Improvements
Potential directions for further development include:
Backend Reliability
- Strengthening concurrency guarantees for simultaneous appointment booking requests.
- Implementing database-level uniqueness constraints and transactional locking where required.
- Introducing idempotency mechanisms for critical operations.
- Improving API validation, standardized error responses, and exception handling.
- Introducing retry policies and failure handling for background tasks.
Performance and Scalability
- Completing and validating the PostgreSQL deployment configuration.
- Analyzing database queries and introducing targeted indexes.
- Improving cache-invalidation strategies.
- Conducting load tests for appointment booking and frequently accessed APIs.
- Benchmarking cached and uncached query performance.
Security and Observability
- Strengthening resource-level access control for sensitive medical information.
- Introducing API rate limiting.
- Expanding automated unit and integration testing.
- Implementing structured logging and application monitoring.
- Introducing health checks, operational metrics, and background-task monitoring.
- Improving secret management and deployment configuration.
Application Enhancements
- Expanding diagnostic report and medical document management.
- Introducing secure document storage.
- Improving appointment rescheduling workflows.
- Exploring AI-assisted medical document processing with appropriate human review.
- Enhancing administrative analytics and reporting capabilities.
- Introducing automated CI/CD workflow