Commit graph

39 commits

Author SHA1 Message Date
lila
b59fac493d feat(api): implement game terms query with double join
- Add double join on translations for source/target languages
- Left join term_glosses for optional source-language glosses
- Filter difficulty on target side only (intentionally asymmetric:
  a word's difficulty can differ between languages, and what matters
  is the difficulty of the word being learned)
- Return neutral field names (sourceText, targetText, sourceGloss)
  instead of quiz semantics; service layer maps to prompt/answer
- Tighten term_glosses unique constraint to (term_id, language_code)
  to prevent the left join from multiplying question rows
- Add TODO for ORDER BY RANDOM() scaling post-MVP
2026-04-10 18:02:03 +02:00
lila
9fc3ba375a feat: scaffold quiz API vertical slice
- Add GameRequestSchema and derived types to packages/shared
- Add SupportedLanguageCode, SupportedPos, DifficultyLevel type exports
- Add getGameTerms() model to packages/db with pos/language/difficulty/limit filters
- Add prepareGameQuestions() service skeleton in apps/api
- Add createGame controller with Zod safeParse validation
- Wire POST /api/v1/game/start route
- Add scripts/gametest/test-game.ts for manual end-to-end testing
2026-04-09 13:47:01 +02:00
lila
13cc709b09 adding script to check cefr coverage between json files and database, adding script to write cefr levels from json to db 2026-04-09 10:25:20 +02:00
lila
3596f76492 extraction datafiles with cefr annotations 2026-04-08 13:09:47 +02:00
lila
e79fa6922b updating schema 2026-04-07 01:03:22 +02:00
lila
0cb9fe1485 adding datafiles + updating documentation 2026-04-07 00:00:58 +02:00
lila
570dbff25e updating seeding script 2026-04-06 17:01:17 +02:00
lila
6cb0068d1a adding datafiles for all english and italian nousn and verbs 2026-04-05 19:35:52 +02:00
lila
2a8630660e generating and migrating new schema 2026-04-05 19:30:05 +02:00
lila
dfeb6a4cb0 updating seeding pipeline 2026-04-05 19:29:17 +02:00
lila
e80f291c41 refactoring data model 2026-04-05 18:57:09 +02:00
lila
b16b5db3f7 updating data models 2026-04-05 01:21:32 +02:00
lila
7d80b20390 wip version of the api 2026-04-05 00:33:34 +02:00
lila
1accb10f49 typo 2026-04-04 03:37:58 +02:00
lila
5180ecc864 installing zod + adding zod schemas 2026-04-02 20:02:26 +02:00
lila
a9cbcb719c refactoring schema + generate + migrate 2026-04-02 15:48:48 +02:00
lila
38a62ca3a4 refactoring 2026-04-02 15:48:31 +02:00
lila
cdedbc44cd refactoring 2026-04-02 13:37:54 +02:00
lila
3bb8bfdb39 feat(db): complete deck generation script for top english nouns
- add deck_terms to schema imports
- add addTermsToDeck — diffs source term IDs against existing deck_terms,
  inserts only new ones, returns count of inserted terms
- add updateValidatedLanguages — recalculates and persists validated_languages
  on every run so coverage stays accurate as translation data grows
- wire both functions into main with isNewDeck guard to avoid redundant
  validated_languages update on deck creation
- add final summary report
- fix possible undefined on result[0] in createDeck
- tick off remaining roadmap items
2026-04-01 17:56:31 +02:00
lila
7fdcedd1dd wip 2026-04-01 02:43:55 +02:00
lila
4ef70b3876 updating decks to include source language 2026-04-01 01:03:41 +02:00
lila
5603f15fe3 adding bug description as todo comment 2026-03-31 18:34:23 +02:00
lila
488f0dab11 wip 2026-03-31 18:28:29 +02:00
lila
9d1a82bdf0 reviewing and updating deck generation 2026-03-31 16:48:40 +02:00
lila
521ffe3b6e adding migration script 2026-03-31 10:09:30 +02:00
lila
e3a2136720 formatting 2026-03-31 10:06:06 +02:00
lila
20fa6a9331 adding datafiles and seeding script 2026-03-31 10:05:36 +02:00
lila
2b177aad5b feat(db): add incremental upsert seed script for WordNet vocabulary
Implements packages/db/src/seed.ts — reads all JSON files from
scripts/datafiles/, validates filenames against supported language
codes and POS, and upserts synsets into  and
via onConflictDoNothing. Safe to re-run; produces 0 writes on
a duplicate run.
2026-03-30 15:58:01 +02:00
lila
55885336ba feat(db): add drizzle schema for vocabulary and deck tables
- terms, translations, term_glosses with cascade deletes and pos check constraint
- language_pairs with source/target language check constraints and no-self-pair guard
- users with openauth_sub as identity provider key
- decks and deck_terms with composite PK and position ordering
- indexes on all hot query paths (distractor generation, deck lookups, FK joins)
- SUPPORTED_POS and SUPPORTED_LANGUAGE_CODES as single source of truth in @glossa/shared
2026-03-28 19:02:10 +01:00
lila
2ebf0d0a83 infra: add Docker Compose setup for local development
- Configure PostgreSQL 18 and Valkey 9.1 services
- Create multi-stage Dockerfiles for API and Web apps
- Set up pnpm workspace support in container builds
- Configure hot reload via volume mounts for both services
- Add healthchecks for service orchestration
- Support dev/production stage targets (tsx watch vs compiled)
2026-03-25 18:56:04 +01:00
lila
671d542d2d chore(db): add drizzle migration pipeline with empty schema 2026-03-24 11:04:40 +01:00
lila
a8e247829c feat(db): configure drizzle orm and postgres connection 2026-03-24 10:59:03 +01:00
lila
3faa3d4ffb installing drizzle, confirm working db connection via test script 2026-03-23 09:10:48 +01:00
lila
9ebbf83f93 formatting 2026-03-21 19:33:07 +01:00
lila
1765923cb6 feat: scaffold vite react app and configure web package 2026-03-21 11:59:52 +01:00
lila
04acd4b580 chore: configure vitest with project-based setup and coverage 2026-03-20 19:25:00 +01:00
lila
ce42eb1811 chore: configure prettier with ignore rules and format scripts + running format 2026-03-20 18:37:38 +01:00
lila
3dfb75ea83 chore: configure typescript project references and shared compiler options 2026-03-20 14:01:48 +01:00
lila
66848f282f chore: initialise pnpm workspace monorepo 2026-03-20 10:00:21 +01:00