GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chrisforrette/foodtrucks-api: Food Trucks API

BranchesTags
Open more actions menu

Latest commit

 

History

29 Commits
29 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github
.github
 
 
app
app
 
 
scripts
scripts
 
 
terraform
terraform
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
.sequelizerc
.sequelizerc
 
 
Dockerfile
Dockerfile
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
cluster.js
cluster.js
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Food Trucks API

Requirements

  • Node.js 9.x
  • Postgres 9.x
  • Terraform 0.10.x (for provisioning)
  • Heroku CLI (for provisioning)

Quick Start

Create a Postgres DB

createdb foodtrucks

Create a .env file in the root of the project and drop in the DB URL, swapping in your own username/password:

DATABASE_URL="postgres://yourusername:yourpassword@localhost/foodtrucks"

Build the tables in the database (if you've done this before, it will overwrite them so be careful) and import Food Truck data:

./scripts/syndb.js
./scripts/import_food_truck_data.js

Install NPM dependencies and start the server

nvm use # Run this if using NVM for Node version management
npm i
npm run dev
curl -i http://localhost:3000/food-trucks

Provisioning

Terraform is used to provision a server and addons on Heroku. Makefile has its own plan and apply commands, wrapping the Terraform commands of the same name for ensuring proper data-passing.

To create a Terraform, login with the Heroku CLI:

heroku login

Then run:

make plan ENV=staging TAG=1.2.3

Assuming the plan looks correct, apply it, provisioning server components:

make apply ENV=staging

CircleCI

CircleCI is configured to automatically deploy everything merged to master to a staging environment, and to deploy every Semver-like tag (e.g. v1.5.2) to a production environment. In order to do that, those environments must be set up first using Terraform following the Provisioning instructions above, and the CircleCI project needs HEROKU_EMAIL and HEROKU_AUTH_TOKEN environment variables in order to successfully execute the deployment script at scripts/deploy.sh.

To set these, go into the CircleCI project settings for this project, go into "Environment Variables", set HEROKU_EMAIL to the email of the Heroku account, and HEROKU_AUTH_TOKEN can be grabbed by running this with the Heroku CLI: heroku auth:token.

About

Food Trucks API

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.