This is a FastAPI version of the dbt jaffle shop project. The jaffle shop dataset is copied from dbt jaffle data.
When the API is running, docs are available at /docs. For all entities, there are collection and single entity endpoints to retrieve the data. The collection endpoints are paginated and have a limit of 100 items. The link to the next page is returned in the response headers. The orders endpoint includes the order items nested inside each order object.
This project requires python 3.10+ and uv to be installed.
Some tests are quite slow as the dataset is quite large. To run the tests faster, use the following command:
make test-fast
All tests can be run with:
make test
make run-dev
make run
/app - FastAPI app
/seed - Seed data as csv files from dbt jaffle shop project
This app is currently deployed to the dlthub digital ocean app platform. Pushes to the main branch will result in a deployment. Please run make freeze-requirements
to update the requirements.txt file from the uv lockfile, as that is what Digital Ocean uses to install the dependencies.
source = rest_api_source(
{
"client": {
"base_url": "http://localhost:8000",
"paginator": {
"type": "header_link",
},
"session": FastAPISession(app),
},
"resources": [
"customers",
"products",
"stores",
"supplies",
# orders includes items
# we only load orders for january 2017
{
"name": "orders",
"endpoint": {
"path": "orders",
"params": {
"start_date": "2017-01-01",
"end_date": "2017-01-31",
},
},
},
],
},
)