/midyearmania

Gambling interface made with Django and Bootstrap.

Primary LanguagePython

Mid-Year Mania 🏆 - Gambling Interface

Bootstrap Django MySQL

Overview

Every mid-semester break I run a small tournament with my friends where we are sorted into teams and compete in a variety of events, with the highest scoring team being crowned the winner. What better way to 'spice up' competition than to introduce a friendly, gambling aspect? 😁

I decided to build a website to allow users to 'gamble' with their points on the outcomes of other events. Markets are dynamic, with odds changing depending on the liquidity of an event. When an event's time concludes, it is unable to be wagered on. Users are sorted into teams, and the status of each team is displayed on the homepage as the event runs. The wninning team is the team with the highest average points!

Features

  • Dynamic Betting Market: Market system calculates and distributes payouts. Winners receive their rewards as a percentage of the available betting pool, ensuring dynamic odds and payouts that reflect the community's sentiments.
  • Data-Validated Betting: Data validation mechanisms are in place to prevent arbitrage betting, ensuring fair play and maintaining the integrity of the gaming experience.
  • User Authentication: Users can log in to interact with the system, and change their password via email if forgotten.
  • Leaderboards & Statistics: Track top players, view team and event statistics, and gain insights into the betting patterns and strategies of the community.
  • Admin Panel: Allows easy updating of all data - models saved back propagate through and update statistics automatically when a match winner is added.

Technology Stack

  • Backend: Django (Version: 4.2.5)
  • Database: MySQL
  • Frontend: Bootstrap
  • Deployment: A2Hosting

📸 Screenshots:

Home Page:

Home Page

Player Leaderboard:

Leaderboard

My Bets:

Bets

Dropdown Navbar:

Dropdown

Event Page:

Event Page

Admin Panel:

Admin Panel

Installation & Setup

  1. Clone the Repository:
git clone https://github.com/sanjerine/midyearmania.git
cd midyearmania
  1. Set up a Virtual Environment:
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  1. Install the Dependencies:
pip install -r requirements.txt
  1. Set up the Database:
    • Modify the DATABASES settings in settings.py according to your database setup.
      • You may have to create a new MySQL database.
    • You will have to add example/filler teams and players using Django Admin interface such that the Jinja templates render correctly.
    • Run migrations:
python manage.py migrate
  1. Run the Server:
python manage.py runserver

Visit http://127.0.0.1:8000/ in your browser.