Giter Site home page Giter Site logo

ked-recruiter's Introduction

README

Knock Every Door's Recruiter is a layer over the Action Network API to allow canvassing organizers to search for volunteers in their area. It consists of a Rails backend, used for storing some minimal data over top of Action Network and making GIS calculations to find geographically close zip codes to the user.

On the frontend, Recruiter provides a web interface for querying contacts within a 25 mile radius of the zip code the user enters. It then cycles through those contacts, giving the user a chance to call them and enter feedback.

Installation

Recruiter is packaged up with its dependencies in Docker. To run,

  1. Clone the repo:
$ git clone https://github.com/JonathanTR/ked-recruiter && cd ked-recruiter
  1. Create an environment file in config/environments. Secrets should be stored in a .env file named after their environment in config/environments, ie. config/environments/development.env. They should be written in the format KEY=VALUE. You'll need to get these from one of the project owners.
  2. Run using docker-compose. along with setup script:
$ docker-compose up -d
  1. After spinning up a container on docker, you will need to run a setup script on the web container. This creates your database, adds the PostGIS extension, and loads in a static list of Zip Codes and their coordinates for querying user location.
$ docker-compose run web bin/setup
  1. The app will be available at localhost:4000, with hot module reloading available.

To inspect logs, use:

docker logs recruiter-web

To run a bash session on the web box, use $ docker exec -it recruiter-web bash

If you would like to run the app without Docker in development mode, you'll need to modify the database.yml file slightly. Just comment out or remove the host and user keys for your development environment, as Docker uses these to detect the database server.

Then you are free to use $ foreman start to run the client and backend together, or you can run them separatedly (you'll need to run the client from the client directory).

Testing

Rails api tests can be run with

$ rails test

Client tests can be run from the ./client folder with:

$ cd client && npm run test

Architecture

As a general rule, development architecture and environments should match their production counterparts as closely as possible. There are some very small differences in this app that are worth noting.

Development

Recruiter is separated into a Rails backend api and a React frontend client. In development mode, these run in separate processes using the foreman gem. This allows the developer some of the benefits of webpack like hot module reloading and helpful error messages in the server logs. These will start up on: Backend API: localhost:3000 Frontend Client: localhost:4000

Production

The app runs slightly differently in production. In production, Rails serves a compiled version of the frontend client out of our public folder (bin/setup and bin/update both compile the client and copy it to our public folder). This gives us the benefit of speed (from the compiled and minified files) and allows us to make requests from the same origin, making it slightly more secure.

Production also serves the client through the PublicController, which adds a basic auth username and password to the application at the time of this writing.

Fortunately, you can preview this behavior in development. All you have to do is visit localhost:3000 and you'll see the latest compiled version of the app as you would in the production environment.

ked-recruiter's People

Contributors

jonathantr avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ggladden

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.