Skip to content

edbourque0/clashstats

Repository files navigation

Clashstats

A Django web app to get Clash Royale player info, battlelog and a clan ranking based on the ELO ranking system.

Note that I am a beginner with Python and web development in general. This is one of my first projects, so this project may not follow all development guidlines and may contain bugs.

Player stats screenshot

Player stats

Clan ranking screenshot

Clan ranking

2v2 ranking screenshot

2v2 ranking

Run Locally

Prerequisites

  • Python 3.11

Installation

Clone the project

  git clone https://github.com/edbourque0/clashstats.git

Go to the clashstats directory

  cd clashstats

Create a .env file at the root of the project or use the env.exmaple file

  API_KEY=<your_api_key>
  DB_HOST=<database_host>
  DB_NAME=<database_name>
  DB_USER=<username>
  DB_PASS=<strong_password>
  DB_PORT=<database_port>
  HOST=<host_ip>
  PORT=<host_port>
  DEBUG=<boolean>

Install dependencies

  pip install -r requirements.txt

Go to the clashstats app

  cd clashstats

Start the server

  python3 manage.py runserver

Environment Variables

Variable Name Description Example value Default value
DB_HOST Database host address localhost localhost
DB_PORT Database port number 5432 5432
DB_NAME Name of the database clashstats clashstats
DB_USER Database user username username
DB_PASSWORD Password for the database user P4Ssw0Rd password
API_KEY API key from Clash Royale API 873yr4n27837rn28o7yh2y45rgfghfd3 abc123
HOST IP/domain of your server 127.0.0.1 clash.example.com 127.0.0.1
PORT Port of the clashstats server 8000 8000
DEBUG Disable/enable debug mode True False

Tech Stack

Languages: Python, HTML, CSS

CSS components: Bootstrap

Framework: Django