feat: add SQLite support, setup wizard enhancements, and live dashboard

Add zero-dependency SQLite mode so users can run Erupe without
PostgreSQL. A transparent db.DB wrapper auto-translates PostgreSQL
SQL ($N placeholders, now(), ::casts, ILIKE, public. prefix,
TRUNCATE) for SQLite at runtime — all 28 repo files use the wrapper
with no per-query changes needed.

Setup wizard gains two new steps: quest file detection with download
link, and gameplay presets (solo/small/community/rebalanced). The API
server gets a /dashboard endpoint with auto-refreshing stats.

CI release workflow now builds and pushes Docker images to GHCR
alongside binary artifacts on tag push.

Key changes:
- common/db: DB/Tx wrapper with 6 SQL translation rules
- server/migrations/sqlite: full SQLite schema (0001-0005)
- config: Database.Driver field ("postgres" or "sqlite")
- main.go: SQLite connection with WAL mode, single writer
- server/setup: quest check + preset selection steps
- server/api: /dashboard with live stats
- .github/workflows: Docker in release, deduplicate docker.yml
This commit is contained in:
Houmgaor
2026-03-05 18:00:30 +01:00
parent 03adb21e99
commit ecfe58ffb4
86 changed files with 2326 additions and 356 deletions

View File

@@ -6,6 +6,7 @@ import (
"testing"
"time"
dbutil "erupe-ce/common/db"
"erupe-ce/common/mhfitem"
cfg "erupe-ce/config"
"erupe-ce/network/clientctx"
@@ -597,18 +598,19 @@ func createTestServerWithDB(t *testing.T, db *sqlx.DB) *Server {
server.logger = logger
// Initialize repositories
server.charRepo = NewCharacterRepository(db)
server.guildRepo = NewGuildRepository(db)
server.userRepo = NewUserRepository(db)
server.gachaRepo = NewGachaRepository(db)
server.houseRepo = NewHouseRepository(db)
server.festaRepo = NewFestaRepository(db)
server.towerRepo = NewTowerRepository(db)
server.rengokuRepo = NewRengokuRepository(db)
server.mailRepo = NewMailRepository(db)
server.stampRepo = NewStampRepository(db)
server.distRepo = NewDistributionRepository(db)
server.sessionRepo = NewSessionRepository(db)
wdb := dbutil.Wrap(db)
server.charRepo = NewCharacterRepository(wdb)
server.guildRepo = NewGuildRepository(wdb)
server.userRepo = NewUserRepository(wdb)
server.gachaRepo = NewGachaRepository(wdb)
server.houseRepo = NewHouseRepository(wdb)
server.festaRepo = NewFestaRepository(wdb)
server.towerRepo = NewTowerRepository(wdb)
server.rengokuRepo = NewRengokuRepository(wdb)
server.mailRepo = NewMailRepository(wdb)
server.stampRepo = NewStampRepository(wdb)
server.distRepo = NewDistributionRepository(wdb)
server.sessionRepo = NewSessionRepository(wdb)
return server
}