Commit graph

48 commits

Author SHA1 Message Date
lila
927ec14e2d ci: add Forgejo Actions workflow for build and deploy
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 5s
2026-04-14 18:20:05 +02:00
lila
0c87b70a4a adding deployment documentation 2026-04-14 17:43:40 +02:00
lila
bc38137a12 feat: add production deployment config
- Add docker-compose.prod.yml and Caddyfile for Caddy reverse proxy
- Add production stages to frontend Dockerfile (nginx for static files)
- Fix monorepo package exports for production builds (dist/src paths)
- Add CORS_ORIGIN env var for cross-origin config
- Add Better Auth baseURL, cookie domain, and trusted origins from env
- Use VITE_API_URL for API calls in auth-client and play route
- Add credentials: include for cross-origin fetch requests
- Remove unused users table from schema
2026-04-14 11:38:40 +02:00
lila
3f7bc4111e chore: rename project from glossa to lila
- Update all package names from @glossa/* to @lila/*
- Update all imports, container names, volume names
- Update documentation references
- Recreate database with new credentials
2026-04-13 10:00:52 +02:00
lila
1699f78f0b updating current state, phase 3 is done 2026-04-12 13:41:09 +02:00
lila
a3685a9e68 feat(api): add auth middleware to protect game endpoints
- Add requireAuth middleware using Better Auth session validation
- Apply to all game routes (start, answer)
- Unauthenticated requests return 401
2026-04-12 13:38:32 +02:00
lila
91a3112d8b feat(api): integrate Better Auth with Drizzle adapter and social providers
- Add Better Auth config with Google + GitHub social providers
- Mount auth handler on /api/auth/* in Express
- Generate and migrate auth tables (user, session, account, verification)
- Deduplicate term_glosses data for tighter unique constraint
- Drop legacy users table
2026-04-12 11:46:38 +02:00
lila
cbe638b1af docs: update auth references from OpenAuth to Better Auth 2026-04-12 10:18:16 +02:00
lila
2058d0d542 updating docs 2026-04-12 09:35:14 +02:00
lila
047196c973 updating documentation, formatting 2026-04-12 09:28:35 +02:00
lila
e320f43d8e test(api): add unit and integration tests for game service and endpoints
- Unit tests for createGameSession and evaluateAnswer (14 tests)
- Endpoint tests for POST /game/start and /game/answer via supertest (8 tests)
- Mock @glossa/db — no real database dependency
2026-04-12 09:04:41 +02:00
lila
48457936e8 feat(api): add global error handler with typed error classes
- Add AppError base class, ValidationError (400), NotFoundError (404)
- Add central error middleware in app.ts
- Remove inline safeParse error handling from controllers
- Replace plain Error throws with NotFoundError in gameService
2026-04-12 08:48:43 +02:00
lila
dd6c2b0118 updating documentation 2026-04-11 21:32:13 +02:00
lila
ea33b7fcc8 feat(web): add minimal playable quiz at /play
- Add Vite proxy for /api → localhost:3000 (no CORS needed in dev)
- Create /play route with hardcoded game settings (en→it, nouns, easy)
- Three-phase state machine: loading → playing → finished
- Show prompt, optional gloss, and 4 answer buttons per question
- Submit answers to /api/v1/game/answer, show correct/wrong feedback
- Manual Next button to advance after answering
- Score screen on completion
- Add selectedOptionId to AnswerResult schema (discovered during
  frontend work that the result needs to be self-contained for
  rendering feedback without separate client state)

Intentionally unstyled — component extraction and polish come next.
2026-04-11 12:56:03 +02:00
lila
2bcf9d7a97 formatting 2026-04-10 20:20:09 +02:00
lila
b3b32167c9 formatting 2026-04-10 20:09:46 +02:00
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
0cb9fe1485 adding datafiles + updating documentation 2026-04-07 00:00:58 +02:00
lila
60cf48ef97 updating documentation 2026-04-06 17:01:34 +02:00
lila
c49c2fe2c3 updating docs 2026-04-05 19:28:53 +02:00
lila
e80f291c41 refactoring data model 2026-04-05 18:57:09 +02:00
lila
bfc09180f1 updating documentation 2026-04-05 01:21:18 +02:00
lila
c24967dc74 updating docs 2026-04-05 00:33:05 +02:00
lila
874dd5e4c7 adding documentation and roadmap for the most minimal mvp 2026-04-02 18:28:44 +02:00
lila
cdedbc44cd refactoring 2026-04-02 13:37:54 +02:00
lila
b0c0baf9ab updating documentation 2026-04-01 18:02:12 +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
a49bce4a5a adding tasks 2026-04-01 01:22:21 +02:00
lila
9d1a82bdf0 reviewing and updating deck generation 2026-03-31 16:48:40 +02:00
lila
e3a2136720 formatting 2026-03-31 10:06:06 +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
be7a7903c5 refactor: migrate to deck-based vocabulary curation
Database Schema:
- Add decks table for curated word lists (A1, Most Common, etc.)
- Add deck_terms join table with position ordering
- Link rooms to decks via rooms.deck_id FK
- Remove frequency_rank from terms (now deck-scoped)
- Change users.id to uuid, add openauth_sub for auth mapping
- Add room_players.left_at for disconnect tracking
- Add rooms.updated_at for stale room recovery
- Add CHECK constraints for data integrity (pos, status, etc.)

Extraction Script:
- Rewrite extract.py to mirror complete OMW dataset
- Extract all 25,204 bilingual noun synsets (en-it)
- Remove frequency filtering and block lists
- Output all lemmas per synset for full synonym support
- Seed data now uncurated; decks handle selection

Architecture:
- Separate concerns: raw OMW data in DB, curation in decks
- Enables user-created decks and multiple difficulty levels
- Rooms select vocabulary by choosing a deck
2026-03-27 16:53:26 +01:00
lila
e9e750da3e setting up python env, download word data 2026-03-26 11:41:46 +01:00
lila
a4a14828e8 no isPrimary 2026-03-26 10:11:25 +01:00
lila
c1b90b9643 chore: complete phase 0 - update decisions.md and mark phase complete 2026-03-26 09:51:03 +01:00
lila
5561d54a24 feat(infra): add docker-compose and dockerfiles for all services 2026-03-26 09:43:39 +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
9ebbf83f93 formatting 2026-03-21 19:33:07 +01:00
lila
2025cc7298 chore: configure root eslint with react and tanstack router rules 2026-03-21 19:32:38 +01:00
lila
88ad6ff276 updating documentaion 2026-03-21 12:10:59 +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
22bb8a1e4c chore: configure eslint with typescript and prettier integration 2026-03-20 14:18:18 +01:00
lila
66848f282f chore: initialise pnpm workspace monorepo 2026-03-20 10:00:21 +01:00
lila
94f02b9904 adding documentation 2026-03-20 09:21:06 +01:00