Hey there! 👋 Welcome to the Healthcare Claims Processing API — a powerful backend system built using FastAPI that streamlines the creation, management, and reporting of health insurance claims.
This app demonstrates:
- ✅ Secure JWT Auth
- 📄 CRUD for insurance claims
- 📥 CSV bulk claim upload
- ⏳ Async report generation (Celery + Redis)
- 🔔 Webhook notification on report completion
- 📉 Rate-limited endpoints
🔍 Explore how everything fits together — from models, authentication, background tasks, to webhook logic and error handling.
➡️ 🗂️ CLICK HERE TO OPEN THE PROJECT EXPLANATION PDF ⬅️
This PDF breaks down the entire backend system in a clear, structured format. Ideal for reviewers, tech leads, and curious developers! 🧑💻
git clone https://github.com/yourname/healthcare-claims-api.git
cd healthcare-claims-apipython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtredis-servercelery -A app.celery_worker.celery_app worker --loglevel=infouvicorn app.main:app --reloadVisit 👉 http://localhost:8000 to see your interactive Swagger API docs.
app/
├── main.py # FastAPI entrypoint
├── celery_worker.py # Celery configuration
├── Auth/
│ └── auth.py # Login & signup logic
├── Tasks/
│ └── tasks.py # Background job for reports
├── Utils/
│ ├── config.py # App settings
│ ├── database.py # SQLAlchemy DB setup
│ ├── logger.py # Custom logging
│ ├── models.py # ORM Models
│ └── schemas.py # Pydantic Schemas
├── reports/ # CSV output folder
└── tests/ # Pytest unit tests
You can test the API using:
🧩 Lightweight and beginner-friendly (recommended for quick local testing)
-
Open VS Code → Install Thunder Client
-
Send requests by setting:
Content-Type: application/jsonAuthorization: Bearer <your_token_here>(after login)
-
Upload CSV files directly in the request body for
/claims/bulk(premium feature)
🌐 Ideal for team collaboration and full-featured API testing
-
Import endpoints manually or use Swagger UI to copy requests
-
Add an environment with a variable for the token
-
Make sure to set headers:
Authorization: Bearer <your_token_here> Content-Type: application/json -
To test
/claims/bulk, go toBody > form-data, and upload the CSV file with key =file
Built-in testing via browser
- Visit: http://localhost:8000/docs
- Authorize using the JWT token via the top-right 🔒 button
- Interact with every endpoint live
POST /claims
Headers:
Authorization: Bearer <your_token>
Content-Type: application/json
Body:
{
"patient_name": "Jane Doe",
"diagnosis_code": "D123",
"procedure_code": "P456",
"claim_amount": 1500.00
}POST /auth/signup
{
"username": "testuser",
"password": "strongpassword"
}POST /auth/login
{
"username": "testuser",
"password": "strongpassword"
}Returns:
{
"access_token": "your_jwt_token",
"token_type": "bearer"
}🔒 Use it in requests:
Authorization: Bearer your_jwt_token
POST /claims
{
"patient_name": "John Smith",
"diagnosis_code": "D123",
"procedure_code": "P456",
"claim_amount": 1200.50
}GET /claims
Supports filters like: status, diagnosis_code, etc.
GET /claims/{claim_id}
PUT /claims/{claim_id}
{
"status": "APPROVED"
}DELETE /claims/{claim_id}
POST /claims/bulk
Upload claims from a .csv file
📌 Sample CSV:
patient_name,diagnosis_code,procedure_code,claim_amount
Alice,D12,P34,500
Bob,D56,P78,900
POST /claims/report
Response:
{
"task_id": "abc-123",
"status": "PENDING",
"message": "Report started"
}GET /claims/report/{task_id}
{
"status": "COMPLETED",
"file_path": "reports/claims_report_abc.csv"
}GET /claims/report/{task_id}/download
Returns the generated CSV 📥
POST /webhook
{
"task_id": "abc-123",
"url": "https://webhook.site/your-custom-url"
}Run unit tests using:
pytest tests/- 🔐 Authentication
- 📄 Claims CRUD Operations
- 📥 CSV Bulk Upload
- ⏳ Background Task (Celery) Status
Like the project? Star it ⭐ on GitHub. Got ideas or bugs? Open an issue — contributions are welcome!
Built with ❤️ by Mohammed