Skip to content

kircad/LeapCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeapCode

A LeetCode-inspired coding challenge platform. Users solve Python problems in a browser-based editor; submissions run inside an isolated Docker sandbox so arbitrary user code never touches the host.

Features

  • Monaco code editor with per-problem starter code
  • Run against a single test case or submit against all
  • Per-test-case pass/fail feedback with stdout and stderr
  • JWT-authenticated API (Supabase Auth)
  • Hardened Docker sandbox (no network, 256 MB RAM, 1 CPU, 60 s timeout)

Prerequisites

  • Python 3.11+
  • Node 18+
  • Docker (running)
  • A Supabase project with the schema below
  • A MongoDB instance (local or Atlas)

Setup

1. Backend

cd backend
pip install -r requirements.txt

Create backend/.env:

SUPABASE_URL=<your-project-url>
SUPABASE_KEY=<your-service-role-key>
MONGODB_URI=<your-mongo-uri>

Build the code-execution Docker image (required before running):

docker build -t submission_runner src/leapcode_app/docker/

Start the Flask server:

python src/run.py
# → http://127.0.0.1:5000

2. Frontend

cd frontend
npm install
npm run dev
# → http://localhost:5173

Testing

cd backend
pytest

Database Schema (Supabase)

problems: id, name, difficulty

users: managed by Supabase Auth

MongoDB holds full problem documents (description, test cases, function signature). See DESIGN.md for the complete schema.

Architecture

See DESIGN.md for architecture, data models, security design, and roadmap.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors