Skip to content

arthurcode/squad-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Squad Maker Web App

Implements a Squad Maker web application using the python Flask framework and Bootstrap library. For a description of the challenge project and its requirements visit this link.

An instance of this application has been deployed to PythonAnywhere and is temporarily accessible at http://rhyanarthur.pythonanywhere.com

Assumptions

  1. The Players REST API will not require authentication.
  2. The application will not be expected to scale to a very large amount of players. It will be reasonable to display all players and/or squads on the same page without the need for pagination. This also implies an O(n^2) squad-making algorithm will be acceptable.
  3. The Bootstrap CDN and googleapis.com domain will be accessible from the client (I didn't download local copies of the hosted resources I'm using).

Running the App

  1. Clone the squad-maker repository
    git clone https://github.com/arthurcode/squad-maker.git
  2. Create a python 3.6 virtualenv
    mkvirtualenv --python=/usr/bin/python3.6 my-virtualenv
  3. Install required python packages in the virtualenv
    pip install -r /path/to/squad-maker/requirements.txt
  4. Set the FLASK_APP and FLASK_ENV environment variables
    export FLASK_APP=squad_maker_app
    export FLASK_ENV=development
  5. Run the development server (IP address and port will be printed to the screen)
    cd /path/to/squad-maker
    flask run

Configuring the App

To modify the default application settings create a new configuration file .py file and set the SQUAD_MAKER_SETTINGS environment variable to point at the new file.

export SQUAD_MAKER_SETTINGS=/path/to/new/config.py

Then restart the development server.

Running Tests

  1. Make sure the squad-maker directory is on your PYTHONPATH
    export PYTHONPATH=/path/to/squad-maker/
  2. Run the unit tests
    cd /path/to/squad-maker/tests/unit
    python -m unittest
  3. Run the benchmark.py integration test
    cd /path/to/squad-maker/tests/integration
    ./benchmark.py

About

Squad Maker challenge project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published