# Les HΓ©ritiers FoundryVTT System - Documentation Index ## πŸ“– Available Documentation ### 1. **QUICK_REFERENCE.md** ⭐ START HERE - **Length**: 250 lines - **Purpose**: Fast lookup and common task guide - **Best for**: Developers new to the system - **Contains**: - Quick start setup commands - System overview & statistics - Project structure diagram - Key classes and exports - Step-by-step: Adding a new item type - Common edits (characteristics, packs, rolls, UI) - Testing and git workflow - Useful commands ### 2. **DEVELOPER_INSTRUCTIONS.md** πŸ“š COMPREHENSIVE GUIDE - **Length**: 598 lines - **Purpose**: Complete architectural reference - **Best for**: Deep understanding and long-term development - **Contains**: - Executive summary - Build/dev commands (package.json, gulpfile.js) - System architecture (metadata, data model, directories) - Directory structure with file descriptions - Template organization & conventions - Localization strategy - Styling (LESS, CSS) - Compendium packs reference - Detailed conventions: - Module/class structure - Data model conventions - Handlebars template patterns - Localization key naming - Dice & roll system - Socket message handling - Recent migration notes (v13) - Development workflow (setup, file organization, registration steps) - Debugging tips - Key statistics - External resources - Developer recommendations ### 3. **README.md** (ORIGINAL) - **Length**: 29 lines - **Purpose**: Project overview and credits - **Contains**: - Project description (English & French) - Copyright & authorization notes - Developer credits --- ## 🎯 How to Use This Documentation ### For First-Time Setup (5-10 minutes) 1. Read **QUICK_REFERENCE.md** β†’ "Quick Start" section 2. Run `npm install` and `npm run watch` 3. Skim the "Project Structure" section ### For Adding a New Feature (30 minutes) 1. Open **QUICK_REFERENCE.md** β†’ "Adding a New Item Type" section 2. Follow the numbered steps 3. Reference **DEVELOPER_INSTRUCTIONS.md** for deeper understanding of each step 4. Test with `npm run watch` ### For Understanding the System (1-2 hours) 1. Start with **DEVELOPER_INSTRUCTIONS.md** β†’ "Executive Summary" 2. Read section 2: "System Architecture" 3. Read section 3: "Key Conventions" 4. Review section 5: "Development Workflow" ### For Debugging a Bug (varies) 1. Check **QUICK_REFERENCE.md** β†’ "Useful Commands" for search/analysis tools 2. Reference **DEVELOPER_INSTRUCTIONS.md** β†’ Section 3 for patterns 3. Look at git history: `git log --oneline | head -20` 4. Check browser console (DevTools) at `http://localhost:30000` ### For Making Common Edits (5-15 minutes each) Reference **QUICK_REFERENCE.md** β†’ "Common Edits" section: - Adding a new characteristic - Adding a new compendium pack - Adding a new roll type - Changing UI layout --- ## πŸ“Š Quick System Overview | Aspect | Detail | |--------|--------| | **System ID** | `fvtt-les-heritiers` | | **Version** | 13.0.7 | | **Foundry** | v13+ (AppV2, DataModels) | | **Language** | French (monolingual) | | **Build Tool** | Gulp 4 + LESS | | **Code** | 12,273 LOC total | | **Actor Types** | 2 (personnage, pnj) | | **Item Types** | 14 types | | **Compendium Packs** | 11 LevelDB packs | | **Sheets** | 16 AppV2 sheets | | **Architecture** | ES6 modules, TypeDataModel | --- ## πŸ—‚οΈ Repository Structure ``` fvtt-les-heritiers/ β”œβ”€β”€ README.md # Original project readme β”œβ”€β”€ QUICK_REFERENCE.md # ⭐ Start here (250 lines) β”œβ”€β”€ DEVELOPER_INSTRUCTIONS.md # πŸ“š Deep dive (598 lines) β”œβ”€β”€ DOCUMENTATION_INDEX.md # This file β”œβ”€β”€ package.json # npm config (build commands) β”œβ”€β”€ gulpfile.js # Gulp tasks (LESS β†’ CSS) β”œβ”€β”€ system.json # FoundryVTT manifest β”œβ”€β”€ template.json.backup # Data schema reference β”œβ”€β”€ LICENCE.txt # License β”œβ”€β”€ modules/ # Source code (12,273 LOC) β”‚ β”œβ”€β”€ heritiers-main.js # Foundry init & registration β”‚ β”œβ”€β”€ heritiers-actor.js # HeritiersActor class β”‚ β”œβ”€β”€ heritiers-item.js # HeritiersItem class β”‚ β”œβ”€β”€ heritiers-config.js # Game constants (HERITIERS_CONFIG) β”‚ β”œβ”€β”€ heritiers-utility.js # Static utilities & helpers β”‚ β”œβ”€β”€ heritiers-commands.js # Chat commands β”‚ β”œβ”€β”€ heritiers-combat.js # Combat handling β”‚ β”œβ”€β”€ models/ # 16 TypeDataModels β”‚ β”‚ └── personnage.mjs, arme.mjs, competence.mjs, ... β”‚ └── applications/sheets/ # 15 AppV2 Sheet classes β”‚ └── personnage-sheet.mjs, arme-sheet.mjs, ... β”œβ”€β”€ templates/ # 27 Handlebars templates β”‚ β”œβ”€β”€ actor-sheet.hbs # Character sheet β”‚ β”œβ”€β”€ actor-pnj-sheet.hbs # NPC sheet β”‚ β”œβ”€β”€ item-[type]-sheet.hbs # Item sheets (14) β”‚ β”œβ”€β”€ partial-*.hbs # Reusable components β”‚ β”œβ”€β”€ chat-*-result.hbs # Chat templates β”‚ └── editor-*.hbs # Editor components β”œβ”€β”€ lang/ β”‚ └── fr.json # Localization (24 lines, minimal) β”œβ”€β”€ less/ β”‚ β”œβ”€β”€ heritiers.less # Entry point β”‚ └── simple-converted.less # Imported styles β”œβ”€β”€ styles/ β”‚ β”œβ”€β”€ heritiers.css # Compiled output (generated) β”‚ └── heritiers.css.map # Source map (generated) β”œβ”€β”€ packs/ # 11 Compendium packs (LevelDB) β”œβ”€β”€ srcdata/ # Source data for compilation β”œβ”€β”€ assets/ # UI assets (images, etc.) └── .git/ # Git history available ``` --- ## πŸš€ Common Tasks Quick Links | Task | Guide | Time | |------|-------|------| | Initial setup | QUICK_REFERENCE.md β†’ Quick Start | 5 min | | Add item type | QUICK_REFERENCE.md β†’ Adding a New Item Type | 30 min | | Fix a bug | DEVELOPER_INSTRUCTIONS.md β†’ Section 5 | 15-60 min | | Understand architecture | DEVELOPER_INSTRUCTIONS.md β†’ Section 2 | 30 min | | Change UI layout | QUICK_REFERENCE.md β†’ Change UI layout | 10 min | | Add characteristic | QUICK_REFERENCE.md β†’ Add a new characteristic | 20 min | | Add new roll type | QUICK_REFERENCE.md β†’ Add a new roll type | 25 min | | Debug an issue | QUICK_REFERENCE.md β†’ Testing Changes | 10-30 min | --- ## πŸ“ Documentation Standards All documentation follows these principles: 1. **Clarity**: Written for developers unfamiliar with the system 2. **Completeness**: All information needed to perform tasks included 3. **Accuracy**: Based on actual code analysis, not assumptions 4. **Brevity**: Concise sections with clear headings 5. **Examples**: Code snippets and patterns provided 6. **Cross-references**: Links between guides for deeper understanding --- ## πŸ”„ Keeping Documentation Updated When making significant changes: 1. **Update QUICK_REFERENCE.md** if: - Adding/removing item types - Changing build commands - Adding/removing features - Changing conventions 2. **Update DEVELOPER_INSTRUCTIONS.md** if: - Major architecture changes - New development patterns established - New statistics to report - New sections needed 3. **Update git history** (automatic): - Commit messages explain changes - Reference these in DEVELOPER_INSTRUCTIONS.md --- ## πŸ“ž Questions? Refer to: - **FoundryVTT Docs**: https://foundryvtt.com/articles/ - **Game Rules**: https://titam-france.fr - **Git History**: `git log --oneline` (see recent commits) - **Code Comments**: Most functions have JSDoc-style comments --- **Last Updated**: March 16, 2025 **Documentation Version**: 1.0 **System Version**: 13.0.7 --- ## πŸŽ“ Learning Path **Day 1**: Quick understanding 1. Read QUICK_REFERENCE.md (20 min) 2. Run setup commands (5 min) 3. Explore directory structure (10 min) **Week 1**: Basic development 1. Read DEVELOPER_INSTRUCTIONS.md sections 1-3 (45 min) 2. Add a simple new item type (1-2 hours) 3. Fix a small bug (30 min - 1 hour) **Week 2+**: Deep expertise 1. Read full DEVELOPER_INSTRUCTIONS.md (1-2 hours) 2. Add complex feature (3-6 hours) 3. Understand DataModels & AppV2 sheets intimately 4. Review git history for patterns (1-2 hours)