Skip to content

janikowski-dev/Spell-Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spell Editor

A WPF desktop application that lets you browse a library of shared spells and create and edit your own custom spells with a full undo/redo history.

Overview

Overview

Architecture

The solution is split into four projects:

SpellEditor.Domain - pure data models and repository interfaces. No dependencies on any other layer. Contains Spell, Damage, Dice, and all enums.

SpellEditor.Application - business logic, services, and commands. Depends only on Domain. Contains SpellService, UndoService, LogService, SpellValidationService, and all IUndoableCommand implementations.

SpellEditor.Infrastructure - LiteDB persistence. Implements ISpellRepository and IUnitOfWork. Seeds the database on first run with a set of canonical D&D spells.

SpellEditor.UI - WPF presentation layer. Depends on Application and Infrastructure. Uses CommunityToolkit.Mvvm for MVVM, with messaging between ViewModels.

SpellEditor.Tests - NUnit test project covering Domain models, Application services, validation rules, and undo/redo behaviour. Uses FluentAssertions for assertions and Moq for mocking dependencies. The UI layer is excluded due to WPF dependencies.

Features

  • Browse spells grouped by school in a hierarchy panel
  • Inspect and edit spell properties in a side panel
  • Add and delete project spells
  • Edit damage entries including dice count, sides, bonus, and damage type
  • Full undo/redo support for all mutating operations
  • Live console log showing all operations with colour-coded severity
  • Validation - spells with invalid data or saving throw violations are rejected before saving
  • Read-only protection - shared spells cannot be modified or deleted

Spell Rules

Property Constraint
Name Required, max 100 characters
Level 0-9 (0 = cantrip)
Damage entries Max 3
Saving throw Required when damage is present
Dice count 1-20
Dice bonus -10-40

Tech Stack

  • .NET 10 / C# 14
  • WPF
  • LiteDB (embedded document database)
  • CommunityToolkit.Mvvm
  • FluentValidation
  • Microsoft.Extensions.Hosting (DI + hosted services)
  • NUnit + FluentAssertions + Moq (tests)

Getting Started

  1. Clone the repository
  2. Open SpellEditor.sln in Visual Studio 2022 or Rider
  3. Set SpellEditor.UI as the startup project
  4. Run - the database is created and seeded automatically on first launch

Running Tests

dotnet test

Tests cover Domain models, Application services, validation rules, and undo/redo behaviour. The UI layer is excluded from tests due to WPF dependencies.

About

A standalone desktop application for creating and managing D&D spells.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages