A full-stack competitive programming platform β write, run, and judge code in 5 languages, directly in your browser.
π Live: bit-smith-kappa.vercel.app Β |Β API: compylr-backend.onrender.com
| Problems List | Problem Workspace |
|---|---|
![]() |
![]() |
| User Profile | Login |
|---|---|
![]() |
![]() |
- π§βπ» Multi-language judge β Submit solutions in Python, C++23, Java, C, and C#
- π³ Docker sandbox β Every submission runs in an isolated container (no network, 512 MB RAM, 1.5 vCPU, 128 PID limit, 5-second TLE)
- β‘ Warm containers β Persistent sandbox containers eliminate cold-start overhead on repeated submissions
- π Monaco Editor β VS Code's editor engine, with per-language syntax highlighting and a resizable Golden Layout workspace
- π JWT Auth β Register, verify email with OTP, and log in; invite-code-gated Admin role
- π User profiles β Solved count by difficulty, daily activity calendar, current streak
- π§© 225+ problems β Auto-seeded from a curated dataset of LeetCode-style problems for learning and practice
- π¬ Solutions & comments β Write editorial solutions, comment, and vote
- π Problem of the Day β Admin-configurable daily featured problem
- π Rate limiting β 5 req/min on auth/submit, 100 req/hr on content posting
| Layer | Technology |
|---|---|
| Frontend | Angular 20, Monaco Editor, Golden Layout, KaTeX, TailwindCSS |
| Backend | ASP.NET Core 8, Entity Framework Core, Npgsql |
| Database | PostgreSQL (Supabase) |
| Judge Engine | Docker (Python 3.10, GCC 13 / C++23, Eclipse Temurin 21, .NET SDK 8) |
| Auth | JWT (HMAC-SHA256), BCrypt, SMTP OTP |
| Deployment | Vercel (frontend), Render (backend), Supabase (database) |
BitSmithApp/
βββ angularBitSmith/ # Angular 20 SPA
β βββ src/app/
β β βββ auth/ # Login, Register, OTP verification
β β βββ problems/ # Problem list, detail, solution editor
β β βββ profile/ # User profile & stats
β β βββ admin/ # Admin dashboard, problem creator, POTD
β β βββ workspace/ # Monaco + Golden Layout dockable IDE
β β βββ services/ # HTTP services, auth guards
β βββ vercel.json
βββ dotnetBitSmith/ # ASP.NET Core 8 REST API
β βββ Controllers/ # 8 controllers (Auth, Problem, Submission, User, ...)
β βββ Services/ # 12 services including DockerCompilationService
β βββ Entities/ # 11 EF Core entities
β βββ Data/ # ApplicationDbContext, indexes
β βββ Middlewares/ # Global exception handling
β βββ Helpers/ # ProblemSeeder
β βββ problems.json # 2,828-problem dataset
βββ docker-compose.yml # Full local stack
βββ vercel.json
Browser (Angular SPA)
β
βΌ HTTP / REST
ASP.NET Core 8 API
βββ Auth (JWT + OTP)
βββ Rate Limiter (ASP.NET Core built-in)
βββ Problem / Solution / Comment / Vote endpoints
βββ Submission endpoint βββΊ Channel<Guid> Queue (cap: 1,000)
β β
β BackgroundService Worker
β β
β DockerCompilationService
β βββββββββββββββββββββββββββ
β β docker exec (warm) OR β
β β docker run (cold) β
β β --network none β
β β --memory 512m β
β β --cpus 1.5 β
β β --pids-limit 128 β
β βββββββββββββββββββββββββββ
βββ IMemoryCache (1-hr TTL on problem details)
β
βΌ
PostgreSQL (Supabase)
- .NET 8 SDK
- Node.js 20+
- Docker Desktop
- PostgreSQL (or use the Docker Compose database service)
git clone https://github.com/raftywate/BitSmith.git
cd BitSmithCreate dotnetBitSmith/appsettings.Development.json (this file is git-ignored):
{
"ConnectionStrings": {
"connectionString": "Host=localhost;Database=BitSmithDb;Username=postgres;Password=YOUR_PG_PASSWORD"
},
"JwtSettings": {
"Key": "YOUR_JWT_SECRET_MIN_32_CHARS_LONG"
},
"AdminSettings": {
"InviteCode": "YOUR_ADMIN_INVITE_CODE"
},
"SmtpSettings": {
"Host": "smtp.gmail.com",
"Port": "587",
"Username": "your@gmail.com",
"Password": "your-gmail-app-password",
"FromEmail": "your@gmail.com"
}
}Note: For Gmail, generate an App Password (requires 2FA). If SMTP is not configured, the app auto-verifies accounts as a fallback.
Start the backend:
cd dotnetBitSmith
dotnet runThe API starts on http://localhost:5000. On first run it:
- Auto-creates all database tables
- Seeds 225 problems (75 Easy / 100 Medium / 50 Hard) from
problems.jsonif the DB is empty - Creates composite indexes for query performance
The judge engine uses Docker containers as sandboxes. Start the warm containers:
docker compose up sandbox-python sandbox-gcc sandbox-java sandbox-csharp -dWithout these, submissions will fall back to cold
docker run(slower, but still functional as long as Docker is running).
cd angularBitSmith
npm install
npm startThe Angular dev server starts on http://localhost:4200.
The dev environment points to
http://localhost:5000/api. To change this, editsrc/environments/environment.ts.
To run the entire stack (database + backend + frontend + sandboxes) in Docker:
docker compose up --buildAccess the app at http://localhost:80.
Set these in your Render backend service environment:
| Variable | Description |
|---|---|
ConnectionStrings__connectionString |
PostgreSQL connection string (use Supabase pooler URL) |
JwtSettings__Key |
JWT signing secret (min 32 chars) |
AdminSettings__InviteCode |
Secret code that grants Admin role on registration |
SmtpSettings__Host |
SMTP host (e.g. smtp.gmail.com) |
SmtpSettings__Port |
SMTP port (e.g. 587) |
SmtpSettings__Username |
SMTP username / email |
SmtpSettings__Password |
SMTP password / app password |
SmtpSettings__FromEmail |
From address for outgoing emails |
HOST_TEMP_RUNS_PATH |
Host path for temp run directories (Docker volume mount) |
The app auto-seeds on startup if the database is empty. To manually trigger a full re-seed:
cd dotnetBitSmith
dotnet run -- --import-leetcodeThis runs the full ProblemSeeder against problems.json with verbose logging.
On the Register page, enter the configured InviteCode in the invite code field to create an Admin account. Admins get access to:
/adminβ Dashboard with stats/admin/problemβ Create / edit problems with test cases/admin/podβ Set the Problem of the Day
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register a new user |
POST |
/api/auth/login |
Login and receive JWT |
POST |
/api/auth/verify-otp |
Verify email OTP |
GET |
/api/problems |
Paginated problem list with filters |
GET |
/api/problems/{slug} |
Problem detail with test cases |
POST |
/api/submissions |
Submit a solution for judging |
GET |
/api/submissions/{id} |
Poll submission result |
POST |
/api/submissions/run |
Run against sample test cases |
POST |
/api/submissions/run-code |
Run arbitrary code with custom stdin |
GET |
/api/users/{username} |
Public user profile & stats |
GET |
/api/solutions/{problemId} |
Community solutions for a problem |
Full Swagger docs available at /swagger when running locally.
- Connect your GitHub repo to Vercel
- Set Root Directory to the repo root
- Vercel uses
vercel.jsonat the root to build and route the SPA
- Create a new Web Service on Render
- Set Root Directory to
dotnetBitSmith - Use the existing
Dockerfile - Set all environment variables listed above
- Mount Docker socket if using warm containers (requires a Docker-capable host)
The problems included in this project are sourced from LeetCode and are used purely for educational and learning purposes. This is a non-commercial, personal project built to practice full-stack development. All problem content, titles, and descriptions remain the intellectual property of LeetCode. If you are the rights holder and have concerns, please open an issue.
MIT
Built by @raftywate



