Rust implementation to query Starbucks store, based on Alex DeBrie's amazing DynamoDB Guide
Data downloaded from Kaggle
I prefer using local DynamoDB for testing purposes. To setup your local DynamoDB, follow the instructions
Create a .env in your project root and add endpoint for your Local DynamoDB
endpoint=http://localhost:9090/
Build the project
cargo buildCreate the Dynamo Table
cargo run --bin createLoad the data
cargo run --bin load < src/bin/directory.csvCool now you are all set to run your API.
Start the API
cargo run --bin webcurl http://127.0.0.1:9000/search?country=US&state=NY
[
{
"storeNumber": "28442-249823",
"storeName": "Teavana - Crossgates Mall",
"streetAddress": "1 CROSSGATE MALL RD, #B205A",
"city": "ALBANY",
"state": "NY",
"country": "US",
"postcode": "12203",
"longitude": "-73.85",
"latitude": "42.69"
},
{
"storeNumber": "75393-105057",
"storeName": "College St. Rose",
"streetAddress": "420 Western Ave, Hilton Garden Inn at Albany Medical Ctr",
"city": "Albany",
"state": "NY",
"country": "US",
"postcode": "122031400",
"longitude": "-73.79",
"latitude": "42.66"
},
...
]curl http://127.0.0.1:9000/search?country=US&state=NY&city=ALBANY
curl http://127.0.0.1:9000/search?country=US&state=NY&city=ALBANY&postcode=12203