← Back to Projects
In Development Web App

Warhammer Leveling

CRPG-style gamification system in the Warhammer 40K universe

Warhammer Leveling is a deeply ambitious gamification system that transforms everyday tasks,workouts, study sessions, personal goals,into an immersive CRPG experience set in the Warhammer 40K universe. Built with Next.js 14 and TypeScript under strict Clean Architecture, the project spans 120+ source files and over 10,000 lines of code. The domain layer contains 19 models and 19 game engines written in pure TypeScript with zero external imports, making every rule deterministic and fully testable. The application layer orchestrates 35 use cases across 8 domains, while the infrastructure layer persists state through SQLite via Drizzle ORM with 10 repository implementations and a JSON data pipeline with caching for 28 game data files. Character creation is an eight-step wizard offering 6 origin worlds, 8 backgrounds (including Outcast and Sanctioned Psyker paths), 8 personality traits, and 20 distributable bonus stat points across 9 primary attributes,each origin mechanically affecting stats (e.g., Forge World grants INT +10/TGH +5 but penalizes FEL -10/WP -5). The task engine awards XP scaled by difficulty (1-8 scale) with streak multipliers (7-day: 1.5x, 30-day: 3x, 90-day: 5x), diminishing returns after 3 same-category completions per day, and a streak calendar with monthly heatmaps. Three difficulty tiers (Narrative, Standard, Grimdark) scale skill bonuses, XP rates, sanity drain, corruption gain, and even death consequences,Grimdark features permadeath. The turn-based combat system implements d100 skill checks, weighted hit locations (head 10%, body 30%, limbs 15% each), weapon condition degradation from pristine to broken, and tactical options including aim, charge, flank, and defensive stance with AI enemy turns. The most creative feature is the Unreliable Narrator sanity system: as sanity drops through five states (Stable > Stressed > Disturbed > Breaking > Shattered > Lost), the UI itself becomes unreliable,text corrupts, fake notifications appear at up to 50% frequency, and screens glitch and distort. Twenty-six psychic powers across 5 disciplines and 5 tiers risk Perils of the Warp with severity rolls from negligible to catastrophic, while corruption accumulates and triggers mutations at five thresholds (26, 41, 61, 76, 91). The game also features 7-faction reputation with cross-faction ripple effects, branching narrative with 9 scenes in Chapter 1 and 6 NPCs with relationship dimensions and breaking points, a housing upgrade path from Underhive Hovel to Spire Quarters, and a progressive unlock system that reveals new mechanics from Level 1 through Level 50+ Ascension. All backed by 166 tests across 14 test files.

Key Features

Clean Architecture: 19 domain models, 35 use cases, 19 game engines
Turn-based combat with d100 skill checks, hit locations, and AI enemies
26 psychic powers across 5 disciplines with Perils of the Warp system
Unreliable Narrator: UI corrupts as sanity drops (text glitch, fake alerts)
Task gamification with XP scaling, streak multipliers, diminishing returns
166 tests across domain, application, infrastructure, and integration
Branching narrative system with typewriter text and skill checks
7-faction reputation system with cross-faction ripple effects

Architecture

Next.js 14 (App Router) → Clean Architecture (Domain → Application → Infrastructure → Presentation) → Drizzle ORM → SQLite → Vitest

Preview

Warhammer Leveling view 1
Warhammer Leveling view 2
Warhammer Leveling view 3
Warhammer Leveling view 4
Warhammer Leveling view 5

Tech Stack

Next.js 14TypeScriptSQLiteDrizzle ORMTailwind CSSFramer MotionZodVitest