Progressive Web App (PWA) for building army lists for Warhammer 40k and Age of Sigmar. Built with vanilla JavaScript, Web Components, and Service Workers.
- No frameworks - Pure vanilla JavaScript with ES6 modules
- Web Components - Custom elements in
/components/with Shadow DOM - Data Store - Singleton
DataStore(EventTarget) manages all army lists in localStorage - DOM Creation - Use
h()helper fromsrc/domUtils.jsfor all DOM manipulation
Metadata supplements army data with user-editable or imported content (stats, abilities, weapons, wargear, enhancements). It is stored separately from army lists.
- Storage - IndexedDB (
PersonnelMetadataDB), managed bysrc/MetadataStore.js - Scope - Keyed by
gameSystem:factionName:unitName; faction-level shared data uses a specialSHARED_ENTITIESunit name - Categories -
stats,abilities,weapons,wargear,enhancements(per unit or faction) - Import - BattleScribe catalogue files (
.cat) can be parsed and imported via40k/metadata/ - Export - Metadata can be exported by game system and/or faction
- Start server:
npm start(live-server at http://localhost:8080) - Lint:
npm run lint - Format:
npm run format - Auto-fix linting:
npm run lint:fix - Unit tests:
npm test(ornpm run test:unit) — Node's built-innode:testrunner overtests/unit/**/*.test.mjs
Separate sw.js (production) and sw-dev.js (development) files.
- ES6 modules - Always use
import/export - Private fields - Use
#fieldNamefor encapsulation - const > let - Prefer
const, avoidvar - Arrow functions - For callbacks
- async/await - For promises
- 40k: Units in
{units}array (migrated from old{characters, battleline, otherUnits}format) - AoS: Units in
{regiments, auxiliaryUnits, lores, terrain}structure - Both use similar patterns but different categorization
- Art assets from SVG Repo
- Placeholder animations from SVGBackgrounds.com
- AoS & 40k icons from Warhammer40kGroup
- Faction icons from Certseeds
- Additional 40k icons from Locequen
- Everything else by me and Cursor.