Coder Social home page Coder Social logo

pikasriel / wikipedia-speedruns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wikispeedruns/wikipedia-speedruns

0.0 0.0 0.0 1.07 MB

Source code for Wikipedia Speedruns!

Home Page: https://wikispeedruns.com

License: MIT License

Python 32.92% HTML 22.05% JavaScript 33.26% CSS 11.78%

wikipedia-speedruns's Introduction

Competitive Wikipedia Speedrunning

This repository holds the code for wikispeedruns.com.

1. Prerequisites

2. Python Setup

Setup Virtual Environment (optional)

We recommend creating a Python virtual environment for running the server.

python -m venv env

For Windows Powershell:

./env/Scripts/Activate.ps1

For Linux

source env/bin/activate

Install Requirements

Then install the requirements (with your virtual environment activated)

pip install -r requirements.txt

3. App Setup

There are a number of scripts to help setup the web app in scripts.

Once the MySQL server is running, you will need to create an account. By default we assume an account user with no password (see default.json). If you wish to use a different MySQL setup, you can create prod.json with the relevant MySQL fields in config which will override default.json.

Then create the database and tables using the provided script.

cd scripts
python create_db.py

There is also an interactive script (with instructions in the scripts) which can be used to set up a local admin account. Through the admin account, prompts can be managed through /manage.

cd scripts
python create_admin_account.py

4. Running

(Optional) Set environment variables for development

Set the environment variable FLASK_ENV in whaterver command prompt you use plan to use for running the flask server. This will allow the local instance to reload automatically when files are changed.

For example, in Linux

export FLASK_ENV="development"

Or in Windows Powershell

$env:FLASK_ENV="development"

Start the server

From the top level directory

flask run

5. Testing Locally

In order to run the tests locally, you need to create another account in MYSQL with username testuser and password testpassword. Our tests are configured to run against this account by default.

Then, simply run pytest from the test directory.

cd test
pytest

Note that these tests are also run in Docker upon making a PR using Github workflows. In the future we may setup docker to run tests as well.

wikipedia-speedruns's People

Contributors

arpansahoo avatar bricehalder avatar codethejason avatar dqian3 avatar maggarwal99 avatar melodymhsu avatar mliu59 avatar nathanv09 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.