FastApi clinic services directory for sierra leone - SDG 3
# Clinic Service API
FastAPI clinic services directory for Sierra Leone — SDG 3: Good Health and Well-being
## Problem
In Sierra Leone, patients often travel to health facilities without knowing
whether that facility offers the service they need. There is no single open
directory of clinics and their services. This API solves that.
## SDG Alignment
This project supports SDG 3 — Good Health and Well-being by making clinic
and service information searchable and openly available. The is_free field
flags Free Healthcare Initiative coverage, supporting **SDG 10 — Reduced
Inequalities**. The MIT license makes it a digital public good.
## Features
- Search clinics by name, district or service
- Full CRUD for clinics, services and reviews
- JWT authentication with role-based access
- Async external health feed endpoint
- Swagger UI and ReDoc documentation
## Tech Stack
- FastAPI + Python 3.11
- PostgreSQL + SQLAlchemy ORM
- OAuth2 + JWT (python-jose)
- bcrypt password hashing (passlib)
- Supabase (hosted PostgreSQL)
## Getting Started
### Prerequisites
- Python 3.11+
- Git
### Setup
```bash
git clone
github.com
cd Clinic-service-api
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Fill in your DATABASE_URL and SECRET_KEY in .env
```
## Run
```bash
uvicorn app.main:app --reload
```
## Docs
• Swagger UI:
localhost
• ReDoc:
localhost
## API Workflow
1. Register: POST /api/v1/auth/register
2. Login: POST /api/v1/auth/login → copy the token
3. Click Authorize in Swagger UI → paste token
4. Search clinics: GET /api/v1/clinics/search?service=malaria
5. Create clinic (admin only): POST /api/v1/clinics/
## API Endpoints
>
> |Method|Path |Auth |Description |
> |------|----------------------------------|-------|----------------|
> |POST |/api/v1/auth/register |No |Register user |
> |POST |/api/ …