Watch a short project overview walkthrough
Check out the frontend React app repo
Use the interactive API documentation
- FastAPI
- SQLAlchemy
- GeoAlchemy2
- Heroku (deployment)
- Programatically generated spatial database using SQLAlchemy/GeoAlchemy2
- Fully asynchronous operations using FastAPI and SQLAlchemy 2.0 style
- Allows users to perform spatial and attribute-based queries to explore playground sites in their vicinity
- Joined table inheretance structure allows easy loading of attribute tables for storing secondary characteristics
- Complete package- one toolkit to create the database, perform ETL on the data, service queries from the endpoints, and test the API before deployment
├── heroku.yml
├── Procfile
├── requirements.txt
├── api/
│ ├── __init__.py
| ├── dependencies.py
│ ├── main.py
| └── /routers
| ├── __init__.py
| ├── submit.py
| └── users.py
├── models/
│ ├── __init__.py
│ ├── enums.py
│ ├── schemas.py
│ └── tables.py
├── utils/
│ ├── __init__.py
│ ├── create_spatial_db.py
│ └── playground_data_to_db.py
└── test/
├── __init__.py
├── conftest.py
├── test_api.py
└── test_db_schema.py
/api
contains the api source code. uses PostGIS to process spatial queries.
/api/routers
contains a FastAPI implementation for user authentication, using password hashing and JWTs. Currently not implemented in the site.
/models
contains SQLAlchemy database table models and FastAPI schemas, along with a useful utility to define and unpack custom PostgreSQL ENUM types.
/utils
create_spatial_db.py
contains a class which offers methods to create databases with PostGIS-enabled spatial datatypes, based on the SQLAlchemy models defined inmodels/tables.py
playground_data_to_db.py
uses pandas and sqlalchemy models to perform ETL operations on the playground data and imports it into the database, including the spatial data components.
/test
Contains an extensive pytest test suite, which provides a continuous integration testing baseline to ensure efficient API development