# Frontend-Auth

## Overview

This frontend application provides to the user a UI to login. It is meant to
become, in the long term, a Oauth2 Single Sign On. This application is composed
of a lightweight Flask backend and all the static files are compiled using
node and Gulp.

## Getting Started

### Requirements

* Python3.4

### Static files

Before launching the server, you should first compile the static files:

```bash
cd static;
npm install
npm run deploy
```

### Server Installation

The installation process is very straightforward. The first step you have to do
is install Python 3.4, then get the source from github, create the virtual
environment and start playing!


* #### Install Python 3.4 (on Mac)
  ```
  brew install python3
  ```

* #### Get the code
  ```bash
  mkdir auth
  cd auth

  git init
  git add remote orchard https://github.com/theorchard/frontend-auth.git
  git add remote fork your-fork-url
  git pull orchard master
  ```

* #### Set up a virtual Python environment

  When you have the local copy, you need to create a running environment. Run:

  ```bash
  pyvenv-3.4 env
  source env/bin/activate
  pip install -r requirements.txt
  pip install -r requirements-dev.txt
  ```

* #### Launch the server

  Make sure you are in the virtual environment. You should see `(env) $`
  prefixed in your prompt.

  ```bash
  python dev.py
  ```

* #### Running tests

  We use [Pytest](http://pytest.org/) to run our tests.

    ```bash
    py.test tests
    ```
  [Pydebug](https://docs.python.org/2/library/pdb.html) is useful for debugging

    ```bash
    import pdb
    pdb.set_trace()
    ```
    Place that anywhere in the code and it will pause there during the test and you can inspect variables
