Backend for the Emergency Healthcare Critical Information Database System. Built with FastAPI and MySQL 8.4, provisioned via Docker.
- Docker Desktop
- Python 3.12+
- MySQL client (for running SQL scripts)
docker compose up -d dbThis starts a MySQL 8.4 container on port 3307.
for f in SQL/01_schema.sql SQL/02_staging.sql SQL/03_core_tables.sql SQL/04_etl_load.sql SQL/05_indexes.sql; do mysql -h 127.0.0.1 -P 3307 -u root -proot_pw < "$f"; donepip install -r requirements.txtuvicorn api.main:app --reload --port 8000The API will be available at http://localhost:8000. Interactive docs at http://localhost:8000/docs.
All accounts use password password123.
| Role | |
|---|---|
| admin1@example.com | Admin |
| doctor1@example.com | Doctor |
| patient1@example.com | Patient |
| Method | Path | Description |
|---|---|---|
| POST | /api/auth/login/ |
Authenticate and receive access + refresh tokens |
| POST | /api/auth/logout/ |
Logout (client discards tokens; returns 204) |
{
"email": "admin1@example.com",
"password": "password123"
}{
"access_token": "...",
"refresh_token": "...",
"user": {
"id": "1",
"name": "Admin User",
"email": "admin1@example.com",
"role": "admin",
"is_active": true
}
}| Setting | Value |
|---|---|
| Host | localhost |
| Port | 3307 |
| Database | ehcidb |
| User | ehci |
| Password | ehci_pw |
Connect via MySQL client:
mysql -h 127.0.0.1 -P 3307 -u ehci -pehci_pw ehcidb