A comprehensive healthcare appointment scheduling system designed to streamline patient-doctor interactions, manage medical records, and optimize healthcare facility operations.
- Overview
- Features
- Technology Stack
- Prerequisites
- Installation
- Configuration
- Database Setup
- Running the Application
- Testing
- Documentation
- Contributing
The Healthcare Appointment Scheduler is a robust backend service that provides a comprehensive solution for managing healthcare appointments, patient records, and doctor schedules. The system is built with scalability, security, and maintainability in mind, following industry best practices and standards.
- User Management: Secure authentication and role-based access control
- Appointment Management: Scheduling, rescheduling, cancellation, recurring appointments
- Medical Records: Secure storage and management of patient records
- Doctor-Patient Management: Assignment and relationship tracking
- Staff Management: Department and role management
- Audit and Security: Comprehensive logging and security measures
- Web-based Dashboard: Intuitive user interface for all stakeholders
- Advanced Appointment Features: Waitlist management
- Department Management: Specialized department handling
- Analytics and Reporting: Data-driven insights and reporting
- Integration Capabilities: EHR and payment system integration
- Advanced Security: Two-factor authentication
- Python 3.11+
- FastAPI
- SQLAlchemy
- PostgreSQL
- Pydantic
- JWT Authentication
- Alembic (Database Migrations)
- React.js
- TypeScript
- Material-UI
- Redux Toolkit
- React Query
- Docker
- Docker Compose
- GitHub Actions
- PostgreSQL
- Redis
- Python 3.11 or higher
- PostgreSQL 15 or higher
- Docker and Docker Compose (for containerized deployment)
- Git
- psql (PostgreSQL command-line tool)
- make (optional, for using Makefile commands)
- Clone the repository:
git clone https://github.com/yourusername/healthcare-appointment-scheduler.git
cd healthcare-appointment-scheduler
- Create and activate a virtual environment:
# Windows
python -m venv venv
.\venv\Scripts\activate
# Linux/macOS
python -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
The application uses environment variables for configuration. Key settings include:
- Database configuration
- JWT settings
- CORS settings
- Email settings (for notifications)
- Redis settings (for caching)
Refer to .env.example
for all available configuration options.
The application uses PostgreSQL as its database. You can set up the database in two ways:
- Start the PostgreSQL container:
docker-compose up -d db
-
Wait for the database to be ready (about 10-15 seconds)
-
To recreate the database schema from scratch, run:
python -m app.db.init_db
- Create a PostgreSQL database:
createdb appointment_scheduler
- Connect to the database:
psql appointment_scheduler
- To recreate the database schema from scratch, run:
python -m app.db.init_db
If you need to reset the database to a clean state:
- Using Docker:
docker-compose down -v
docker-compose up -d db
python -m app.db.init_db
- Manual setup:
dropdb appointment_scheduler
createdb appointment_scheduler
python -m app.db.init_db
The application uses Alembic for database migrations. To manage migrations:
- Create a new migration:
alembic revision --autogenerate -m "description of changes"
- Apply migrations:
alembic upgrade head
- Rollback migrations:
alembic downgrade -1
# Windows
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Linux/macOS
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
docker-compose up -d
The project includes comprehensive test suites:
- Unit tests for models and services
- Integration tests for API endpoints
- Database tests
- Security tests
Run tests using:
# Run all tests
pytest
# Run tests with coverage
pytest --cov=app tests/
# Run specific test file
pytest tests/test_models.py
# Run tests with detailed output
pytest -v
The API documentation is available at /docs
when running the application. It provides:
- Interactive API documentation (Swagger UI)
- OpenAPI specification
- Example requests and responses
Comprehensive system documentation is available in the docs
directory, it covers:
- System Architecture
- Database Schema
- API Endpoints
- Deployment Guide
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Please ensure your code follows the project's coding standards and includes appropriate tests.