Commit Graph

17 Commits

Author SHA1 Message Date
19f4dd0cca Fix bestiary data: sync profiles, armour, movement from stats; fix cross-contaminated entries 2026-07-02 17:36:41 +02:00
7873f450da feat: rules midgame priority system, mission enhancements, and requisition shop improvements
- Add midgame priority ranking for rules (midgamePriority field)
- Enhance rules search to support midgame filtering and sorting
- Improve mission simulation and midgame tracking
- Fix RequisitionShop player name handling
- Add rules midplay simulation tests
- Update MissionTab with midgame scene tracking
- Add backend logging for rules updates
2026-06-24 12:09:25 +02:00
e511bff882 Add weapon images, full rule scraping, and expanded quick reference
- scripts/generate-weapon-images.js: AI image generation for weapon cards
  supporting HuggingFace FLUX.1-schnell, OpenAI DALL-E 3, and Gemini Imagen;
  images served from public/weapon-images/ via new static route in server.js
- public/cards.html: load manifest.json and show AI art on weapon cards
- scripts/scrape-rules-from-pdfs.py: PyMuPDF scraper extracting full rule
  text from all five rulebook PDFs with bold-span heading detection
- scripts/tag-and-dedup-rules.js: standalone dedup helper (JS-side grouping)
- database/routes/rulesRoutes.js: remove content truncation in search/random,
  add admin dedup endpoint (JS-side, fast), fix RulesTab to fetch full content
- src/components/RulesTab.jsx: fetch full rule content on modal open
- public/print.html: expanded quick reference with pre-gen character stat
  blocks (Sepheran + Lucian), Astartes traits sheet with correct derived SBs
  and TBs, full Critical Hit Tables for all 4 locations × 4 damage types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 22:50:50 +01:00
d84ca39e61 refactor: Migrate database from SQLite to MariaDB
Database Migration:
- Add MariaDB connection configuration and initialization (mariadb.js)
- Create MariaDB schema update script (mariadb-schema-update.sql)
- Add migration scripts for SQLite to MariaDB transition:
  * migrate-sqlite-to-mariadb.js: Main migration script
  * migrate-inventory-to-gear.js: Inventory schema migration
- Remove SQLite-specific implementation files and databases

Route Updates:
- Update all route handlers to use MariaDB instead of SQLite
- Migrate routes: playerRoutes, sessionRoutes, shopRoutes, bestiaryRoutes, rulesRoutes, rulesStagingRoutes, weaponsRoutes
- Remove SQLite-specific route files (playerRoutes-sqlite.js, sessionRoutes-sqlite.js)
- Update server.js to initialize MariaDB and register new weapon routes

Backend Scripts:
- Remove old SQLite migration scripts (migrate-to-sqlite.js, server-sqlite.js)
- Delete obsolete database utility scripts from backup-scripts/

Frontend Updates:
- Update logger utility for improved error handling and debugging
- Enhance PlayerManagement component with better state management
- Improve RequisitionShop component for MariaDB integration
- Update DeathwatchRoller with performance improvements
- Add login test suite (login.test.js)
- Add XP progression utility (xpProgression.js)
- Update dependencies in package.json and package-lock.json

This migration improves:
- Database scalability and performance
- Transaction support for complex operations
- Better data integrity and ACID compliance
- Simplified deployment and backup procedures
2025-12-11 19:20:44 +01:00
copilot-swe-agent[bot]
0f44d56c63 Fix CI pipeline by separating unit and integration tests
Co-authored-by: alexpolo1 <14327609+alexpolo1@users.noreply.github.com>
2025-08-24 20:40:59 +00:00
8c280bdacc feat: Update package.json scripts and add new dependencies for improved functionality 2025-08-21 22:46:12 +02:00
b6135640e1 Refactor code structure for improved readability and maintainability 2025-08-20 15:29:22 +02:00
4c1b19fb8c feat: Implement bestiary routes for data retrieval and management
- Added bestiaryRoutes.js to handle API endpoints for fetching enemies, full bestiary data, and statistics.
- Implemented caching mechanism for bestiary data with a 5-minute expiration.
- Created transformation functions for bestiary entries to standardize data format for the dice roller.
- Added admin-only endpoint to force reload bestiary data with GM authentication.

chore: Create scripts for analyzing and cleaning bestiary data

- Developed analyze-bestiary-quality.js to review data quality and identify duplicates or inconsistencies.
- Implemented clean-bestiary-fields.js to extract and clean specific fields from bestiary entries, reducing text duplication.
- Created clean-corrupted-bestiary.js to remove corrupted entries based on defined patterns.
- Generated a comprehensive database-cleanup-report.md summarizing the cleaning process and results.

build: Add fast build script for streamlined deployment

- Introduced fast-build.sh to facilitate quick builds and PM2 reloads without reinstalling dependencies.

test: Add GM authentication logic test

- Created test-gm-auth.js to verify the correctness of GM authentication logic with various test cases.
2025-08-17 18:15:39 +02:00
caf8a03553 feat: Add scripts for upserting and validating bestiary data
- Implemented `upsert-allewis-from-5001.js` to fetch and update Allewis data from API.
- Created `upsert-missing-movement-from-5001.js` to fill missing movement and wounds data from API.
- Developed `upsert-missing-movement-from-pdfs.js` to extract movement and wounds from PDF text.
- Added `upsert-missing-profiles-from-pdfs.js` to fill missing profiles from PDF data.
- Introduced `upsert-missing-wounds-from-pdfs.js` to update wounds data from PDF sources.
- Created `validate-bestiary.js` to validate the structure of the bestiary JSON.
- Updated `BestiaryTab.jsx` component to display bestiary data with improved structure and search functionality.
- Added tests for `BestiaryTab` to ensure proper rendering and functionality.
2025-08-17 16:21:00 +02:00
671865d100 feat: enhance build process and testing workflow
- Updated package.json scripts to include separate unit and integration tests before building.
- Added a new script `test-build-test` to run tests before and after the build process.
- Introduced a new local CI/CD script for streamlined local development and testing.
- Refactored PlayerTab component to normalize skills data structure and added tooltips for Space Marine and Power Armour abilities.
- Added named export for Tooltip in DeathwatchRoller for reuse in other components.
2025-08-16 15:14:28 +02:00
b6320ceff6 Remove MongoDB; add PM2 scripts, CI, tests; fix PlayerTab hooks; add pm2 smoke-test 2025-08-16 13:01:30 +02:00
dde3abda55 feat: Add validation and normalization utilities for player records
- Implemented `validatePlayer` and `normalizeTabInfo` functions in `database/validate.js` for player data validation and normalization.
- Added error handling for required fields and enforced data types and constraints.
- Introduced standardization for characteristics and skills.

feat: Create script for extracting rules from PDF files

- Developed `extract-rules.js` to extract text from PDF rulebooks and categorize rules.
- Integrated `pdftotext` for PDF processing and created a searchable rules database.
- Implemented rule categorization and indexing for efficient searching.

feat: Implement RulesTab component for rule searching

- Created `RulesTab.jsx` for searching and displaying rules with filtering options.
- Added recent searches and quick reference buttons for user convenience.
- Integrated API calls for fetching rules and displaying results dynamically.

feat: Add test script for Rules API

- Created `test-rules.js` to test the functionality of the Rules API endpoints.
- Included tests for search and stats endpoints to ensure proper response handling.
2025-08-16 12:15:32 +02:00
cd10ab0718 fix1 2025-08-15 16:23:34 +02:00
4c48f04c4e Refactor RequisitionShop component: remove unused GM panel logic, enhance error handling, and improve player purchase flow. Update tests for RequisitionShop to cover new functionality and ensure proper rendering. Implement curl-based HTTP requests in GM and player tests for better compatibility. Add script to ensure GM user exists in the database with appropriate privileges. 2025-08-15 13:53:13 +02:00
57acd761f9 test1 2025-08-15 12:19:41 +02:00
90f2a94974 new version 2025-08-15 10:35:27 +02:00
Alex Polo
125d4e2f8b Initial commit 2025-08-14 23:55:55 +02:00