Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

code-for-nashville/nashville-zone-lookup

Repository files navigation

Nashville Zone Lookup Build Status

Answering your Nashville acceptable land use questions.

Structure

Nashville Zone Lookup is composed of two separate parts:

  • A VueJS frontend
  • Elixir/Phoenix backend

This backend serves both the frontend and the data consumed by the frontend.

Running

Prerequisites

  • Make sure Elixir and NodeJS are installed.
  • Make sure Docker is installed

To build and run this app locally:

  • Install the Mix dependencies mix deps.get.
  • Compile the project mix compile.
  • Run the Phoenix server mix phx.server.
  • Navigate to frontend app cd frontend.
  • Install the NPM dependencies npm install.
  • Run the frontend's HTTP server npm run dev.
  • Run the database in the background with docker run -p 5432:5432 --name nashville_zone_lookup_dev -d postgres:9.6.
  • Create and migrate your database with mix ecto.setup && mix ecto.migrate
  • Optionally run the Postgres shell with docker exec -it nashville_zone_lookup_db psql -U postgres nashville_zone_lookup_dev

Note: Additional commands are available for the frontend app and are documented in its README.

To build and run this app for production:

  • Install the Mix dependencies mix deps.get.
  • Compile the project mix compile.
  • Build the frontend app for the Phoenix server mix nashville_zone_lookup.prepare_static_assets.
  • Run the Phoenix server mix phx.server.

Testing

To unit test the backend:

  • Install the Mix dependencies mix deps.get.
  • Compile the project mix compile.
  • Run tests mix test.
  • Run tests against external systems mix test --include external.

To test the frontend:

  • Navigate to frontend app cd frontend.
  • Install the NPM dependencies npm install.
  • Run the unit tests npm run unit.
  • Run the end-to-end tests npm run e2e.
  • Run the unit and end-to-end tests npm run test.

Importing Data

  • Make sure you've followed the database setup instructions in Running.
  • Download the latest zoning spreadsheet here as a CSV
  • Run mix help nashville_zone_lookup.ingest_land_use_table and follow instructions to execute that command.
  • If you need to re-import data, drop and re-create your database: mix ecto.drop && mix ecto.setup && mix ecto.migrate

Heroku Deployment

This repository is configured to deploy master automatically to Heroku via Travis CI.

Planning

Email [email protected] if the above links do not work.

License

MIT