Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

780 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libris Maleficarum

CI CD License Azure IaC

Early Development — This project is under active development. Features, APIs, and infrastructure are subject to change. Contributions and feedback are welcome.

What is Libris Maleficarum?

Libris Maleficarum is an AI-enhanced campaign management and world-building platform for tabletop role-playing games (TTRPGs). It enables game masters and players to create, organize, and manage rich, interconnected campaign worlds with AI-powered assistance. I created this project to explore the intersection of AI, software architecture, and game design, while building a useful tool for helping me plan and run my own D&D campaigns.

Target Users

  • Game Masters — Create and manage campaign worlds, locations, characters, and lore with hierarchical organization and AI suggestions.
  • Content Creators — Build reusable world templates and assets.
  • Players — Access shared campaign content collaboratively (Future feature).

Key Features

  • Hierarchical World Organization — Unlimited nesting of world entities (World > Continent > Region > Country > City > Character, and more).
  • 29 Entity Types — Locations, people, events, factions, items, and custom types with schema-driven properties.
  • AI-Powered Assistance — Conversational agentic interface for world-building powered by Microsoft Agent Framework and CopilotKit.
  • Full-text and Semantic Search — Find entities by name or by concept using Azure AI Search.
  • Rich Asset Management — Attach maps, portraits, session recordings, and documents to any entity.
  • Fantasy D&D Theme — Royal blue and gold palette with dark/light mode, designed for the tabletop RPG experience.
  • Multi-System Support — D&D 5e, Pathfinder, and custom systems via flexible entity schemas.

Technology Stack

Layer Technologies
Frontend React 19, TypeScript, Vite, Redux Toolkit, TailwindCSS v4, Shadcn/UI, CopilotKit
Backend .NET 10, ASP.NET Core, EF Core (Cosmos DB), Microsoft Aspire Clients, Microsoft Agent Framework
Infrastructure Azure Bicep (Azure Verified Modules), Cosmos DB, AI Search, Key Vault, Container Apps, Static Web App
CI/CD GitHub Actions, Azure Developer CLI (azd)
Testing Vitest, Testing Library, jest-axe, Playwright (frontend) · MSTest, FluentAssertions (backend)

Getting Started

Prerequisites

Run Locally with Aspire

The fastest way to run the full stack locally is with Microsoft Aspire, which orchestrates the frontend and backend services, Cosmos DB Emulator, and service discovery automatically.

  1. Clone the repository

    git clone https://github.com/PlagueHO/libris-maleficarum.git
    cd libris-maleficarum
  2. Start the entire application stack with Aspire

    aspire run

    This starts all services and starts the Aspire Dashboard for observability (logs, traces, metrics).

    The app is served at https://127.0.0.1:4000 (the first run generates a self-signed SSL certificate — your browser will warn).

Frontend-Only Development

If you only need the frontend (with mocked APIs via MSW):

cd libris-maleficarum-app
pnpm install
pnpm dev

Useful Commands

Frontend (libris-maleficarum-app/)

Command Description
pnpm dev Start Vite dev server
pnpm build TypeScript check + production build
pnpm test Run tests (headless)
pnpm test:ui Run tests with Vitest browser UI
pnpm lint Lint with ESLint
pnpm format Format with Prettier

Backend (libris-maleficarum-service/)

Command Description
dotnet run --project src/Orchestration/AppHost Start Aspire orchestration
dotnet build LibrisMaleficarum.slnx Build all projects
dotnet test LibrisMaleficarum.slnx Run all tests
dotnet test --filter TestCategory=Unit Run unit tests only
dotnet test --filter TestCategory=Integration Run integration tests only

Authentication and Access Control

The application supports two authentication modes and an optional access code gate. These can be used independently or together.

Single-user mode (default)

When no Entra ID configuration is provided, the API runs in single-user anonymous mode. All requests are treated as a single anonymous user. No sign-in or bearer token is required. This is the default for local development.

Multi-user mode (Entra ID)

When AzureAd:ClientId is configured, the API enables Microsoft Entra ID JWT bearer authentication. Users must sign in via MSAL and provide a valid bearer token with each request.

Configure the backend in appsettings.json:

{
  "AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
    "TenantId": "<your-tenant-id>",
    "ClientId": "<your-client-id>",
    "Audience": "<your-audience>",
    "Scopes": "access_as_user"
  }
}

The frontend reads ENTRA_CLIENT_ID and ENTRA_TENANT_ID environment variables (injected by Aspire or set manually) to configure MSAL for interactive sign-in.

Access code gate (optional)

The access code is an optional shared secret that protects all API endpoints. It works in both single-user and multi-user modes. When enabled, every request must include an X-Access-Code header. The frontend shows a dialog prompting for the code before allowing access.

Set the access code via environment variable or configuration:

# Environment variable (recommended)
$env:ACCESS_CODE = "your-secret-code"
// appsettings.Development.json (local dev only — do not commit secrets)
{
  "AccessControl": {
    "AccessCode": "your-secret-code"
  }
}

To disable, leave AccessCode empty or omit ACCESS_CODE. When no access code is configured, all requests pass through without restriction.

For Azure deployments, set the ACCESS_CODE secret in your GitHub repository settings. The CI/CD workflows pass it through to the infrastructure automatically.

Deploy to Azure

This project uses the Azure Developer CLI to provision infrastructure and deploy the application.

  1. Authenticate

    azd auth login
  2. Initialize (if you haven't cloned the repo)

    azd init -t PlagueHO/libris-maleficarum
  3. Preview infrastructure changes

    azd provision --preview
  4. Provision and deploy

    azd up
  5. Deploy app only (after initial provisioning)

    azd deploy

Delete the Deployment

azd down --force --purge

Warning

This deletes all resources created during deployment, including any data. Back up important data before running this command.

Architecture

The solution follows a Clean/Hexagonal architecture for the backend and a feature-based component structure for the frontend.

Infrastructure is deployed with Azure Bicep using Azure Verified Modules and follows a network-isolated, zero-trust approach with private endpoints for all PaaS services.

For detailed design documentation, see the docs/design/ folder:

Contributing

Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request.

License

This project is licensed under the MIT License.

About

Libris Maleficarum is an AI-enhanced, extensible campaign management tool for tabletop RPGs that empowers game masters to create, manage, and evolve immersive adventures using modern .NET 8, Cosmos DB, and React/TypeScript technologies.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages