A real-time, interactive LeetCode-style hackathon platform built with Python and Django. This platform enables organizations to host programming competitions where teams can write Python solutions to algorithmic challenges, receive AI-powered hints, compete in fast-paced bonus rounds, and track their progress on a live, dynamic leaderboard.
- Interactive IDE: A fully-featured web-based code editor pre-populated with starter code templates.
- Custom Sandbox runner: Safely executes python submissions against pre-defined test cases using sub-processes.
- LeetCode Style Driver: Automatically parses inputs, injects helper utilities (such as
isBadVersion), and runs solution methods on the fly.
- Context-Aware Assistance: Integrates with LLMs (e.g., Llama-3.3-70B, GPT-4o, Groq) to provide smart hints based on the user's current code draft.
- Admin Managed Limits: Configurable token system for hints, allowing admins to enable/disable or limit the AI assistance per team.
- Tab Monitoring: Tracks when users change tabs or leave the browser window while working on a problem.
- Anti-Cheat Logs: Logs tab switches in the database (
tab_switches) to help administrators maintain competition integrity.
- Speed Runs: Active timed questions launched dynamically by admins during the event.
- Dynamic Scoring: Score decay rewards faster submissions (e.g. earlier finishers get up to 200 points, scaling down to 0).
- Fastest Finisher Bonus: Tracking and bonus rewards for the first team to solve all bonus questions.
- Dynamic Standings: Real-time ranks showing aggregated scores (Problem points + Bonus points + Adjustments).
- Score Penalties: Time-based scoring decays points based on time elapsed before a correct submission is made.
- Point Adjustments: Admin capability to grant bonuses or issue penalties to teams manually.
- Central Control Room: Admins can pause, resume, start, or finish the event globally.
├── hackathon_project/
│ ├── core/
│ │ ├── core/
│ │ ├── platform_app/
│ │ ├── templates/
│ │ ├── simulate.py
│ │ └── manage.py
│ └── tutorial/
├── requirements.txt
├── users_login_status.csv
└── README.md
- Python 3.10+
- Django 4.x+
-
Clone the repository:
git clone <repository-url> cd dishkv2
-
Install dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile insidehackathon_project/core/andhackathon_project/tutorial/with the following variables:SECRET_KEY=your-django-secret-key GROQ_API_KEY=your-groq-api-key
-
Run Migrations & Initialize Database:
cd hackathon_project/core python manage.py migrate python manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'adminpassword') if not User.objects.filter(username='admin').exists() else None"
-
Start the Development Server:
python manage.py runserver 0.0.0.0:8000
Open your browser and log in at
http://localhost:8000/.
The platform contains a dedicated simulation script (simulate.py) to benchmark the system under heavy load. It spins up 100 concurrent threads executing realistic user sessions:
- Authenticates and logs in.
- Interacts with the home dashboard and question pages.
- Saves code drafts and triggers custom compiler test runs.
- Submits solutions and fetches leaderboard stats recursively.
- Submits active bonus round answers.
Ensure the server is running on http://127.0.0.1:8000 or configured appropriately in simulate.py (BASE_URL), then execute:
python simulate.pyIt will generate a detailed Concurrency Simulation Report showing:
- Success rate, total runtime, and request throughput.
- Average response time, 95th percentile (P95), and Max latency per endpoint (e.g.,
/api/save/,/api/submit/). - Performance bottlenecks analysis, highlighting SQLite write locking and subprocess compiler load limits.