28ea711b24
- 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
70 lines
1.7 KiB
Markdown
70 lines
1.7 KiB
Markdown
# Dostalgia — Quarkus Edition
|
|
|
|
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
|
|
|
|
```bash
|
|
# 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:
|
|
```bash
|
|
cd frontend && npm install && npm run dev
|
|
```
|
|
|
|
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**: 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
|
|
|
|
```json
|
|
{
|
|
"id": "doom",
|
|
"title": "Doom",
|
|
"year": 1993,
|
|
"genre": "FPS",
|
|
"developer": "id Software",
|
|
"bundle_type": "standard",
|
|
"bundle_file": "doom.jsdos",
|
|
"has_cover": true,
|
|
"ready": true
|
|
}
|
|
```
|