Coder Social home page Coder Social logo

cscanlin / choice-optimizer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 2.2 MB

A tool to optimally distribute choices to consumers based on their rankings for each choice. Built with React and scipy.

Home Page: https://cscanlin.github.io/choice-optimizer/

License: MIT License

Python 16.98% HTML 7.06% JavaScript 60.30% CSS 9.98% Shell 5.67%

choice-optimizer's Introduction

Choice Optimizer

This application is designed to make it easy to place people into their top choices, subject to any specified constraints. Perfect for school admins, summer camps, and anyone else who had to do the previously difficult task of trying to make sure everyone gets the best outcome possible in a mathematically optimal way. (That is sure to disappoint everybody!)

See it live at: https://cscanlin.github.io/choice-optimizer/

Technology

This project was bootstrapped with Create React App, and uses redux for state management. It also uses react-bootstrap for some minor styling and the front-end is deployed with gh-pages.

The backend runs all of the data through scipy's linprog algorithm but requires some fairly heavy processing/vectorization to meet the required format. The main algorithm is deployed to Amazon Lambda and heavily leverages this excellent repo by @ryansb as well as Docker to compile and process the scipy/numpy dependencies for deployment.

Installing and Running

Installation

git clone https://github.com/cscanlin/choice-optimizer.git
cd choice-optimizer
pip install -r requirements
npm install

Running the Front-End Locally (with no API):

npm start

Running the Server Locally (Requires Python 3):

npm run build
python optimizer_server.py

(You don't even technically need the build to run the server as a simple web api)

Deploying (Requires Docker):

First you will need a new amazon lambda function, and to paste the url to OPTIMIZER_ENDPOINT in: src/constants/optimizerConstants.js. (There's actually quite a bit of configuration needed on the AWS side as well, but that's out of scope for this guide. I imagine if anyone want to use this themselves, they will be for the most part running it locally or cannibalizing functionality. If you want to deploy this somewhere yourself, you'll probably know how to figure this out.)

You will also need to change the S3 url in choice_optimizer_lambda/deploy_lambda.sh to one of your choosing.

Then, change the homepage url in package.json to your new homepage.

Finally, call the following which is the only thing required in subsequent deployments:

bash full_deploy.sh

This script calls three other scripts which does the following:

  1. builds C dependencies into a zip
  2. adds handler and optimizer script to zip, and uploads to s3
  3. deploys the front end to github pages

You can call any of these scripts independently by using the commands found in the full_deploy.sh file.

Questions, Comments or Bugs? Drop me a note on the issue tracker!

choice-optimizer's People

Contributors

cscanlin avatar

Stargazers

 avatar  avatar

Watchers

 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.