Skip to content

Latest commit

 

History

109 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WiiGolfQ/backend

This repository contains WiiGolfQ's backend implementation. It is written in Django and uses Django REST Framework for its REST API. It uses PostgreSQL as its choice of SQL database.

Features

  • Matchmaking
  • Rating system using OpenSkill
  • Leaderboards for player ratings and individual score performances
  • REST API

Running locally

Install PostgreSQL

su - postgres
createuser wgquser
createdb wgqdb
psql
# enter postgres password (`postgres` by default)
alter user wgquser with encrypted password 'InsertPasswordHere';
grant all privileges on database wgqdb to wgquser;

Cloning and changing environment variables

git clone git@github.com:wiigolfq/backend
cd backend

cp .env.example .env
nano .env  #change environment variables, see below

Environment variables

  • DJANGO_SECRET
  • POSTGRES_DB
  • POSTGRES_USER
  • POSTGRES_PASSWORD
    • Postgres credentials you just made.
  • POSTGRES_HOST
    • The database should be at [POSTGRES_HOST]:5432. Defaults to localhost if DEBUG is true.
  • DEBUG
    • Leave false in production.

Running

python3 -m venv venv
source venv/bin/activate

pip install -r requirements.txt

python3 manage.py migrate

python3 manage.py createsuperuser
# follow on-screen instructions

python3 manage.py runserver

The backend should now be up at localhost:8000. Visit http://localhost:8000/admin to log into the admin panel with the superuser credentials you created.

About

WiiGolfQ backend

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages