David Alvarez c3b6ea8567
Build & Deploy / build-and-deploy (push) Failing after 59s
refactor: apply SOLID/KISS/YAGNI principles
Phase 1-2: Extract ConfigBuilder — single source of truth for all DOSBox config
  - Uses Java 21 text block templates (eliminates \n escaping bugs)
  - Deduplicated 6 config-building methods from GameService + UploadResource
  - CD mounting strategy: mount ALL images, dedup by parent dir, prefer data formats

Phase 1: Extract services from UploadResource monolith
  - PlatformDetector — PE/NE/MZ header analysis (was duplicated in 2 files)
  - CdImageService — CUE sheet repair + CD image discovery in dirs and ZIPs
  - ExecutableDetector — main exe / setup exe / self-extractor detection
  - ZipService — ZIP extraction, directory flattening, .jsdos bundle creation
  - ConfigPatcher — hardcoded C:\ path detection and rewriting

Phase 3 (YAGNI): Remove dead/misused code
  - Removed Game.platforms field (was storing genres, not platforms)
  - Fixed IgdbService that set platforms to genres list

Phase 4 (SOLID-D): Add GameStore interface
  - IgdbService now depends on GameStore, not concrete GameService
  - Enables testing with mocks

GameService.setExecutable now transactional:
  - Patches into temp file, detects platform from patched bundle
  - Atomic move on success, temp cleanup on failure

UploadResource: 1094 → 237 lines (-78%)
GameService: 412 → 290 lines (-30%)
Total: 2846 lines across 14 focused files (was 1723 lines in 3 monolithic files)
2026-06-09 12:54:07 +02:00
2026-05-28 23:14:35 +02:00

Dostalgia

A nostalgic DOS game hub. Upload your old DOS games, scrape artwork, and play them directly in the browser via js-dos (WebAssembly DOSBox).

Quick Start

# Build and run with Docker
docker build -t dostalgia .
docker run -p 8765:8765 -v $(pwd)/data:/data dostalgia

Open http://localhost:8765

Development (without Docker)

Terminal 1 — Frontend dev server:

cd frontend && npm install && npm run dev

Terminal 2 — Quarkus dev server:

mvn quarkus:dev

Open http://localhost:5173 (Vite proxies API calls to Quarkus on port 8765)

Production build (local)

cd frontend && npm install && npm run build
mvn package -DskipTests
java -jar target/quarkus-app/quarkus-run.jar

Architecture

  • Backend: Quarkus (Java 21, JAX-RS) — ~5 REST resource classes, zero database
  • Frontend: Svelte 5 SPA with hash-based routing
  • Emulation: js-dos v8 loaded from CDN, runs DOSBox in WebAssembly
  • Storage: JSON-per-game under /data/games/{id}/game.json

API

Method Path Description
GET /api/games List all games
GET /api/games/:id Get game details
PATCH /api/games/:id Update game metadata
DELETE /api/games/:id Delete a game
POST /api/upload Upload a game ZIP (multipart)
POST /api/games/:id/cover Upload cover art
GET /api/igdb/search?q= Search IGDB (placeholder)

Game JSON Schema

{
  "id": "doom",
  "title": "Doom",
  "year": 1993,
  "genre": "FPS",
  "developer": "id Software",
  "bundle_file": "doom.jsdos",
  "has_cover": true,
  "ready": true
}
S
Description
A nostalgic DOS game hub — upload, scrape artwork, and play your classic games in the browser
Readme MIT 5.6 MiB
Languages
Java 62.2%
Svelte 24.7%
JavaScript 8.8%
CSS 3.4%
Dockerfile 0.5%
Other 0.4%