**enyalien** is a historical browser and dataset builder for the ChGK A-rating.
  • Clojure 89.6%
  • Python 8.3%
  • CSS 2%
  • JavaScript 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-08 16:24:51 +02:00
.clj-kondo Generate ticket 01 2026-09-29 00:44:09 +02:00
docs Gen: ticket 12 2026-10-08 16:09:03 +02:00
resources Add favicon 2026-10-08 12:34:57 +02:00
scripts Gen: ticket 12 2026-10-08 16:09:03 +02:00
src Fix: links to ChGK docs 2026-10-08 16:24:51 +02:00
test Fix: links to ChGK docs 2026-10-08 16:24:51 +02:00
.gitignore Infra: ignore generated DB 2026-10-08 12:35:49 +02:00
AGENTS.md Small note about Clojure 2026-10-03 17:06:12 +02:00
bb.edn Gen: ticket 12 2026-10-08 16:09:03 +02:00
build.clj Gen: ticket 11 2026-10-08 14:11:40 +02:00
CHANGELOG.md Gen: fix 18 2026-10-08 10:03:54 +02:00
deps.edn Deps: hiccup2 2026-10-03 16:17:34 +02:00
LICENSE Initial commit with docs and project stub 2026-09-29 00:36:05 +02:00
README.md Gen: ticket 12 2026-10-08 16:09:03 +02:00

enyalien

enyalien is a historical browser and dataset builder for the ChGK A-rating.

It preserves authoritative historical rating releases, enriches their surrounding domain data from the documented ChGK API, materializes an immutable SQLite snapshot, and serves read-only JSON and HTML views.

Name

The name enyalien is based on Quenya enyalië, “memory, (lit.) recalling”, and its dative enyalien, “in memory [of]” / “for the re-calling, to recall or commemorate [the glory]”.

The cited references are Unfinished Tales (UT/305, UT/317). The documented elements are #enyal- “to recall”, -ië “gerund suffix, -ing”, en- “re-, again”, and yal- “to summon”.

The attested example is:

vanda sina termaruva Elenna-nóreo alcar enyalien — “This oath shall stand in memory of the glory of the Land of the Star”.

The software name changes to enyalien, but the application's domain terminology remains unchanged: rating, release, team, player, tournament, base roster, tournament roster, and so on.

Development

The project uses Clojure on Java 21+ and Babashka for project tasks.

bb lint
bb test
bb test:conv
bb test:docs
bb conv /path/to/output.sqlite /path/to/source.sql
bb fetch --source /path/to/source.sqlite --cache-dir target/enyalien-cache
bb build-database --source /path/to/source.sqlite --cache-dir target/enyalien-cache --output target/rating-a.sqlite
bb docs:api
bb server
bb uber

The initial uberjar is written to:

target/enyalien.jar

The runtime and collector are deliberately separate: runtime namespaces live under src/enyalien, while acquisition/materialization tooling lives under src/collector.

Documentation

See docs/spec.md for the normative specification, docs/mysql-dump-conversion.md for the MySQL-to-SQLite conversion workflow, and docs/tickets/00-milestones.md for the implementation roadmap.

Data workflow

The complete data workflow has three distinct stages:

  1. bb conv OUTPUT.sqlite DUMP.sql... converts one or more MySQL dumps into the authoritative SQLite source dataset.
  2. bb fetch --source SOURCE.sqlite --cache-dir CACHE recursively acquires the external API data into a resumable cache. --until DATE bounds historical acquisition and --refresh permits refetching cached resources.
  3. bb build-database --source SOURCE.sqlite --cache-dir CACHE --output DATASET.sqlite materializes a new immutable runtime snapshot from the source dataset and cache.

The runtime can then be started with bb server. The packaged distribution is built with bb uber. The bb ci task runs linting, Clojure tests, conversion tests, documentation checks, packaging, and the clean-distribution smoke test.

Babashka passes task arguments directly to the task; this project does not use -- as a separator between Babashka arguments and task arguments.

Collector API client

A single resource can be fetched or repaired with:

bb fetch --type teams --id 1
bb fetch --type tournaments --id 123 --refresh

The recursive collector is implemented in collector.core:

bb fetch --source SOURCE.sqlite --cache-dir target/enyalien-cache

It is sequential and resumable, and discovers typed API identities recursively from the authoritative source tables. If the external API requires authentication, set ENYALIEN_API_TOKEN; it is sent as a Bearer token.

Documentation generation

The runtime API contract is executable Malli data in src/enyalien/api_schema.clj. Generate its checked-in contract reference with:

bb docs:api

bb test:docs verifies that the generated page is synchronized with the source contract.