Skip to content

CivicTechAtlanta/atlanta-candidate-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atlanta-candidate-ui

UI for https://github.com/jordanstreiff/atlanta-candidate-api

A Code for Atlanta project

Build Setup

Installing dependencies

# install dependencies
npm install

Running in development

To develop locally against the database you first need to clone and follow the instructions for the backend.

Mac users may have an issue getting the backend setup because Postgres is required. The solution here may be helpful.

Once installed, you will need to change the origins setting of the backend server to allow CORS requests. Change config/application.rb to read as follows:

  config.middleware.insert_before 0, Rack::Cors do
    allow do
      origins '*' # this is the line you need to change
      #origins /https:\/\/codeforatlanta\.github\.com/
      resource '*', :headers => :any, :methods => [:get, :post, :options]
    end
  end

Next, change the baseURL variable to 'http://localhost:3000' in the files src/Offices.vue, src/Office.vue, and src/Candidate.vue.

You can now serve the frontend with

npm run dev

This will serve the frontend at localhost:8080. The server includes hot reload so no need to restart after saves.

Build for production with minification

  • Change all baseURL variables back to the prod version
  • Run the following command from your terminal
npm run build

Vue framework

For detailed explanation on how things work, consult the docs for vue-loader. Also useful is docs for Vuetify.