Skip to content

Latest commit

 

History

History
81 lines (61 loc) · 3.73 KB

README.md

File metadata and controls

81 lines (61 loc) · 3.73 KB

Waffle.io - Columns and their card count Build Status CodeFactor Maintainability Gitter Room Package Version MIT License Last Commit

contest.io - Create opinionated programming contests for your team!

Setup

Pre-Requirements

  • yarn
  • virtualenv
  • sqlite3

Initialize VirtualEnv

virtualenv -p python3.6 venv

Activate it (must be done in every new shell in the working directory) and install the python dependencies

source venv/bin/activate
pip3 install -r requirements.txt

Install npm dependencies

yarn install
cd client/ && yarn install

Create/Recreate database (also on changes to server/database/schema.sql)

yarn db-rewrite

Running

Run the flask setup

pip3 install -e .

Start Vue Development Server and Flask Backend

yarn dev
// navigate to localhost:3000 for FrontEnd
// navigate to localhost:5000 for BackEnd

If you want to only serve the Frontend (not recommended)

cd client/ && yarn dev

.env Variables

We are applying the 12-factor principles to protect our application secrets. Therefore, the app settings are managed using dotenv. For the BackEnd to work, save the following values in your root .env file:

GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
SECRET_KEY=...

Replace the dots with your own variables. For the Github Client ID and Secret, register contest.io as a new Github OAuth application here. You may name it something like 'contest.io-dev-YOUR_USERNAME'. Set the authorization callback url to http://localhost:5000/api/github-callback

The SECRET_KEY variable can be set to whatever you want.

API Docs

For the returned objects, see the database schema

/api/tasks

Method Parameter HTTP Header
and Body
Description Required Example
GET tags - Comma-seperated list of tags
to be matched by
the returned tasks
Returns the task
No /api/tasks?tags=graphs,implementation

/api/contest

Method Parameter HTTP Header
and Body
Description Required Example
GET code - The contest's hexadecimal code
Returns the contest
Yes /api/contest?code=f9bf78b9a18ce6d46a0cd2b0b86df9da
POST - Content-Type = application/json

{
"contestname": "testContest-1",
"date_start": "2017-05-12",
"date_end": "2017-06-12",
"visible": 1,
"contestgroups": [1, 2, 3]
}
Add a new contest
Return the new contest's code
- -
DELETE code - The contest's hexadecimal code
Deletes the contest
Yes /api/contest?code=f9bf78b9a18ce6d46a0cd2b0b86df9da