- Remove OCR noise, credits, and duplicates from rules-database.json (288→255 rules) - Add clean_rules.py script for rule cleanup - Add CLAUDE.md, docs/, and update README with documentation links Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5.2 KiB
5.2 KiB
Project Structure
Directory Layout
dwroller/
├── backend/ # Backend API server
│ ├── src/
│ │ ├── routes/ # API route handlers
│ │ ├── controllers/ # Route controllers
│ │ ├── middleware/ # Auth, validation middleware
│ │ ├── models/ # Data models
│ │ └── utils/ # Helper functions
│ ├── server.js # Express server entry point
│ └── package.json
│
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Route pages
│ │ ├── hooks/ # Custom React hooks
│ │ └── store/ # State management
│ ├── public/ # Static assets
│ ├── package.json
│ └── vite.config.js
│
├── data/ # Static data files
│ ├── gamemasters_kit/ # GM tools
│ ├── ocr_rules_*.txt # OCR extracted rules
│ ├── rules_page.png # Rules images
│ └── dwback.png # Background images
│
├── database/ # Database files
│ ├── backups/ # Database backups
│ ├── MIGRATION_*.md # Migration documentation
│ └── alexei-*.json # Canonical data
│
├── docs/ # This documentation
│ ├── SUMMARY.md # Table of contents
│ ├── api.md # API documentation
│ ├── developer-guide.md
│ ├── user-guide.md
│ └── ...
│
├── .env.example # Environment template
├── package.json # Root package.json
└── README.md # Project overview
Feature Architecture
┌─────────────────────────────────────────────────────────┐
│ Deathwatch Roller │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Frontend │───▶│ API │───▶│ Database │ │
│ │ (React) │ │ (Express) │ │ (SQLite) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ - Shop - Auth - Players │
│ - Bestiary - Sessions - Inventory │
│ - Rules - Files - Webhooks │
│ - Sessions - Validation - Backups │
└─────────────────────────────────────────────────────────┘
Data Flow
User Request
│
▼
┌───────────┐
│ Frontend │
│ (React) │
└───────────┘
│
├──────────────┬──────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Shop │ │ Bestiary│ │ Sessions│
│ API │ │ API │ │ API │
└─────────┘ └─────────┘ └─────────┘
│ │ │
└──────────────┴──────────────┘
│
▼
┌───────────┐
│ Backend │
│ (Express) │
└───────────┘
│
▼
┌───────────┐
│ Database │
│ (SQLite) │
└───────────┘
File Organization by Feature
Shop/Inventory
backend/src/routes/shop/- Shop API routesbackend/src/models/Item/- Item modelbackend/src/controllers/shop/- Shop controllerfrontend/src/components/Shop/- Shop UI components
Bestiary
backend/src/routes/bestiary/- Bestiary routesbackend/src/models/Creature/- Creature modelbackend/src/controllers/bestiary/- Bestiary controllerfrontend/src/components/Bestiary/- Bestiary UI
Players
backend/src/routes/players/- Player routesbackend/src/models/Player/- Player modelbackend/src/controllers/players/- Player controllerfrontend/src/components/Players/- Player UI (GM only)