A small Rust web service that provides randomized EverQuest-related data (zones, instances, classes, races) plus management utilities and a lightweight admin interface. The project uses data/data.sql as the single source of truth for the application's database content and can generate a local SQLite database at data/zones.db on startup.
This README is a modernized, concise reference for developers and operators. If you need more in-depth documentation about specific subsystems (migration system, rating transaction logs, etc.), check the docs/ directory.
- Primary binary:
eq_rng(web server + API) - Test binary:
test_db(database validation) - Default HTTP port: 3000 (the container exposes 3000 and common setups proxy 80/443 → 3000)
- Data source of truth:
data/data.sql - Generated DB file:
data/zones.db(created fromdata/data.sqlon startup) - Admin UI: optional feature compiled in with the
adminCargo feature
- Requirements
- Quick start (local)
- Building
- Running
- API summary
- Data management
- Admin interface
- Testing
- Docker
- Security notes
- Contributing
- Rust toolchain (stable)
- Cargo
- SQLite (for inspecting
data/zones.db) - Docker & docker-compose (optional, for containerized deployment)
- Ensure
data/data.sqlexists in the repository root. - Build and run the server with the admin interface enabled (recommended for local development):
- Use the admin feature:
cargo run --bin eq_rng --features admin
- Use the admin feature:
- Visit the API at
http://localhost:3000/(or usecurlto exercise endpoints).
Note: On first run the app will create data/zones.db from data/data.sql if it cannot find an existing DB.
Recommended build patterns:
- Development (with admin):
cargo build- or
cargo build --features admin(explicit)
- Production (exclude admin):
cargo build --release --no-default-features
- Build only the main app:
cargo build --package eq_rng
The repository includes helper scripts (./build.sh, ./run_tests.sh) to simplify common flows; review them before use.
- Development with admin:
cargo run --bin eq_rng --features admin
- Production (admin disabled):
cargo run --bin eq_rng --no-default-features
- Run the database test tool:
cargo run --bin test_db --package eq_rng_tests
The server listens on port 3000 by default. Typical deployments place an HTTP proxy (nginx, Traefik) in front of the container to serve 80/443.
Below are the primary public endpoints. Use query parameters as documented by the endpoint. Responses are JSON.
GET /random_zone- Filter params:
min_level,max_level,zone_type,expansion,continent,flags(comma-separated)
- Filter params:
GET /random_instance- Filter params:
min_level,max_level,zone_type,expansion,continent,hot_zone
- Filter params:
GET /random_class- Optional param:
race(returns a class compatible with the supplied race)
- Optional param:
GET /random_race- Returns race with optional gender and image meta
GET /version- Returns the running application version
Ratings & notes:
GET /zones/:zone_id/rating— average rating for a zonePOST /zones/:zone_id/rating— submit a rating (logged to transaction log)GET /zones/:zone_id/ratings— all ratingsDELETE /api/ratings/:id— remove a rating (admin)GET /zones/:zone_id/notes,GET /instances/:instance_id/notes— notes APIs
Links API:
GET /api/linksGET /api/links/by-categoryGET /api/links/categoriesPOST /api/links,PUT /api/links/:id,DELETE /api/links/:id
This README aims to give a high-level index — consult the source code for exact parameter names and response shapes.
Primary data strategy:
data/data.sqlis the canonical source of truth for the application's content.- On startup the application checks
data/data.sqland, if the SQL file is newer than the last applied migration, will recreate the database from it and record a migration timestamp in themigrationstable. - The generated SQLite DB lives at
data/zones.db(do not check generated DBs into version control).
Benefits:
- Human-reviewable diffs in PRs
- Atomic application of data changes
- Simple rollback via VCS
Workflow to update data:
- Make changes via admin UI or by editing
data/data.sqldirectly. - If using admin UI, use the "Dump Database" feature to produce
data/data-YYYYMMDD_HHMMSS.sql. - Replace
data/data.sqlwith the new dump and commit.
If you edit data/data.sql manually, restart the app to trigger a reload.
The project uses a file-based rating transaction log to preserve user-submitted rating changes between deployments. Key points:
- Location:
data/rating_transaction.log(or timestamped exports inbackups/) - Format: SQL statements (INSERT/UPDATE/DELETE) that can be applied to the DB
- Management utilities are provided under
utils/to extract and apply logs - No public API exists to retrieve or apply the transaction log; it is operated via file-level tooling for safety
Follow the utils/ scripts when deploying to ensure rating continuity.
- The admin interface is an optional feature controlled by the Cargo
adminfeature flag. - When compiled out (production build), admin routes are excluded from the binary entirely.
- Admin features include:
- Zone/instance management
- Ratings and notes management
- Link category management
- Database dump (exports to
data/data-YYYYMMDD_HHMMSS.sql)
- Important: The admin UI intentionally has no authentication in the project. Only enable it in trusted environments (local/dev). For production, compile without the admin feature.
- Use the included test utilities:
./run_tests.shsupportsdb,build, andallsuites. - Or run the test binary:
cargo run --bin test_db --package eq_rng_tests
- Tests focus on:
- Database schema and content validation
- Read-only integrity checks
- Build validations for crates in the workspace
See tests/README.md for more details about test cases and expected environment.
Two primary workflows are supported:
- Production image (admin disabled):
./build.sh production(builds optimized image without admin)docker-compose up -dto run
- Development image (admin enabled):
./build.sh developmentdocker-compose -f docker-compose.dev.yml up -d
Before deploying:
- Extract
data/rating_transaction.logif you need to preserve live user ratings between releases. - Ensure
data/data.sqlin the image is the intended content.
A minimal deployment checklist:
- Review
data/data.sql - Build a production image (no admin)
- Extract and preserve rating transaction log prior to update
- Start new container and apply transaction log if needed
- Do not enable the admin feature in production images — it contains management routes that are intentionally unauthenticated.
- Treat
data/data.sqlas source code: review in PRs and audit changes. - The rating transaction log is file-based for portability; protect file access and backups as you would any sensitive data.
- Keep third-party dependencies up to date and monitor for security advisories.
src/— main application code (API handlers, DB setup)data/—data.sql,zones.db(generated), transaction logs, JSON helpers likeclass_race.jsondist/— optional frontend build artefacts (a simple test frontend is included)utils/— deployment and transaction log helper scriptstests/— test crates and validation toolingCargo.toml— workspace configuration
- Make all data edits via
data/data.sqlwhere possible so diffs are reviewable. - If you need to add or modify endpoints, add unit tests and update documentation.
- Open a PR against the
mainbranch with a clear description of changes and any migration steps.
This project does not include a license file in this README. Please consult the repository root for licensing information or ask the project owner.
If you'd like, I can:
- Add a short example
curlusage section for each endpoint (as inline commands), - Create a
DEVELOPMENT.mdorCONTRIBUTING.mdwith step-by-step contributor guidance, - Or update any specific section to reflect recent changes in the codebase you want highlighted.
Tell me which you'd prefer and I'll update the README accordingly.