Skip to content

Commit f14d5b2

Browse files
authored
Merge pull request #3 from turabbb/feat/testing-docs
Testing
2 parents e55b112 + ae86244 commit f14d5b2

File tree

3 files changed

+108
-162
lines changed

3 files changed

+108
-162
lines changed

README.md

Lines changed: 40 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,177 +1,55 @@
1-
# Health Care Management System
2-
3-
![FastAPI](https://img.shields.io/badge/FastAPI-0.109.0-009688?logo=fastapi) ![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-15-4169E1?logo=postgresql) ![Redis](https://img.shields.io/badge/Redis-7.0.5-DC382D?logo=redis) ![RabbitMQ](https://img.shields.io/badge/RabbitMQ-3.12-FF6600?logo=rabbitmq)
4-
5-
A modern microservices-based healthcare management system built with **FastAPI**, featuring secure patient data management, appointment scheduling, and real-time notifications. Designed for clinics and hospitals to streamline operations while maintaining HIPAA compliance standards.
6-
7-
![System Architecture Diagram](/path/to/architecture.png) <!-- Add actual diagram path -->
8-
9-
## ✨ Key Features
10-
11-
- **Patient Management**
12-
📝 Secure registration with insurance/ID tracking
13-
🔍 Advanced search and profile updates
14-
- **Doctor Management**
15-
⚕️ Specialization-based profiles with availability schedules
16-
📅 Dynamic calendar integration
17-
- **Smart Appointment System**
18-
🚨 Conflict-free scheduling with double-booking prevention
19-
🔔 Real-time notifications via email/SMS
20-
- **Medical Records**
21-
🔒 Encrypted storage with role-based access control
22-
⛓️ Audit trails for data integrity
23-
- **Performance Optimizations**
24-
⚡ Redis caching for high-frequency data
25-
🐇 RabbitMQ-powered async task processing
26-
27-
## 🛠 Tech Stack
28-
29-
- **Backend Framework**: FastAPI 0.109
30-
- **Database**: PostgreSQL 15 + SQLAlchemy ORM
31-
- **Cache/Queue**: Redis 7 + RabbitMQ 3.12
32-
- **Auth**: JWT + OAuth2
33-
- **Docs**: Swagger/OpenAPI 3.0
34-
- **Testing**: Pytest + HTTPX
35-
- **Deployment**: Docker + Docker Compose
36-
37-
## 🚀 Quick Start
38-
39-
### Prerequisites
40-
41-
- Docker 24.0+ & Docker Compose 2.20+
42-
- Python 3.11+
43-
44-
### Installation
45-
46-
1. Clone repository:
47-
```bash
48-
git clone https://github.com/devalentineomonya/Health-Care-Management-System-Python-FastAPI.git
49-
cd Health-Care-Management-System-Python-FastAPI
50-
```
51-
2. Create `.env` file:
52-
```env
53-
SECRET_KEY=your_ultra_secure_key
54-
DATABASE_URL=postgresql://user:pass@db:5432/healthcare
55-
REDIS_URL=redis://redis:6379/0
56-
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
57-
SMTP_ENABLED=true
58-
```
59-
3. Start services:
60-
```bash
61-
docker-compose up -d --build
62-
```
63-
4. Access API at `http://localhost:8000`
64-
65-
## 📚 API Documentation
66-
67-
- **Interactive Swagger UI**: `http://localhost:8000/docs`
68-
- **ReDoc**: `http://localhost:8000/redoc`
69-
70-
![API Docs Screenshot](/path/to/swagger-screenshot.png) <!-- Add screenshot -->
71-
72-
## 🗄 Database Schema
73-
74-
```mermaid
75-
erDiagram
76-
patients ||--o{ appointments : has
77-
patients ||--o{ medical_records : "stores"
78-
doctors ||--o{ appointments : accepts
79-
doctors ||--o{ availabilities : "has"
80-
users ||--o{ patients : "represents"
81-
users ||--o{ doctors : "represents"
82-
83-
patients {
84-
uuid id PK
85-
string insurance_number
86-
timestamp created_at
87-
}
88-
89-
doctors {
90-
uuid id PK
91-
string specialization
92-
jsonb availability_slots
93-
}
94-
95-
appointments {
96-
uuid id PK
97-
timestamp start_time
98-
timestamp end_time
99-
string status
100-
}
101-
```
1+
# Health Care Management System — Python / FastAPI
1022

103-
## 🔒 Security Features
3+
This repository implements a Health Care Management System API using FastAPI. It includes services for appointments, doctors, patients, users, and a notification worker.
1044

105-
- **JWT Authentication** with 15-minute token expiration
106-
- **Role-Based Access Control** (Patient, Doctor, Admin)
107-
- 🔑 Argon2 password hashing
108-
- 🛡️ Rate limiting (100 requests/minute)
109-
- 🕵️ Input validation with Pydantic V2
110-
- 🔐 HTTPS-ready configuration
5+
Maintainers
6+
- Repository owner: turabbb
7+
- Primary contributor (this branch): umarm
1118

112-
## ⚙️ Project Structure
9+
Quickstart (local)
11310

114-
```
115-
healthcare-system/
116-
├── app/
117-
│ ├── api/ # Route handlers
118-
│ ├── core/ # Config, security, middleware
119-
│ ├── crud/ # Database operations
120-
│ ├── db/ # SQLAlchemy models
121-
│ ├── schemas/ # Pydantic models
122-
│ └── main.py # FastAPI entrypoint
123-
├── tests/ # Pytest suites
124-
├── docker-compose.yml # Multi-service setup
125-
├── Dockerfile # Production build
126-
└── requirements.txt # Python dependencies
127-
```
11+
1. Create a virtual environment and activate it:
12812

129-
## 🌐 Production Deployment
130-
131-
1. Configure reverse proxy (Nginx):
13+
```powershell
14+
python -m venv .venv
15+
.\.venv\Scripts\Activate.ps1
16+
```
13217

133-
```nginx
134-
server {
135-
listen 443 ssl;
136-
server_name healthcare.example.com;
18+
2. Install dependencies:
13719

138-
ssl_certificate /path/to/fullchain.pem;
139-
ssl_certificate_key /path/to/privkey.pem;
20+
```powershell
21+
pip install -r requirements.txt
22+
```
14023

141-
location / {
142-
proxy_pass http://app:8000;
143-
proxy_set_header Host $host;
144-
}
145-
}
146-
```
24+
3. Run the API locally:
14725

148-
2. Enable automated backups for PostgreSQL
149-
3. Monitor with:
150-
- Prometheus/Grafana for metrics
151-
- ELK Stack for logging
152-
- Uptime Robot for availability
26+
```powershell
27+
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000
28+
```
15329

154-
## 🤝 Contributing
30+
4. Run tests:
15531

156-
1. Fork the repository
157-
2. Create feature branch:
158-
```bash
159-
git checkout -b feat/amazing-feature
160-
```
161-
3. Follow PEP8 guidelines and write tests
162-
4. Submit PR with:
163-
- Detailed description
164-
- Screenshots (if UI changes)
165-
- Updated documentation
32+
```powershell
33+
pip install pytest
34+
pytest -q
35+
```
16636

167-
## 🚧 Roadmap
37+
Docker / Compose
16838

169-
- [ ] Telemedicine integration (WebRTC)
170-
- [ ] Patient mobile app (Flutter)
171-
- [ ] AI-powered appointment suggestions
172-
- [ ] Insurance claim processing module
173-
- [ ] Multi-tenant architecture support
39+
This project includes a `Dockerfile` and `docker-compose.yml`. To run with Docker Compose:
17440

175-
## 📄 License
41+
```powershell
42+
docker-compose up --build
43+
```
17644

177-
MIT License - See [LICENSE](LICENSE) for details.
45+
Repository layout (key files)
46+
- `app/` — FastAPI application and routes
47+
- `core/` — configuration, security helpers, notifications
48+
- `crud/` — CRUD layer for DB models
49+
- `db/` — SQLAlchemy models and session
50+
- `schemas/` — Pydantic schemas
51+
- `tests/` — pytest tests (basic smoke tests on this branch)
52+
53+
Notes
54+
- This branch `feat/testing-docs` adds baseline tests and documentation.
55+
- For issues or contributions, open a pull request against `main` and assign to `turabbb`.

WORK_DIVISION.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Work Division and Contributions
2+
3+
This file documents the team members and their responsibilities for the project and for the work included on branch `feat/testing-docs`.
4+
5+
Team
6+
- turabbb — Repository owner, overall architecture, backend API design, CI/CD review
7+
- umarm — Tests, documentation, local dev setup, basic CI validation
8+
9+
Contributions on this branch
10+
- umarm
11+
- Added basic pytest smoke tests in `tests/test_basic.py`
12+
- Created `README.md`, `devops_report.md`, and `WORK_DIVISION.md`
13+
14+
- turabbb
15+
- Project author and maintainer
16+
- Review and merge pull requests; implement core features and DB models
17+
18+
Suggested next tasks and owners
19+
- Expand unit tests to cover `crud/` and `api/` routes — owner: umarm / turabbb
20+
- Add GitHub Actions workflows for linting, tests, and image build — owner: turabbb
21+
- Add integration tests for Docker Compose environment — owner: umarm
22+
23+
Notes
24+
- Replace or expand this file with real team member names and specific task breakdowns as the project grows.

devops_report.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# DevOps Implementation Report
2+
3+
This document summarizes the current DevOps and deployment considerations for the Health Care Management System project.
4+
5+
Containerization
6+
- Dockerfiles are present (`Dockerfile`, `Dockerfile.notification`). Build images for the API server and notification worker.
7+
- Use multi-stage builds to keep images small and secure.
8+
9+
Docker Compose
10+
- `docker-compose.yml` defines services for the API and (optionally) dependencies. Use for local dev and integration testing.
11+
12+
Environments & Secrets
13+
- Keep secrets out of VCS. Use environment variables and a secrets manager (Azure Key Vault, AWS Secrets Manager, HashiCorp Vault) for production.
14+
- Example local env file: `.env` (never commit to repo).
15+
16+
CI/CD Recommendations
17+
- Use GitHub Actions (recommended) with the following pipelines:
18+
- lint & unit tests (on PR)
19+
- build image and push to registry (on merge to main)
20+
- deploy to staging (on merge to main)
21+
22+
Suggested pipeline steps
23+
1. Checkout code
24+
2. Set up Python (3.10/3.11)
25+
3. Install dependencies
26+
4. Run linters (flake8/ruff) and unit tests (pytest)
27+
5. Build Docker image and push to registry (Docker Hub / GitHub Container Registry)
28+
6. Deploy to target environment (SSH, Kubernetes, or cloud provider)
29+
30+
Monitoring & Logging
31+
- Add structured logs (JSON) and collect with a central log system (ELK / Loki / Datadog).
32+
- Add healthchecks and metrics (Prometheus) for endpoints and background workers.
33+
34+
Scaling & Production
35+
- Deploy behind a reverse proxy/load balancer.
36+
- For scale, use Kubernetes or a managed container service. Run multiple replicas of the API and workers; use a shared message broker or DB locking for job coordination.
37+
38+
Security
39+
- Enforce HTTPS in production via proxy/ingress.
40+
- Ensure database credentials and API secrets are rotated and scoped minimally.
41+
42+
Rollback & Disaster Recovery
43+
- Keep deployment artifacts tagged with commit SHAs.
44+
- Support quick rollback by redeploying a previous tag.

0 commit comments

Comments
 (0)