GithubHelp home page GithubHelp logo

ttavenner / okcandidate-platform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code4hr/okcandidate-platform

0.0 1.0 0.0 765 KB

You don’t have to go to the polls alone. Find your OKCandidate.

License: MIT License

JavaScript 91.30% Nginx 1.05% CSS 6.89% Shell 0.76%

okcandidate-platform's Introduction

okcandidate-platform

A comprehensive refactor of OKCandidate based on feedback from users and our partners at the Virginian-Pilot.

Develop branch status
Codeship Status for Code4HR/okcandidate-platform

Setup

This Project Uses Docker and Docker Compose

  1. Clone the project from GitHub (git clone ...)
  2. Install Docker, using the steps for Docker CE for your specific OS and Edition/Distro via store.docker.com.
  3. NOTE: Don't just install docker from brew or apt-get etc. You'll get an old or incomplete install.
  4. From a shell in the project dir, start both the postgres and node containers with docker-compose up.
    1. Add a -d to start in the background, e.g. docker-compose up -d.
    2. See how the "services" of this 2-tier app are setup in docker-compose.yml. We have app and db.
    3. docker-compose --help is your friend.
    4. Use docker-compose logs app to see the node logs, for example.
    5. Use docker-compose exec app bash to get a bash shell inside the running node container, for example. You can also do that against db so you can use the psql tool against the database interactively.
    6. To just run a one off psql command, you could do something like this from your host shell: docker-compose exec postgres pg_dump -u postgres -d postgres > somefile.sql
    7. When you're done, you can docker-compose stop to exit the running containers, or docker-compose down to remove the containers, virtual network, and db data.

In Summary:

clone repo
Install Docker
docker-compose up

That will get you started with OkCandidate!

Fixture Data

In a development environment, some records are generated automatically.

User Records

These user/pass combinations can be used to login as user of various roles.

  // config/dev-fixtures/user-fixtures.js

  ...

  {
    name: 'A. Voter',
    emailAddress: '[email protected]',
    password: 'leafygreen'
  },
  {
    name: 'A. Candidate',
    emailAddress: '[email protected]',
    password: 'mashedpotato'
  },
  {
    name: 'Anne Admin',
    emailAddress: '[email protected]',
    password: 'adminpass'
  }

  ...

Testing

Creating Tests

We use mocha and superagent for testing. See the trails.js documentation to learn more about writing tests for okcandidate.

Running Tests In Docker

Assuming you're using docker-compose, if nothing is currently up, then you can run tests in a new container with docker-compose run app npm test. If you've already started the containers with something like docker-compose up -d then you can run tests in that same container with docker-compose exec app npm test.

Contributing

This project follows a loose interpretation of Git flow. Master is production, develop is staging. Each feature gets one branch. When opening a PR, please open it against the develop branch.

okcandidate-platform's People

Contributors

wbprice avatar ttavenner avatar qwo avatar bretfisher avatar rydente avatar beetalogist avatar kaxcode avatar

Watchers

 avatar

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.