Skip to content

healthcare appointment scheduling system designed to streamline patient-doctor interactions and medical record management.

Notifications You must be signed in to change notification settings

DavidOgalo/AppointmentScheduler

Repository files navigation

Healthcare Appointment Scheduler

A comprehensive healthcare appointment scheduling system designed to streamline patient-doctor interactions, manage medical records, and optimize healthcare facility operations.

Table of Contents

Overview

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.

Features

Core Functionality

  • 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

Future Enhancements

  • 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

Technology Stack

Backend

  • Python 3.11+
  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • Pydantic
  • JWT Authentication
  • Alembic (Database Migrations)

Frontend (Future Implementation)

  • React.js
  • TypeScript
  • Material-UI
  • Redux Toolkit
  • React Query

DevOps

  • Docker
  • Docker Compose
  • GitHub Actions
  • PostgreSQL
  • Redis

Prerequisites

  • 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)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/healthcare-appointment-scheduler.git
cd healthcare-appointment-scheduler
  1. Create and activate a virtual environment:
# Windows
python -m venv venv
.\venv\Scripts\activate

# Linux/macOS
python -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your configuration

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.

Database Setup

The application uses PostgreSQL as its database. You can set up the database in two ways:

Using Docker (Recommended)

  1. Start the PostgreSQL container:
docker-compose up -d db
  1. Wait for the database to be ready (about 10-15 seconds)

  2. To recreate the database schema from scratch, run:

python -m app.db.init_db

Manual Setup

  1. Create a PostgreSQL database:
createdb appointment_scheduler
  1. Connect to the database:
psql appointment_scheduler
  1. To recreate the database schema from scratch, run:
python -m app.db.init_db

Database Reset

If you need to reset the database to a clean state:

  1. Using Docker:
docker-compose down -v
docker-compose up -d db
python -m app.db.init_db
  1. Manual setup:
dropdb appointment_scheduler
createdb appointment_scheduler
python -m app.db.init_db

Database Migrations

The application uses Alembic for database migrations. To manage migrations:

  1. Create a new migration:
alembic revision --autogenerate -m "description of changes"
  1. Apply migrations:
alembic upgrade head
  1. Rollback migrations:
alembic downgrade -1

Running the Application

Development Mode

# 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

Production Mode

docker-compose up -d

Testing

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

Documentation

API Documentation

The API documentation is available at /docs when running the application. It provides:

  • Interactive API documentation (Swagger UI)
  • OpenAPI specification
  • Example requests and responses

System Documentation

Comprehensive system documentation is available in the docs directory, it covers:

  • System Architecture
  • Database Schema
  • API Endpoints
  • Deployment Guide

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Please ensure your code follows the project's coding standards and includes appropriate tests.

Releases

No releases published

Packages

No packages published

Languages