Luyện Code (luyencode.net), my own product
Upgrading a live platform without stopping it
luyencode.net has run since 2020, with more than 34,000 accounts, 2.4 million submissions and 25 schools and clubs teaching with it. I rewrote all of it with a new design that works well on phones, a speed budget checked automatically, and a migration plan that keeps the old data and accounts.
- Role
- Founder, sole developer, operations
- Period
- 2020 – now
- Status
- Switching to the new version on the night of 18 Dec 2026
- Website
- luyencode.net
Luyện Code Online Judge
Luyện code và thi lập trình trực tuyến
Luyện mỗi ngày, vững từng bài. Bài tập có chấm tự động, lớp học cho giáo viên và kỳ thi trực tuyến. Miễn phí cho học sinh.
from bisect import bisect_left d = [] for x in map(int, input().split()): i = bisect_left(d, x); d[i:i+1] = [x] print(len(d))
- New design: the LCOJ Pass system
- Works from a 360 px screen
- Problem page ≤ 150 KB of JavaScript
- 34,000+
- accounts moved to the new version, passwords unchanged
- 2.4 million
- submissions and 7,625 problems migrated
- ≤ 150 KB
- of JavaScript on the problem page, checked before every merge
- 2.5 GB
- of RAM for the whole new system at peak, judges included
Context
Luyện Code is an online judge I built and have run myself since 2020: students write code, and the judge runs the tests and returns the result in a few seconds. It has more than 34,000 accounts, 7,625 problems and 2.4 million submissions. 25 organizations (middle schools, specialized high schools for gifted students, universities, clubs) use it as their classroom, and their teachers wrote 77% of the problems themselves. The busiest minute saw 145 submissions.
The live version is built on the interface of the open-source DMOJ. It grades well, but it has three weaknesses:
- The navigation is in English and the pages are dense with text, made for desktop computers. New students, especially those on phones, struggle to know where to tap.
- There are no classes. Teachers have to use “organizations” as classes, with no gradebook and no exam mode.
- It is hard to add features without touching the parts that already work well.
Constraints
- The old system serves students every day: no long downtime, no lost data.
- One person does the work: no infrastructure team, no cloud budget.
- Students use phones and old school computers: pages must be light.
Approach
A redesign based on real users. The LCOJ Pass design system has consistent colors, type, spacing and components. Every screen answers a newcomer’s five questions: where am I, what do I tap next, what does this word mean, what happens after I tap, and how do I fix a mistake. Every layout works from a 360 px screen and doesn’t depend on hover.
Speed with a budget, not a promise. The problem page gets at most 150 KB of compressed JavaScript before the code editor loads. An automated test measures this before every merge, alongside Lighthouse for loading speed. One change came in at 150.6 KB and was blocked; the page is now at 146.5 KB.
A leaner rewrite of the core. One Go server, and one PostgreSQL database that also handles the queue, search and real-time notifications. No Kubernetes, no Redis. The whole system, judges included, fits in about 2.5 GB of RAM at the current peak.
Architecture
- CloudflareTunnel, R2, Turnstile
- Go serverREST, SSE, static files
- PostgreSQLData, River queue, search, LISTEN/NOTIFY
- Judgesgo-judge, 15 languages; pull work over HTTPS, never touch the database
A migration that loses nothing
- All of the real data has been loaded into the new version, including 135,387 test cases (48 GB). Every rehearsal starts from an empty database and is reconciled against the old numbers.
- Old passwords still log in, then upgrade to Argon2id hashing on the first login.
- The new judge regrades old submissions every night. Every result that differs from the old one needs an explanation (for example, test data edited after the submission was accepted) before the new judge is switched on.
- The cutover runs in one night, announced in advance on every page. The old version is kept for 90 days: if anything goes wrong, the domain points back to it.
Results
- The first release (2026.12.19) is fast on phones from 360 px, explains runtime errors in Vietnamese, and adds a “shared computer” sign-in for school labs and an email-code sign-in for students without Google.
- The new version runs with all of the real data in a closed test environment. The official cutover is on the night of 18 Dec 2026, with 19 Dec as the fallback night.
- Teacher features (classes, class feeds, learning dashboards, an exam library) roll out until February 2027, together with a Python basics course with animated lessons and a button that steps through code line by line.
Real screenshots


Send your website, get a proposal within 2 working days.
No website yet, or need a tool or an AI agent? Send a message or an email and I reply within 1 working day.
hello@behitek.com · 0372 615 855 · text any time; calls after 6 pm Vietnam time (GMT+7)