Migrate backend from Go to Quarkus (Java 21 / JAX-RS)

- Replaced Go stdlib server with Quarkus (RESTEasy Reactive + Jackson)
- 7 Java classes: Game POJO, GameService (JSON file I/O), 4 REST resources, static file serving
- Same JSON-per-game storage, same ZIP upload + bundle creation
- Same Svelte frontend (unchanged), built into the JAR via maven-resources-plugin
- Multi-stage Dockerfile: Node → Maven → JRE runtime
This commit is contained in:
David Alvarez
2026-05-24 15:41:51 +02:00
parent 7f17f4b31e
commit 28ea711b24
18 changed files with 986 additions and 933 deletions
+24 -16
View File
@@ -1,34 +1,44 @@
# Dostalgia
# Dostalgia — Quarkus Edition
A nostalgic DOS game hub — upload, scrape artwork, and play classic DOS games directly in the browser via js-dos.
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 (Docker)
## Quick Start
```bash
# Build and run with Docker
docker build -t dostalgia .
docker run -p 8765:8765 -v $(pwd)/data:/data dostalgia
```
## Development
Open http://localhost:8765
Terminal 1 — Go API:
```bash
DOSTALGIA_DEV=1 go run .
```
## Development (without Docker)
Terminal 2 — Frontend dev server:
Terminal 1 — Frontend dev server:
```bash
cd frontend && npm install && npm run dev
```
Open http://localhost:5173
Terminal 2 — Quarkus dev server:
```bash
mvn quarkus:dev
```
Open http://localhost:5173 (Vite proxies API calls to Quarkus on port 8765)
### Production build (local)
```bash
cd frontend && npm install && npm run build
mvn package -DskipTests
java -jar target/quarkus-app/quarkus-run.jar
```
## Architecture
- **Backend**: Single Go binary. No database — each game is a directory with a `game.json` file.
- **Frontend**: Svelte SPA, embedded in the Go binary at build time.
- **Emulation**: js-dos v8 loaded from CDN, runs DOSBox in WebAssembly.
- **Storage**: `/data/games/{id}/` — contains `game.json`, `.jsdos` bundle, and cover art.
- **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
@@ -51,8 +61,6 @@ Open http://localhost:5173
"year": 1993,
"genre": "FPS",
"developer": "id Software",
"publisher": "id Software",
"description": "The iconic first-person shooter...",
"bundle_type": "standard",
"bundle_file": "doom.jsdos",
"has_cover": true,