Public API that exposes select tables from the PantryTrak datasource
Built and deployed using the Ruby on Jets framework
From the pantry-finder-api
folder
bundle install # Install dependencies
./bin/setup_dev_db # Seed development and test databases
Unit Tests
bundle exec rspec
Development server
bundle exec jets server
Console
bundle exec jets console
This api exposes an existing data source. From time to time, new tables or columns are added to the source database. The db/schema.rb
file needs to be kept in sync when this happens. It's also nice to take a fresh dump of the db at that time to make local development easier.
DB_HOST=<rds_host> DB_USER=<user> DB_PASS=<password> DB_NAME=freshtrak_public bundle exec jets db:schema:dump
rm ./setup/seed.sql.zip
mysqldump -h <rds_host> -u <user> -p<password> freshtrak_public > setup/seed.sql
zip setup/seed.sql.zip setup/seed.sql
rm setup/seed.sql
This project is deployed using the jets cli.
Under the hood it creates nested CloudFormation stacks.
The relevant configuration files are at config/application.rb
and config/environments/*
.
Environment variables are set using the .env.*
files.
AWS_PROFILE=<profile> AWS_REGION=us-east-2 JETS_ENV=<env> bundle exec jets deploy