Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 1.99 KB

README.md

File metadata and controls

86 lines (67 loc) · 1.99 KB

Sherlock Stac Api (from arturo-stac-api arturo-stac-api)

FastAPI/postgres implementation of the STAC API specification.

master

Extended from the arturo-stac-api project to include congito based authorization and elastic integration.

Project Structure

.
├── 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

Local Development

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

Testing

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

Environment variables

Copy .env file from cloud storage:

aws s3 cp s3://c-core-secure/config/sherlock/gcp-dynamic-stac/.env .env

Docker

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

Development

Install dependencies:

pipenv install
pipenv shell

Run in development mode:

uvicorn stac_api.app:app --port 8080 --reload