Giter Club home page Giter Club logo

pairmotron's Introduction

Pairmotron

Build Status

Pairmotron is an app powered by Phoenix that randomly pairs up users within groups on a weekly basis to work on a project or just write some code!

Local Installation

Prerequisites

  • Elixir >= 1.4.0
  • PostgreSQL

Running it

  • Install dependencies with mix deps.get
  • Setup environment variables for your PostgreSQL user (PG_USER) and password (PG_PASSWORD)
    • On Mac or Linux add this to your .bashrc or .zshrc:
export PG_USER="example_username"
export PG_PASSWORD="example_password"
export PG_HOST="localhost"
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with npm install
  • Start Phoenix endpoint with mix phoenix.server

Developing and Testing with Docker

Using this model of development allows you to not install anything other than docker.

Running it

  • docker-compose up -d web
  • docker-compose exec web mix deps.get
  • docker-compose exec web mix ecto.create
  • docker-compose exec web mix ecto.migrate
  • docker-compose exec web npm install
  • docker-compose restart web

Run the Tests in Docker

  • docker-compose run -e "MIX_ENV=test" web mix test
  • Only test a specific test file
    • docker-compose run -e "MIX_ENV=test" web mix test test/controllers/group_controller_test.exs

Check it out in a browser

Now you can visit localhost:4000 from your browser.

Deploy to Production

Ready to run in production?

Environment Variables to set

  • SECRET_KEY_BASE - Used to generate session cookies.
  • PAIRMOTRON_EMAIL_DOMAIN - The domain configured in Mailgun to send password reset email.
  • PAIRMOTRON_MAILGUN_API_KEY - The API key given by Mailgun for the configured domain.

JWT Key Configuration

Pairmotron uses the ES512 algorithm to generate JSON Web Tokens. You will need to generate a key and set the appropriate environment variables.

To generate a key do the following from the root pairmotron directory:

iex -S mix

iex> JOSE.JWK.generate_key({:ec, "P-521"}) |> JOSE.JWK.to_map
{%{kty: :jose_jwk_kty_ec},
 %{"crv" => "P-521",
   "d" => "Ae-wdbGhjfpxapevgJDAxaiGHmKYoyWnYDLeAb9jALSBNBzkyelSL-FUHcdFw1B7V2FvPy3YaHEkrVqwPwBwNvLP",
   "kty" => "EC",
   "x" => "AWFw34kJJaT8Lwew8IG4LcDDr8sMcURn4PhUWMBiMW5vGGonteVvZQAVdW652GFOY9z1nlhymKYXBwNy3PHlz9Z_",
   "y" => "APLY5Rww4oI1fhUI7JrIkmHPymzgpGOKsNXHhxoMJDycdoQPWfaimoOX-afOHoJiGWwh2m_EbTSC-4lC4Cz0uzPk"}}

And then set the following environment variables:

  • GUARDIAN_JWK_ES512_D - The "d" value of the key generated above.
  • GUARDIAN_JWK_ES512_X - The "x" value of the key generated above.
  • GUARDIAN_JWK_ES512_Y - The "y" value of the key generated above.

pairmotron's People

Contributors

mbramson avatar ericworkman avatar joelbyler avatar adeverteuil-cmm avatar austenmadden avatar

Watchers

James Cloos avatar  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.