MtG Nerd Stats

 Games   Stats   Search   Analytics   About  Login

MTG Nerd Stats

A Flask-based web application for tracking Magic: The Gathering Commander game data, statistics, colors, and more.
Built with Python, Flask, SQLAlchemy, and deployed using Passenger.


📌 Features


🧰 Tech Stack


🚀 Local Installation

git clone https://github.com/Skain-zf/CastleSkain/tree/main/nerdstats
cd nerdstats

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

pip install -r requirements.txt
````
---

## 🚀 Running Locally

```bash
python waitress_server.py

http://127.0.0.1:8080

🌐 Deployment (Host + Passenger)

The original installation of this application runs inside a subfolder under a WordPress site, using Passenger. The webhost uses cPanel. These directions are for that environment. You can ignore the .htaccess changes if you aren't under a Wordpress environment.

Steps to Deploy

/home/USER/virtualenv/APP/3.12/bin/pip install -r /home/USER/domain/mtgnerdstats/requirements.txt

RewriteCond %{REQUEST_URI} ^/mtgnerdstats(/|$) [NC]
RewriteRule .* - [L]

🌐 Creating a User

MTG Nerd Stats is currently designed for a single user, or multiple users working with the same data set. To create a user, go to mtgnerdstats/letmein. This will let you create a user name and password. The form to edit data only appears on the Games page if the user is logged in.


🌐 Project Structure

project/
│
├── app.py
├── dbwrapper.py
├── passenger_wsgi.py
├── requirements.txt
├── stats.py
├── waitress_server.py
├── data/
│   ├── games.json
├── templates/
│   ├── about.html
│   ├── base.html
│   ├── games.html
│   ├── login.html
│   ├── signup.html
│   ├── stats.html
│   └── …
├── static/
│   └── stylesheets
│       └── games.json
└── README.md

🚀 Future Enhancements