hackoregon / transportation-system-backend

2018 repo for the transportation api backend
MIT License
8 stars 2 forks source link

Base API functionality #21

Closed kiniadit closed 6 years ago

kiniadit commented 6 years ago

Docker

switched from env.sh to .env to handle environment variables. Possibly more scalable created two separate Dockerfiles - DOCKERFILE.db and DOCKERFILE.api for postgres and api containers repsectively Django

Models for crash, partic and vhcl (tables from the ODOT Postgres db) now working Corresponding API endpoints now accessible via GET requests pagination support added API ROOT is accessible from - http://:8000/api/ crash tables are accessible from - http://:8000/api/crashes/ partic tables are accessible from - http://:8000/api/participants/ vhcl tables are accessible from - http://:8000/api/vehicles/

BrianHGrant commented 6 years ago

Resolved merge conflicts. I am able to run api by:

  1. copy env.sample to .env and fill in remaining variables
  2. download the sql file from google drive and place in the bin folder
  3. run docker-compose build
  4. run docker-compose up - first time will run the load script on postgres/postgis db, the api container will fail (another issue is open to fix)
  5. stop and restart the containers
  6. browse to localhost:8000/api in browser
  7. click on the get crash endpoint and see crash data.