Every dictionary entry now has a version: 16 hex digits of the SHA-256 of what cards take of it (headword, reading, entry), made by the loader and carried on every hit. A card keeps the version it took (card schema 8). DictionaryEndpoint.changed returns, of the entries named with the versions cards keep (1,000 at most a call; the app asks 500 at a time), those whose version is another now. The card browser says how many cards are behind their dictionary and takes the corrections at a tap (decided 2026-10-09: by offer, never by themselves). Taking one writes the entry as it is now over the revision in which the card last took it, beside whatever came after, so the revisions merge per side as two devices' edits do (ADR 0003): a side only the dictionary changed takes the correction, a side the person changed too is a conflict settled in the composer, whose words now name that case. Cards made before versions are never offered one. The server rereads its dictionary folder hourly now, not daily: the dictionaries service fills its volume after an instance's first start, and an hour with nothing changed costs a hash of each file. Migration 20261009145434785-dictionary-entry-version: adds dictionary_entry.version, text NOT NULL DEFAULT '' (rows loaded before have none and are never reported as corrected), and by hand empties dictionary_source."fileHash", so every source loads once more and its entries get their versions; the schema stays as definition.sql says. The old server goes on working until the switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2.2 KiB
halkyon_learn_server
This is the starting point for your Serverpod server.
Start your server by running:
cd halkyon_learn
serverpod start
When you are finished, you can shut down the running server with Q.
Dictionaries
The dictionaries people look words up in (JMdict, …) are reference data the
server holds for everyone. They come as dictionary files, which
halkyon_learn_curator makes from the sources' downloads (its README says how).
At every start, and every hour at seven past, the server loads the files in
its dictionaries folder that changed since they were last loaded (by their
SHA-256): in the background, a source at a time, and all at once, so searches
meanwhile still find the old entries. A file it can't read is logged and left
out. DICTIONARIES_DIR names another folder.
EDRDG's licence asks a server showing its dictionaries to update them at least once a month:
- An instance keeps them current by itself: the
dictionariesservice indeploy/compose.yaml(the curator, in a container of its own) downloads EDRDG's files of the day once its files are a week old, converts them, and replaces them in a volume the server reads (curate update, the curator's README); the server takes them up within the hour. To supply files yourself instead, remove the service and mountdeploy/dictionaries/into the server (compose.yamlsays how), and update them monthly. - Development:
dart run halkyon_learn_curator:curate update --into ../halkyon_learn_server/dictionariesin the curator's folder (about a minute); the server takes them up within the hour.
JMdict in English, with the JLPT levels and Tatoeba's example sentences, is
about 20 MB gzipped and takes the server half a minute to load (219,000
entries). KANJIDIC2 in English, with the JLPT levels of the kanji and the kana,
is a dictionary of characters beside it (kanjidic-en.jsonl.gz, 0.7 MB,
12,800 entries): the app's Kanji & kana tab. Their licences (CC BY-SA 4.0;
CC BY 2.0 FR for the sentences; CC BY for the JLPT lists) ask for attribution:
the app lists the credits each file carries.
Licence
Copyright (C) 2026 The Halkyon Learn contributors
Licensed under the Server Side Public License, version 1 (SSPL-1.0); the full text
is in LICENSE.