system game webapp

Project Goals

Create a local-first TTRPG web app for DMs to:

  1. Host real-time game sessions on their machine via localhost.
  2. Manage character sheets (DM view + player views).
  3. Roll dice (including Fate, exploding mechanics).
  4. Share a dynamic world knowledge bank synced with Obsidian.md.
  5. Operate entirely offline with file-based storage (no cloud dependencies).

Core Features

1. User Roles & Authentication

  • DM/Host:
    • Creates session with master passphrase.
    • Generates/assigns character passphrases.
    • Exports/imports character data (JSON/YAML).
  • Players:
    • Access character sheets via passphrase + DM’s local IP.
    • No backend access; UI-only interaction.

2. Character Management

  • DM Interface: - Create/delete characters. - Edit all character stats in real time. - View all sheets simultaneously.
  • Player Interface: - View/edit assigned character sheet. - Track spendable resources (e.g., health, gold).

3. Dice Roller

  • Supported dice: Fate, d4, d6, d8, d10, d12, d20, d100.
  • Exploding dice: Auto-reroll on max value.
  • Roll history (last 10 rolls).

4. World Knowledge Bank

  • Obsidian.md Integration:
    • DM copies Obsidian vault to server/knowledge folder.
    • Renders .md files with links/wiki-style navigation.
  • Visibility Control:
    • DM toggles articles as "player-visible" in real time.
    • Players see only unlocked content.

5. Networking & Security

  • Local WiFi access via DM’s IP (e.g., http://192.168.x.x:3001).
  • Passphrase-only auth (no persistent user accounts).
  • Data wiped on server shutdown (optional JSON backups).

Technical Stack

Component Technology Purpose
Frontend React + react-router UI for DM/players
Backend Express.js + Socket.io Real-time API + file handling
Storage JSON files Characters, session data
Markdown marked library Render Obsidian .md files
Networking Socket.io WebSockets Live updates (sheets, knowledge)

Project Structure

bash
dnd-app/  
β”œβ”€β”€ server/                  # Backend  
β”‚   β”œβ”€β”€ data/               # JSON/YAML files (characters, session)  
β”‚   β”œβ”€β”€ knowledge/          # Obsidian vault copy (markdown files)  
β”‚   └── index.js            # Express server + Socket.io  
β”œβ”€β”€ src/                    # React frontend  
β”‚   β”œβ”€β”€ components/         # Dice, KnowledgeBank, CharacterSheet  
β”‚   β”œβ”€β”€ DMScreen.js         # DM control panel  
β”‚   └── PlayerScreen.js     # Player view  
└── package.json

Setup & Workflow

  1. DM Prep:
    • Copy Obsidian vault to server/knowledge.
    • Run npm start to launch React + Express.
  2. In-Game:
    • Players connect via DM’s IP + character passphrase.
    • DM edits sheets/toggles knowledge visibility in real time.
  3. Post-Session:
    • DM exports character data (JSON/YAML).
    • Server shuts down, wiping session data (optional).

Roadmap

  1. Phase 1: Core DM/player sheets + dice roller.
  2. Phase 2: Knowledge bank + Obsidian sync.
  3. Phase 3: Export/import workflows + UI polish.

Key Constraints

  • Local Use Only: No production hosting; runs only during sessions.
  • No Database: All data stored in flat files.
  • Minimal Auth: Passphrases for simplicity. This plan prioritizes lightweight, DM-centric tools for tabletop sessions while maintaining compatibility with existing Obsidian workflows.
    🎲 Example character sheet in .md: Character Sheet
  • Name: Cleo Shephard
  • Origin: Caretaker
    • Unique Starting Benefit: "Guardian's Care": Gain a +1 bonus when assisting allies or protecting someone from harm.
  • Class: ---
  • Level: N/A (Initially)
    Balance Action
  • Stats: (Record base stat value and any bonuses)
    • Vit: 19 (+Bonus from Items/Skills)+
    • End: 7 (+Bonus from Items/Skills)
    • Str: 8 (+Bonus from Items/Skills)
    • Agi: 7 (+Bonus from Items/Skills)
    • Per: 11 (+Bonus from Items/Skills)
    • Rea: 10 (+Bonus from Items/Skills)+
    • Res: 7 (+Bonus from Items/Skills)
    • Will: 9 (+Bonus from Items/Skills)
    • Int: 14 (+Bonus from Items/Skills)+
    • Wis: 6 (+Bonus from Items/Skills)
    • Con: 7 (+Bonus from Items/Skills)
    • Focus: 8 (+Bonus from Items/Skills)
Pool Primary Stat Secondary Stat Regen Drivers
Health Endurance (x6) Resistance (x2) (Vitality x3) + Reaction
Mana Intelligence (x5) Control (x1) (Wisdom x2) + Vitality
Stamina Willpower (x4) Endurance (x1) (Focus x2) + Vitality
P. Def. Endurance (x2) Agility (x1)
M. Def. Willpower (x2) Resistance (x1)
  • Derived Stats: (Calculated values, update dynamically. always expressed as [base+bonuses]=[totalCurrent/totalMax])

    • Health (HP): [80+16]=[96/96]
    • Mana (MP): [77+8]=[85/85]
    • Stamina (SP): [37+8]=[45/45]
    • Health Regen/Hour: [64]
    • Mana Regen/Hour: [20]
    • Stamina Regen/Minute: [33]
    • Physical Defense: [x]
    • Mental Defense: [x]
  • Paths: (List Paths taken and current level)

    • [Newbie Path] Lvl [4/7]
    • [Pathless l Path] Lvl [1/100]
    • [Blessing Path] Lvl [x/x]
    • [Healing Palm Path] Lvl [x/x]
    • [Willpower Path] Lvl [x/x]
    • [Crafter l Path] Lvl [x/x]
    • [Trainee Path] Lvl [x/x]
  • Skills: (List all Skills, categorized and leveled)

    • Soulskill: [Skill Name] Lvl [Number]
    • General Skills:
      • [System Interference] Lvl [1]
    • Stamina Skills:
      • [Skill Name] Lvl [Number]
    • Mana Skills:
      • [Skill Name] Lvl [Number]
    • Crafting Skills:
      • [Woodworking] Lvl [3]
    • Boost Skills: (List passive skills and their effects)
      • [Skill Name] Lvl [Number]
  • Perks: (List Perks taken and rarity)

    • [Supply Kit]Lesser Perk]
    • [+2 Wand of Multi-Affinity (Water & Plants)]Greater Perk]
    • [Perk Name]Rarity]
  • Achievements: (List Achievements)

    • [Crazy Bastard] Gained from Entering a Dungeon without a Class or Level.
      • Gain one Greater Perk.
    • [Wild Abandon] Gained from Entering a Dungeon 10 or more Levels above your own.
      • Gain one Perk.
    • [Without a Care] Gained from Entering a Dungeon without any equipment or supplies.
      • Gain one Lesser Perk.
    • [Crafty l] Gained from crafting your first item in The System.
      • Gain one Stat Point. Unlock Crafter l Path.
  • Equipment:

    • Weapons: [Crude Wooden Spear x3] 1d4 /1d6 Piercing DMG, Thrown 20/40.
    • Armor: [List armor pieces and their stats/bonuses]
    • Inventory: [List other carried items, potions, crafting materials, etc.]
  • Soul Points: [0]

  • Path Points: [0]

  • Stat Points: [1]

  • Skill Upgrade Points: [0]
  • Notes: [Space for character backstory, goals, contacts, etc.]