Spring GraphQL API based on normalising the Amazon Reviews 2023 dataset in Postgres.
See: https://huggingface.co/datasets/McAuley-Lab/Amazon-Reviews-2023/tree/main
The data needs to be downloaded and prepped for import into the database.
-
Download the following files to data/import:
-
Then run the following task:
make parse
Note: Feel free to download, merge, and parse the data for all of the categories—but it's a lot bigger!
To run the Spring api and Postgres database via Docker:
direnv allow
make docker-build
docker compose up -d
Open http://localhost:4000/graphiql?path=/graphql
You can also directly run the Spring api at the same time with:
make run
Open http://localhost:8080/graphiql?path=/graphql
With the Postgres database started:
make test
Bring up the database instance with Docker and then:
# Create and load tables
bash docker-db-up.sh
# Dump and drop tables
bash docker-db-down.sh
To get a shell to the running Postgres instance:
make docker-bash-db
postgres@...$ psql test
test=# \d