Learn to code. Free, forever.
A modern, next-generation coding education platform combining structured curriculum, interactive challenges executed in an isolated sandbox, verified progress tracking, vibrant community discussions, 100% Vietnamese/English bilingual parity, and an AI mentor that teaches instead of solving.
π Live Platform: https://codejourney.shop
- π 7 Comprehensive Tracks & 2,900+ Pages:
- Web Development: HTML5, CSS3, Modern JavaScript (ES2024+), DOM manipulation, async patterns, and component architecture.
- Python: Core syntax, idiomatic collections, algorithmic problem solving, functional paradigms, and OOP.
- C: Manual memory management, pointers, memory layouts, low-level data structures, and file I/O.
- C++: Modern C++20, STL algorithms, templates, RAII, move semantics, and systems programming.
- C#: .NET 9 CLI, type safety, LINQ, records, pattern matching, and async/await task pipelines.
- Java: JVM internals, OOP hierarchies, Java Collections Framework, lambda streams, and exception handling.
- Hα»c Sinh Giα»i (HSG) Competitive Programming: Specialized track tailored for Vietnamese high-school olympiads β time/space complexity analysis, frequency arrays, greedy strategies, two-pointers, prefix/difference arrays, recursion, backtracking, BFS/DFS, and dynamic programming.
- π€ Journey Sensei β Socratic AI Mentor:
- An intelligent mentor designed to teach how to think like a software engineer.
- Never spoils answers or outputs ready-to-paste code solutions.
- Bilingual Pedagogical Error Explainer: Detects runtime crashes and compilation failures (e.g. GCC/Clang, Python, .NET, OpenJDK errors), explaining the root cause in plain English or Vietnamese with guided troubleshooting prompts.
- β‘ Dual-Engine Execution Architecture:
- Live Browser Runner: Zero-latency interactive DOM execution for HTML/CSS/JavaScript with instant live feedback as you type.
- Isolated Container Sandbox: Multi-tenant, resource-capped container sandbox executing untrusted student code (Python, C, C++, C#, Java) with dropped Linux privileges, read-only roots, and strict network isolation.
- π»π³ 100% English & Vietnamese Bilingual Parity:
- Every track, lesson, challenge statement, test hint, discussion forum, and system message is available natively in both English and Vietnamese.
- π‘οΈ Enterprise-Grade Security & Integrity:
- Arbitrary student code NEVER executes on the web tier or host system.
- Authenticated submissions with cryptographic ownership verification and rate limiting on runs, auth, and AI mentor endpoints.
- βΏ WCAG 2.1 AA Compliant Accessibility:
- Full keyboard navigability, high-contrast dark/light design system, screen-reader optimizations, and an intentionally designed mobile coding workspace.
Code Journey uses a clean, resilient modular monolith design. The Next.js web application manages UI, API routes, and curriculum serving, while untrusted code execution is strictly isolated in an asynchronous worker tier.
flowchart TD
subgraph Client["π» Client Browser"]
Editor["Monaco Code Editor & Live Preview"]
UI["Next.js 16 Responsive UI (Desktop / Tablet / Mobile)"]
end
subgraph WebTier["π Web Application Server (Next.js App Router)"]
Auth["Auth.js (Sessions & Ownership)"]
Curriculum["Curriculum Loader (Type-Safe JSON & MDX)"]
Sensei["π€ Journey Sensei (Socratic AI & Error Explainer)"]
ApiRoutes["Server Actions & REST API"]
end
subgraph Storage["ποΈ Database & Queue"]
Postgres[("PostgreSQL 16\n- User Profiles & Streaks\n- Submission Verification\n- Execution Job Queue\n- Discussion Forums")]
end
subgraph SandboxTier["π‘οΈ Isolated Execution Tier"]
Worker["Runner Worker (Background Polling Daemon)"]
DockerSandbox["π¦ Hardened Docker Container\n- No Network Access (--network none)\n- Read-only Root Filesystem\n- Memory & CPU Quotas (cgroups)\n- Non-root Execution (UID 1000)"]
end
Client <-->|HTTPS / Server Actions| WebTier
WebTier <-->|Drizzle ORM| Postgres
WebTier -->|Pedagogical Guidance| Sensei
WebTier -->|Enqueue Run Request| Postgres
Postgres <-->|Poll & Claim Job| Worker
Worker -->|Mount & Execute in Isolation| DockerSandbox
DockerSandbox -->|Exit Code, Stdout, Stderr| Worker
Worker -->|Store Graded Verdict| Postgres
| Tool | Recommended Version | Notes |
|---|---|---|
| Node.js | β₯ 22.0.0 |
Developed on Node 22 LTS |
| pnpm | β₯ 10.0.0 |
Package manager (corepack enable or npm i -g pnpm) |
| Docker Desktop | Latest | Required for PostgreSQL and local sandbox challenge grading |
| Git | β₯ 2.40.0 |
Version control |
# 1. Clone the repository
git clone https://github.com/TysonTranThai/code-journey.git
cd code-journey
# 2. Install dependencies
pnpm install
# 3. Configure environment
cp .env.example .env.local
# 4. Start local PostgreSQL container
pnpm db:up
# 5. Run database migrations & insert seed data
pnpm db:migrate
pnpm db:seed
# 6. Start development server
pnpm devOpen http://localhost:3000 in your browser.
- Health Check: http://localhost:3000/health (verifies Next.js and PostgreSQL connectivity).
- Default Seed Accounts:
- Student:
dev-student@codejourney.local/dev-password-123 - Admin:
dev-admin@codejourney.local/dev-password-123
- Student:
Frontend challenges (HTML/CSS/JS) execute directly in your browser with zero extra setup.
To test multi-language backend challenges (Python, C, C++, C#, Java) in the secure sandbox:
# Terminal 1: Build the hardened sandbox container (one-time)
pnpm sandbox:build
# Terminal 2: Run the challenge worker
pnpm worker
# Terminal 3: Run the web application
pnpm devWhen you click Run or Submit Code, the worker claims the job, runs the verification suite inside the isolated container, and returns the verdict in real time!
| Command | Description |
|---|---|
pnpm dev |
Starts the Next.js development server on port 3000 |
pnpm build |
Compiles the production build (runs strict typechecking + static page generation) |
pnpm start |
Serves the production build |
pnpm test |
Runs 178+ Vitest unit and integration test suites |
pnpm test:watch |
Runs Vitest in interactive watch mode |
pnpm test:e2e |
Runs Playwright end-to-end and automated WCAG accessibility audits |
pnpm typecheck |
Strict TypeScript compilation check (tsc --noEmit) |
pnpm lint |
Runs ESLint 9 flat config across all application files |
pnpm lint:fix |
Runs ESLint with automated fixes |
pnpm format |
Formats all code, JSON, and MDX files with Prettier |
pnpm format:check |
Checks code formatting without writing changes |
pnpm worker |
Starts the background execution worker for sandboxed code grading |
pnpm sandbox:build |
Builds the secure Docker sandbox runner image |
pnpm db:up |
Starts the local PostgreSQL 16 container via Docker Compose (port 5433) |
pnpm db:down |
Stops the local PostgreSQL container |
pnpm db:migrate |
Applies pending Drizzle database migrations |
pnpm db:generate |
Generates new Drizzle schema migrations |
pnpm db:seed |
Seeds development users, tracks, and achievements |
pnpm db:studio |
Launches Drizzle Studio GUI for inspecting database tables |
code-journey/
βββ docs/ # Engineering design, threat models, WCAG audits & production guides
β βββ ARCHITECTURE.md # In-depth architectural decomposition & data flow
β βββ DATA-MODEL.md # Relational entity diagrams & Drizzle ORM schema
β βββ SECURITY.md # Threat mitigations, sandboxing rules & rate limiting
β βββ A11Y.md # WCAG 2.1 AA accessibility conformance report
β βββ PRODUCTION.md # VPS deployment, Docker hardening & worker topology
βββ src/
β βββ app/ # Next.js App Router (pages, API handlers, layout, sitemaps)
β βββ components/ # Modular React 19 UI components (editor, navbar, mentor, forums)
β βββ content/ # Version-controlled curriculum data (JSON schemas + MDX lessons)
β β βββ tracks/ # web-development, python, c, cpp, csharp, java, hsg
β βββ lib/ # Shared utilities, curriculum loaders, Drizzle DB client, i18n
β βββ server/ # Auth.js setup, RBAC guards, server actions
β βββ workers/ # Independent execution worker & Docker sandbox controller
βββ tests/
β βββ unit/ # Vitest unit suites (loaders, guardrails, schema validation)
β βββ integration/ # Database integration, rate-limit, and isolation tests
β βββ e2e/ # Playwright cross-browser & accessibility test suites
βββ docker/ # Production Dockerfile & sandbox definition
βββ .planning/ # GSD roadmap, specification specs, and requirements
- Sandboxed Student Code: Code submissions never execute in Node.js processes or on the host server. Execution occurs strictly inside short-lived, single-use container sandboxes with network disabled, read-only root directories, capped execution time (2.5s timeout), and minimal memory limits.
- Grade Integrity: Submission results cannot be forged by clients; only the server-side worker writes pass/fail verdicts and grants achievement tokens to the database.
- Defense in Depth: Zero secrets in source control. Strict Zod schema validation across all API endpoints, parameterized SQL queries via Drizzle ORM, and automated rate limiting on sensitive routes.
Contributions from the developer and educator community are welcome! Whether you want to add new curriculum lessons, improve translations, optimize the sandbox runner, or enhance UI components:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Ensure all tests and checks pass:
pnpm lint pnpm typecheck pnpm test - Commit your changes with conventional commit syntax (
git commit -m "feat: add binary search challenges") - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read CONTRIBUTING.md for more details.
This project is open source and available under the MIT License.