Getting Started & Local Setup
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Debug Arena is a real-time competitive debugging platform designed for live coding events and hackathons. It facilitates a high-pressure environment where participants identify and fix Python code errors under strict anti-cheat enforcement. The system provides automated evaluation, a real-time leaderboard, and an "Oracle" hint system with associated point penalties.
Sources: README.md:3-8, README.md:12-14
This guide details the steps required to clone, configure, and initialize the application for local development or event hosting. The setup involves configuring a Python environment, installing dependencies, and initializing the SQLite database.
Sources: README.md:76-92
Prerequisites & Installation
Environment Setup
The project is built using Python and the Flask web framework. Before running the application, dependencies listed in requirements.txt must be installed.
# Clone the Repository
git clone https://github.com/Priyadharshan-19/DebugArena.git
cd DebugArena
# Install Dependencies
pip install -r requirements.txt
Sources: README.md:78-85, requirements.txt
Core Tech Stack
| Component | Technology |
|---|---|
| Backend | Python, Flask, SQLAlchemy |
| Frontend | Jinja Templates, Tailwind CSS, JavaScript, CodeMirror |
| Database | SQLite (Development), PostgreSQL (Production) |
| Security | Proctor.js (Fullscreen enforcement) |
Sources: README.md:52-67
System Architecture
The application follows a standard Flask blueprint architecture, separating authentication, arena logic, and submission handling.
The architecture ensures that all client requests pass through a security layer that monitors for tab switching or fullscreen exits before reaching the core logic.
Sources: README.md:70-74, app.py:41-44
Configuration & Database Initialization
Application Configuration
The application uses environment variables for security and database persistence. If no environment variables are provided, the system defaults to local development settings.
| Config Key | Source | Default / Description |
|---|---|---|
SECRET_KEY | os.getenv('SECRET_KEY') | 'dev-key-123' |
SQLALCHEMY_DATABASE_URI | os.getenv('DATABASE_URL') | sqlite:///instance/db.sqlite3 |
SQLALCHEMY_TRACK_MODIFICATIONS | Hardcoded | False |
Sources: app.py:18-30
Initializing the Database
The project includes a utility script to create the necessary database tables and directory structure. This script ensures the database folder exists and initializes the Team and Submission tables via SQLAlchemy.
# database/init_db.py logic
with app.app_context():
db.create_all()
Sources: database/init_db.py:16-19, app.py:49-51
User Lifecycle & Authentication
The local setup allows for team registration and login. Passwords are secured using pbkdf2:sha256 hashing.
Running the Platform
Once the dependencies are installed and the database is initialized, the platform can be started using the Flask built-in server.
python app.py
The application defaults to http://127.0.0.1:5000. In debug mode, the server will automatically reload upon code changes.
Sources: README.md:87-95, app.py:62-63
Summary
Local setup for the Python Debug Arena requires a Python environment capable of running Flask and SQLite. By following the installation and initialization steps, developers can host a secure debugging environment featuring automated scoring and anti-cheat monitoring. The platform is structured to scale from basic syntax challenges to complex logical debugging levels.
Sources: README.md:12-14, README.md:98-103