03 / 06 Web Application

CodeMortem 2.0: 1v1 Duels & Learning

A competitive programming platform featuring real-time matchmaking, Glicko-2 ratings, and a highly polished interactive learning engine.

codemortem.dev
CodeMortem Overview

Why I built CodeMortem

I have a deep interest in competitive programming, but when I was learning advanced algorithms, I noticed a recurring problem: the resources were plentiful, but they were rarely structured or interactive.

I wanted to build a platform that didn't just dump walls of text on the user. CodeMortem 2.0 was designed to bridge this gap by combining interactive, structured learning modules with the thrill of real-time 1v1 algorithmic duels.

  • ✦Real-time Matchmaking: Fast queues powered by Redis and Go WebSockets.
  • ✦Live Arena: Integrated @monaco-editor/react with Judge0 CE Cloud API for secure multi-language code execution.
  • ✦Competitive Ratings: Glicko-2 rating system to accurately rank players based on 1v1 duel outcomes.
CodeMortem Interface
CodeMortem Learning Modules

Interactive & Rich Lesson Primitives

Lessons in CodeMortem are not standard text. I built a custom RichLessonPrimitives system to teach complex concepts like Segment Trees or Heavy-Light Decomposition.

Content is authored in specialized blocks supporting diagrams, code, and callouts (insights, warnings). I also wrote a custom markdown parser that dynamically handles syntax like base^exp to correctly render math superscripts directly inside React components using KaTeX.

  • ✦Custom Formatter: Inline markdown and dynamic math parsing (react-markdown + katex).
  • ✦MCQ Checkpoints: Interactive multiple-choice questions integrated directly into the reading flow.
  • ✦Avoids "Walls of Text": Uses dynamic callouts, rules, and gotchas to keep engagement high.
CodeMortem Architecture

High-Concurrency Backend

The platform demands extreme speed for live duels. The backend is written in Go 1.26 using the Fiber framework, which provides a massive performance boost and a low memory footprint.

Real-time communication is handled by gofiber/contrib/websocket. The system is containerized with Docker, utilizing PostgreSQL for persistent storage and Redis for caching, session management, and fast matchmaking queues.

  • ✦Stateless Auth: Handled securely via JWT and bcrypt password hashing.
  • ✦Database Migrations: Managed seamlessly using the golang-migrate CLI.
  • ✦Containerized: Full docker-compose setup for local development.
Next.js 16.2 React 19 TypeScript Zustand Framer Motion Go 1.26 Fiber WebSockets PostgreSQL Redis Docker Judge0 CE