State Facts is a containerized REST + SOAP API with a responsive dashboard that provides U.S. state facts and population data. Built with Flask, Spyne, MariaDB, and Chart.js — and deployed on Raspberry Pi.
- REST API endpoints for querying state info and cities
- SOAP API with WSDL support via Spyne
- Dashboard with interactive population charts (Chart.js)
- MariaDB for storage, with SQL seed scripts
- Dockerized with separate Dev and Prod setups
- Ready for CI/CD and deployment on Raspberry Pi
- Backend: Flask (REST), Spyne (SOAP), Python 3.9.6
- Database: MariaDB
- Frontend: HTML, JavaScript, Chart.js
- Infra: Docker, Docker Compose,
.envsecrets
Clone using SSH:
git clone git@github.com:mbulkeley/statefacts-api.git
cd flask-apiOr with HTTPS:
git clone https://github.com/mbulkeley/statefacts-api.git
cd flask-apiMYSQL_ROOT_PASSWORD=yourpassword
MYSQL_DATABASE=flaskdb
MYSQL_USER=flaskuser
MYSQL_PASSWORD=yourpassword
DB_HOST=db| Method | Route | Description |
|---|---|---|
| GET | /states |
List all states |
| GET | /states?timezone=CST |
(Coming soon) Filter states by timezone |
| GET | /states/<abbr> |
State details + top 5 cities |
| GET | /states/<abbr>/cities |
Top 5 cities only |
| GET | /search?q=keyword |
(Coming soon) Search by city/state |
- Endpoint:
POST /soap - WSDL: http://localhost:5000/soap/?wsdl
- Method:
get_state_info(abbr) - Returns: State name, capital, timezone, top cities
MIT © Michael Bulkeley