Dungeon Dice Duel
A full-stack browser game featuring dice-based combat, persistent game runs, and session-based authentication, built with TypeScript, Express, and SQLite.

What I built
Dungeon Dice Duel is a browser-based game backed by a TypeScript and Express server. Players can authenticate, manage game runs, and engage in turn-based encounters governed by dedicated battle logic. The backend uses SQLite to persist application data and separates authentication, game services, repositories, and domain logic into focused modules. The project also addresses state consistency across game runs and battles, including rules for active battles, battle outcomes, and run resets. Automated unit and integration tests help verify authentication flows, persistence, and game lifecycle behavior.
Gameplay and application features
User registration and login
Session-based authentication and logout
Persistent game runs
Dice-based combat and damage calculation
Enemy encounters and battle outcomes
Game-run reset and abandonment handling
See it in action






How it was built
React 19 and TypeScript, built with Vite and routed with React Router 7. Feature-specific components, loaders, and actions handle API requests close to the functionality that uses them.
Node.js, Express 5, and TypeScript, organized into routes, controllers, middleware, services, repositories, and domain logic.
SQLite using better-sqlite3 for persistent application data and a persistent session store.
Session-based authentication, email verification, account recovery, player statistics, and Vitest unit and integration testing with Supertest.
Challenges & solutions
Maintaining consistent state across game runs and individual battles, including preventing multiple simultaneous active battles within a run.
Enforcing lifecycle rules so that resetting a run during an active battle abandons that battle instead of leaving conflicting state behind.
Separating authentication, persistence, and battle logic into focused modules to make the backend easier to maintain and test.
Managing authentication and session transitions across registration, login, authenticated requests, and logout.
Testing game rules, persistence behavior, authentication flows, and interactions between backend components through unit and integration tests.