An auto-graded learning platform for modern C# with a focus on functional programming patterns. Built with React, TypeScript, and Monaco Editor.
-
Interactive Lessons: 5 FP-oriented C# exercises covering:
- Pure Functions
- Map and Filter (LINQ)
- Function Composition
- Option Types (Maybe monad)
- Reduce/Fold patterns
-
Monaco Code Editor with:
- C# syntax highlighting
- Custom FP-focused completions (LINQ methods, lambdas, etc.)
- Real-time diagnostics (compile errors/warnings)
- Keyboard shortcuts (Ctrl+Enter to Run, Ctrl+Shift+Enter to Submit)
-
Auto-Grading Pipeline:
- Compiles and runs C# code in isolated temporary directories
- Runs test cases against student submissions
- Provides personalized hints on failures
- Tracks learner progress
- Frontend: React 19.2 (client-only SPA), TypeScript, TailwindCSS v4, Rsbuild
- Code Editor: Monaco Editor with custom C# completions
- Backend: Hono (TypeScript)
- Runtime: Bun + .NET 10 (Roslyn Scripting API) for C# code execution
- Testing: Bun test
This app is currently client-only (no React Server Components). The recommended React 19 patterns we follow here are:
- Async-first UI: Prefer Suspense + TanStack Query’s suspense helpers for data loading.
- Mutations as Actions: Use async Actions (
useActionState, optional<form action>) for pending/error sequencing. - Effect hygiene: Use
useEffectEventto keep subscriptions/listeners stable. - Performance: Rely on React Compiler where supported by the bundler; otherwise memoize only when profiling shows it helps.
If we later adopt an RSC-capable framework, pin react-server-dom-* packages to patched React 19.x versions to avoid known RSC CVEs.
- Bun 1.0+
- .NET SDK 10.0+
The RoslynRunner targets net10.0. On Ubuntu 22.04:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O /tmp/msprod.deb sudo dpkg -i /tmp/msprod.deb sudo apt update sudo apt install -y dotnet-sdk-10.0
The repo includes a global.json that pins the SDK version to ensure CI/CLI picks the correct one.
Note: If your environment only offers an older .NET SDK, you can temporarily retarget the runner to
net8.0inroslyn-runner/RoslynRunner.csproj. Installing SDK 10 is preferred to stay aligned with the ADR.
-
Install dependencies:
bun install
-
(Optional) Enable PostHog analytics:
- Copy
.env.example→.env - Set
PUBLIC_POSTHOG_KEY(and optionallyPUBLIC_POSTHOG_HOST) - By default we disable autocapture and session recording and only send explicit product events (no user code content).
- Copy
-
Start development server:
bun run dev:all
Frontend: http://localhost:5173
API: http://localhost:5050
| Command | Description |
|---|---|
bun run dev |
Start API server with hot reload |
bun run dev:client |
Start frontend dev server |
bun run dev:all |
Start API + frontend |
bun run build |
Build for production |
bun run start |
Run production build |
bun run check |
Type-check TypeScript |
bun test |
Run test suite |
├── client/ # React frontend
│ └── src/
│ ├── components/ # React components
│ │ ├── uuuu-editor.tsx
│ │ ├── lesson-page.tsx
│ │ └── output-panel.tsx
│ └── lib/
│ └── csharp-completions.ts
├── server/ # Hono backend
│ ├── routes.ts # API endpoints
│ ├── grading.ts # C# execution and grading logic
│ ├── storage.ts # Lesson data access
│ └── tests/ # Backend tests
├── roslyn-runner/ # Persistent .NET code executor
│ └── Program.cs # Roslyn Scripting API runner
└── shared/ # Shared types
└── schema.ts # Zod schemas and TypeScript types
GET /api/lessons- List all lessonsGET /api/lessons/:id- Get specific lessonPOST /api/execute- Execute C# codePOST /api/diagnostics- Get compile-time diagnosticsPOST /api/submit- Submit code for grading
The grading pipeline uses a persistent Roslyn Scripting API runner for fast execution (~30-150ms):
- Server sends code to the Roslyn runner via stdin/stdout JSON protocol
- Runner compiles and executes using Roslyn Scripting API (warm context)
- Captures console output and compiler diagnostics
- Returns results as JSON response
See ADR-001 for architecture details.
bun testTest coverage includes:
- Integration tests for C# code execution
- Multi-class code execution tests
- Security/sandboxing tests
Each lesson includes:
- Content: Markdown explanation of the concept
- Starter Code: Initial code template
- Reference Solution: Correct implementation (hidden from students)
- Test Cases: JSON array of test definitions
- Hints: Static hints for common mistakes
- Lessons are stored as static TypeScript data
- Hints are provided inline in grading logic
- Diagnostics come from Roslyn compiler
- Optional: set
ROSLYN_RUNNER_PATHto a prebuilt Roslyn runner binary (e.g../roslyn-runner/bin/Release/net10.0/RoslynRunner)
MIT