FastAPI/postgres implementation of the STAC API specification.
master
Extended from the arturo-stac-api project to include congito based authorization and elastic integration.
.
├── alembic # Database migrations
│ └── versions # Migration versions
├── stac_api
│ ├── clients # Database CRUD
│ ├── models # Database and API data models
│ ├── resources # API endpoints
│ └── utils # FastAPI/Cognito dependencies
└── tests
├── api # Test api creation
├── clients # Test application logic
└── resources # Test api endpoints
Use docker-compose to deploy the application, migrate the database, and ingest some example data:
docker-compose build
docker-compose up
For local development it is often more convenient to run the application outside of docker-compose:
make docker-run
The database container provided by the docker-compose stack must be running. Run all tests:
make test
Run individual tests by running pytest within the docker container:
make docker-shell
$ pytest -v
Copy .env file from cloud storage:
aws s3 cp s3://c-core-secure/config/sherlock/gcp-dynamic-stac/.env .env
Build:
docker build -t gcr.io/ln-sherlock/stac-api:latest .
Push:
docker push gcr.io/ln-sherlock/stac-api:latest
Run local:
docker run --rm -it -p 8080:8080 gcr.io/ln-sherlock/stac-api:latest
Install dependencies:
pipenv install
pipenv shell
Run in development mode:
uvicorn stac_api.app:app --port 8080 --reload