Niklas_Weber Systems_developer 42_+_HHN Writing Heilbronn,_DE

Niklas Weber — Systems Developer

I'm Niklas, a systems developer at 42 Heilbronn and a Software Engineering student at Hochschule Heilbronn. I write shells, raytracers, renderers and real-time services from first principles — in C, Go and whatever the problem needs.

See work Contact Available for collaboration

Based in
Heilbronn, DE
Studying
Software Engineering
Building
7 projects, C & Go
Focus
SIMD · gRPC · Raft · Cloud · K3s

[02 — FIRST_PRINCIPLES]

Build, break, rebuild

SHELLS RAYTRACERS RENDERERS SHELLS
BUILT FROM SCRATCH IN C & GO
FORK · EXEC · PIPE · DUP2 · WAITPID · FORK · EXEC
REAL-TIME SYSTEMS GRPC
ZER☺ ALLOCATIONS PER FRAME · ZER☺
SIMD CACHE LINES GOROUTINES
UNDERSTAND THE LAYERS BENEATH THE ABSTRACTION

Seven projects.
Two schools.
One habit: build it yourself.

About — how I work

I build the parts that matter by hand — a shell's process handling, a WebSocket hub, an .obj parser — and reach for a library everywhere else.

[Read: why from scratch]

Performance is measured, not guessed. EXPLAIN ANALYZE, perf, a profiler — that is how miniRT went from 1–5 to 120+ frames per second.

Two schools at once: peer-to-peer projects at 42 Heilbronn, Software Engineering at Hochschule Heilbronn. Build to understand, understand to build better.

build, break, rebuild.

Selected work

[04]

Index

raftlab Raft consensus with a live cluster visualizer Go · WebSocket · SVG · GitHub Actions 2026
raftlab visualizer during a network partition: five Raft nodes in a pentagon, two of them marked leader, with dashed red links where messages are dropped between the old leader and the rest
Network partition: two nodes believe they lead[term 2 vs 3]

Raft consensus implemented from scratch in Go — leader election, log replication, snapshots and crash recovery — with a linearizable key-value store on top and a browser UI where you can kill nodes, cut the network and watch the cluster recover.

Go code
5.1k lines
Of which tests
2.2k lines
Dependencies
1

Problem: Raft is the algorithm behind etcd, Consul and CockroachDB, and it is easy to nod along to the paper and hard to trust your own implementation. A consensus bug does not crash. It shows up as two nodes disagreeing after one specific sequence of crashes, partitions and reordered packets. I wanted to implement all of it, including the parts tutorials skip (persistence, log compaction, InstallSnapshot, exactly-once clients), and to see it behave rather than trust it.

Solution: A complete Raft implementation in Go: leader election, log replication with conflict repair, the election restriction, commitment of prior-term entries, a checksummed write-ahead log with crash recovery, and log compaction with InstallSnapshot for followers that fell far behind. A replicated key-value store sits on top. Reads go through the log, so they are linearizable, and client sessions make a retried write apply at most once. raftnode runs one member per process over HTTP. raftlab runs five in one process over a fault-injecting network and streams every message to the browser as an animated dot, where you can kill nodes, partition the network and dial in latency, loss and duplication.

Technical Approach: The core raft.Node is a pure state machine with no goroutines, sockets or wall-clock time. Everything it touches goes through four interfaces: Transport, Clock, Storage and StateMachine. Because time and I/O are injected, a five-node cluster runs on a fake clock inside a single-threaded test, and a run is a pure function of its random seed. A chaos test crashes and restarts nodes, partitions the network and injects loss, duplication and delay for 40 virtual seconds while four clients write and read, checking election safety and committed-prefix agreement every 10 ms. At the end it checks that replicas converge, that every acknowledged write survived and that every read returned the last acknowledged write. A failure prints its seed, and CHAOS_SEED=17 go test -run Chaos ./internal/kv replays it exactly. The core uses only the standard library; the single dependency is a WebSocket library for the visualizer.

Results & Learnings: About 5,100 lines of Go, around 2,200 of them tests, with CI running go test -race and golangci-lint. The bugs found along the way are the real lesson: stale timer callbacks that start a spurious election and depose a healthy leader, a delayed AppendEntries erasing newer entries, reordered replies moving nextIndex backwards, and a Windows-only crash where the WAL could not rename over an open file during its first compaction. The limits are written down too: a read costs a full replication round, snapshots are a single message and the client API is unauthenticated. PreVote, CheckQuorum, joint-consensus membership changes and ReadIndex reads are on the roadmap. The write-up covers how the fake clock works and the one bug it could not reproduce.

Stack
Go · WebSocket · SVG · GitHub Actions
Role
Full implementation
Tetris ML Tetris engine, DQN agent and training viewer Go · Python · PyTorch · gRPC · Ebitengine 2026
Move agent, 100,000 training steps[dqn]

A Tetris engine in Go, DQN agents trained with PyTorch, and a viewer that shows them playing and learning. Built to learn reinforcement learning by doing every layer myself, including an agent that uses hold, tucks, spins and T-spins.

vs. heuristic
+44%
Avg score
173k
T-spins / game
233

Problem: Reinforcement learning is easy to follow in a tutorial and hard to trust in practice. I wanted to learn it by building the whole pipeline: a game with rules exact enough to compare agents on identical games, a baseline worth beating, and a way to see what the agent actually learned.

Solution: A deterministic, seedable Tetris engine in Go (7-bag, SRS rotation and kicks, no rendering code) exposed over a gRPC stream, one game per stream. A Python Gymnasium environment sits on top of it and trains a DQN in PyTorch. A separate Ebitengine viewer plays human games, agent replays and training runs, and runs the exported networks itself without Python.

Technical Approach: Actions are placements (a rotation and a column per piece), and the network scores the board after a placement, the afterstate, from four features: aggregate height, holes, bumpiness and lines cleared. That shrinks the problem enough to train on a laptop. The Go and Python sides were verified against each other with a deterministic agent over 200 seeds, since a random agent never clears a line and so proves nothing. The viewer re-reads snapshots written every 5,000 steps, so it can follow a run live.

Results & Learnings: On held-out seeds with a 3,000-piece cap, the agent averages about 173,000 points against 119,880 for the hand-weighted heuristic. Two things did not help: a potential-based shaped reward collapsed mid-training before recovering, and Double DQN was within seed noise. The real limit was measurement: a cap hides differences between strong agents, so I added score per piece and a 10,000-piece survival check. A second agent searches every reachable lock position and learns T-spins, scoring about 240,000 points with 233 T-spins per game, but only when its network cannot see the board, and its checkpoints vary more within one run than the gap to a scripted baseline. The full write-up covers what failed as well as what worked.

Stack
Go · Python · PyTorch · Gymnasium · gRPC · Ebitengine
Role
Full implementation
Transcendence Casino Real-time multiplayer online casino Go · C++ · TypeScript · React · PostgreSQL 2026
Transcendence Casino real-time multiplayer interface showing blackjack table with player hands and chips
Casino table interface[live]

A real-time multiplayer casino — Blackjack, Poker, and slots — spanning Go, C++, and React, bridged by gRPC and a hand-rolled WebSocket hub, with a full Prometheus/Grafana monitoring stack.

Games
3 live
Architecture
3-tier gRPC
Monitoring
6 dashboards

Problem: Transcendence is 42's capstone project format — a large, module-scored web application with strict architectural requirements: a typed backend, a real database, containerized services, real-time multiplayer gameplay, security, and production-grade monitoring. The brief here was a full online casino — Blackjack, Texas Hold'em Poker, and a slot machine — playable live over WebSockets, not a static demo.

Solution: The result is a three-tier system: a Go and Gin backend handling auth, wallets, and REST/WebSocket traffic; a standalone C++ engine handling the actual game rules — card shuffling, hand evaluation, poker betting rounds, slot RNG — over a gRPC contract; and a React/TypeScript frontend on top, themed as a from-scratch "luxury casino" design system rather than a reskinned component kit, with cross-browser support and a spectator mode so a live hand can be watched by other users in real time.

Technical Approach: Two details push this past a CRUD app with a casino skin. Every balance-changing operation — a bet, a deposit, a payout — runs inside a locked database transaction using exact decimal arithmetic, since float math is unacceptable for money; the transactions table is an append-only, independently auditable ledger. And the real-time layer is a hand-rolled WebSocket hub, not a pub/sub library — it tracks per-user, per-tab, per-topic subscriptions and debounces presence so a page refresh doesn't flicker a player's status offline. Similar cross-language, protocol-level thinking shows up in the ELO Leaderboard's concurrent match processing.

Results & Learnings: The stack also carries a full observability layer — Prometheus scraping six targets and six auto-provisioned Grafana dashboards, with alerting routed to Discord. OAuth2, 2FA, and a custom music module are still in progress. Working across three languages bridged by a single protobuf contract made the tradeoffs of IPC design concrete in a way a single-language stack never does.

Stack
Go · C++ · TypeScript · React · PostgreSQL
Focus
Real-time multiplayer · financial correctness
3D Go Renderer From-scratch OpenGL renderer in Go Go 2026
Orbit camera demo[opengl 4.1]

A from-scratch 3D renderer in Go — custom .obj/.mtl parsing, ear-clipping triangulation, and an OpenGL 4.1 pipeline with zero steady-state heap allocations.

Allocs/frame
0.06
Parser
Concurrent
UV modes
3

Problem: scop is 42's OpenGL project — render a 3D .obj model with only a math library and raw OpenGL bindings as external dependencies. There's no scene-graph, no asset pipeline, no glTF loader to lean on: the file parser, the vector and matrix math, the triangulation, and the camera all have to be built from first principles.

Solution: The result is a Go renderer on OpenGL 4.1 core with GLFW for windowing. Custom .obj and .mtl parsers handle geometry and material properties (Ka/Kd/Ks/Ns/map_Kd) with graceful degradation when texture files are missing, and three automatic UV-generation modes — planar, cylindrical, spherical — cover models that ship without texture coordinates. An orbit and free-fly camera sit on top of hand-written vec2/3/4 types and column-major mat4 math, including perspective and lookAt transforms, with no external math dependency.

Technical Approach: Two problems needed real solving. Arbitrary polygons — including concave, non-planar, and degenerate ones — get triangulated with ear clipping over each face's Newell-normal plane, so geometry stays correct regardless of how the source .obj was authored. And the render loop is allocation-free at steady state: a single VAO/VBO/EBO per model with vertex deduplication, Gribb–Hartmann frustum culling, and texture-state batching bring it to 0.06 allocs/frame under -debug. Parsing itself is parallelized — worker goroutines pre-parse vertex and face data per line-aligned chunk, the same concurrency discipline behind the ELO Leaderboard's match processing.

Results & Learnings: On the Utah teapot, concurrent parsing cut load time from 9.9ms to 7.0ms, and unit tests cover the parser, triangulation, UV generation, math, camera, and frustum culling. Building a rasterization pipeline by hand — after a SIMD raytracer the semester before — made the tradeoffs between rasterization and ray tracing concrete in a way tutorials never do.

Language
Go
Graphics
OpenGL 4.1 · GLFW
42 ELO Leaderboard Competitive rankings system for 42 Heilbronn Go · TypeScript · React · PostgreSQL 2026
42 ELO Leaderboard competitive ranking interface with player ratings and match history
Leaderboard interface[archived]

High-performance ELO ranking system in Go and PostgreSQL, built for real-time match submissions with live leaderboards and historical data. No longer actively maintained.

Avg response
30ms
Status
Archived
Query target
<100ms

Problem: The 42 Heilbronn community ran table football and table tennis tournaments with no shared way to track who was actually good. Beyond just storing results, two students could report the same match slot within seconds of each other — naive rating recalculation is a textbook race condition, since an Elo update is a read-modify-write against a shared score and two concurrent submissions can't be allowed to read the same stale rating and both write back.

Solution: I built a complete Elo ranking system in Go with PostgreSQL, optimized from the ground up for performance. Match submissions run inside a transaction that locks both players' rows before applying the rating update, so concurrent reports serialize instead of clobbering each other, while reads — the public leaderboard, player profiles, match history — stay on a separate fast path. The backend served a React frontend with live leaderboards, detailed player profiles, and historical match data.

Technical Approach: Composite indexes on the columns the leaderboard and history views actually filter and sort by, plus Redis for the aggregate stats (win/loss streaks, rating deltas) that don't need to be recomputed on every request and get invalidated on write instead. Go's goroutines handled concurrent API traffic cleanly since each match update was isolated to its own transaction. I profiled throughout development to find and remove the slow paths rather than guessing at them. Similar optimization patterns appear in other systems projects like the raytracer, where every algorithmic decision has direct performance implications.

Results & Learnings: The system achieved 30ms average response times and maintained 99.9% uptime across tournament seasons, and the row-locking approach never produced a double-counted match under concurrent load in practice. Query optimization and profiling-driven development are non-negotiable for systems that prioritize performance. The project is now archived and no longer under active development.

Stack
Go · TypeScript · React · PostgreSQL
Role
Full implementation
Demo
eloleaderboard.de — archived, unmaintained
miniRT High-performance raytracer in C C 2025
miniRT raytracer C implementation with sphere rendering, shadows, reflections and Phong lighting
Rendered output[120 fps]

120+ FPS raytracer built on SIMD vectorization, cache-efficient data structures, and tile-based multi-threaded rendering.

Frame rate
120+ fps
Speed-up
80×
SIMD
SSE/AVX

Problem: I started building a basic raytracer in C to understand computer graphics fundamentals. The initial naive implementation achieved only 1–5 FPS when rendering complex scenes with multiple light sources.

Solution: I rebuilt the core rendering loop with C systems programming principles at its foundation. The approach combined SIMD vectorization using SSE/AVX intrinsics for batch vector operations, cache-efficient data structures using structure-of-arrays layouts instead of array-of-structures, and multi-threaded tile-based rendering to leverage multiple CPU cores.

Technical Approach: Three pillars: vectorization, memory hierarchy, parallelism. SSE intrinsics process 4 floats in parallel, AVX handles 8. I restructured data to exploit CPU cache locality by storing all X-coordinates contiguously, then Y, then Z. The renderer divides the framebuffer into tiles, with each thread processing one tile independently. Profiling with perf and cycle-accurate analysis revealed that the ray-primitive intersection test was the hottest code path.

Results & Learnings: The optimized raytracer renders at 120+ FPS — an 80× improvement over the baseline. Systems programming at the graphics layer isn't just about algorithms; it's about respecting CPU cache behavior, instruction pipelines, and memory bandwidth.

Language
C
Concepts
Linear algebra · optics simulation
minishell POSIX-compliant shell in C C 2025

“The shell is a window into the operating system's soul.”

Unix shell from scratch — process management, file descriptors, pipes, I/O redirection, environment expansion, signal handling.

Standard
POSIX
Primitives
fork/exec
Signals
sigaction

Problem: Understanding how a Unix shell works requires deep knowledge of operating system fundamentals, and 42's minishell project forbids leaning on any of them from a library — no shell libraries, only raw libc and system calls. That means quoting, expansion, redirection, and pipelines all have to be built from first principles, and getting any one of them subtly wrong (a heredoc that doesn't respect quoted delimiters, an unset that leaves a stale env var visible to a child) is invisible until it breaks a specific command.

Solution: A POSIX-compliant shell in C that replicates bash's core behavior. A hand-written lexer and recursive-descent parser turn raw input into a token stream that respects single/double-quote semantics and here-doc boundaries, then an execution engine walks that structure using genuine Unix system calls — no system(), no shortcuts.

Technical Approach: Three systems-programming concepts carry the implementation. Process management via fork/execve with correct PATH resolution and exit-status propagation back through pipelines. File descriptor manipulation through dup2() for multi-stage pipes and I/O redirection (<, >, >>, here-docs), including keeping descriptors from leaking into children that shouldn't inherit them. And signal handling with sigaction() so SIGINT/SIGQUIT behave differently at the prompt versus inside a running child, without ever leaving a zombie process behind.

Results & Learnings: Building minishell transformed my understanding of Unix architecture — shells are orchestrators of the OS, not autonomous entities, and the same process/IPC discipline is exactly what shows up later in gRPC-bridged services or a multi-threaded render loop. Hands-on exploration of process management, file descriptors, and IPC deepened my appreciation for why low-level programming discipline matters.

Language
C
Focus
Unix internals · syscalls
[05]

Field notes

[All writing]
  1. 2026-11-02Testing Raft with a fake clock: deterministic chaos in Go
  2. 2026-10-16Teaching a neural network to play Tetris, one layer at a time
  3. 2026-10-02For vs while loops in C, C++ and Go: identical assembly, and what actually changes performance
  4. 2026-09-17Building a container runtime from scratch: namespaces, pivot_root, cgroups v2, and OverlayFS in pure Go
  5. 2026-08-26Why I keep building from scratch: process handling, WebSocket hubs, and .obj parsers
  6. 2026-08-25Getting Elo leaderboard queries under 100ms: indexes, caching, and profiling instead of guessing
  7. 2026-08-23gRPC versus REST: picking protocols at the Transcendence service boundary
  8. 2026-08-23Triangulating arbitrary polygons with ear clipping over a Newell-normal plane

The best way to learn is to build, break, and rebuild.

[07]

Profile

EDU

Software Engineering
Hochschule Heilbronn

42 Heilbronn
Peer-to-peer, project-based

STACK
Core
Go · C · C++ · TypeScript · JavaScript · Python · Java
Backend
Node.js · Gin · GORM · PostgreSQL · Redis · gRPC · Protobuf · WebSocket · Nginx
Frontend
React · Vite · Tailwind · Electron · three.js · GSAP
Graphics
OpenGL 4.1 · ray tracing
Ops
Linux · Docker · Prometheus · Grafana · Git · GitHub · pnpm
GITHUB
Repos
38
Stars
14
Followers
34
Commits (1y)
2010
github.com/nweber23 ↗
NOW

Concurrency patterns in Go. Distributed systems. Cloud. K3s. Writing up a container runtime in pure Go.

Available for collaboration