This is a TypeScript monorepo that provides a minimal, deterministic language-learning engine and a Next.js web UI that consumes it. The engine core lives in packages/core/src/engine.ts, German rules/evaluators live in packages/plugin-de/src/rules.ts and packages/plugin-de/src/evaluators.ts, and the UI flow is implemented in apps/web/src/app/page.tsx with integration glue in apps/web/src/lib/appEngine.ts. It does not include a backend service, database, or deployment setup; all persistence is currently in browser localStorage via adapters in apps/web/src/lib/appEngine.ts.
Unknown. The repository does not include a documented problem statement or intended users. A product brief or architecture decision record would normally state this (no such file exists in the repo).
Prerequisites:
- Node.js and npm. Version requirements are Unknown because no
enginesfield is defined inpackage.jsonorapps/web/package.json.
Commands (from repo root):
npm install
npm run devBuild:
npm run buildLint (only quality script currently present):
npm run lintTests:
- Unknown. There is no test script in
package.jsonorapps/web/package.json.
Troubleshooting:
- Install dependencies from the repo root so the
file:workspace dependencies inapps/web/package.jsonresolve correctly.
flowchart LR
UI["Next.js UI / (apps/web/src/app/page.tsx)"] --> AppEngine["App engine adapter (apps/web/src/lib/appEngine.ts)"]
AppEngine --> Core["Engine core (packages/core/src/engine.ts)"]
AppEngine --> Storage["LocalStorage repositories (apps/web/src/lib/appEngine.ts)"]
Core --> Rules["Rule defs + evaluators (packages/plugin-de/src/rules.ts, packages/plugin-de/src/evaluators.ts)"]
Core --> Content["Exercises + vocab (packages/content/src/de/exercises.ts, packages/content/src/de/vocab.ts)"]
The UI calls createAppEngine to build an engine instance, selects the next exercise, submits answers, and then updates localStorage-backed rule state and attempt logs (see apps/web/src/lib/appEngine.ts and packages/core/src/engine.ts). Rule evaluation is deterministic and currently implemented as exact string matching in packages/plugin-de/src/evaluators.ts.
- Web app:
apps/web/src/app/page.tsx(UI route) andapps/web/src/app/globals.css(styling). - Engine integration:
apps/web/src/lib/appEngine.ts(wires engine + repositories + filtering). - Engine core:
packages/core/src/index.ts(types) andpackages/core/src/engine.ts/packages/core/src/strategies.ts(selection + mastery logic). - German plugin:
packages/plugin-de/src/rules.ts(rule list) andpackages/plugin-de/src/evaluators.ts(deterministic evaluators). - Content:
packages/content/src/de/exercises.ts(cloze exercises) andpackages/content/src/de/vocab.ts(vocabulary gating data).
- Engine API:
createEngineplusEngine.selectNextExerciseandEngine.submitAttemptare defined inpackages/core/src/index.tsand implemented inpackages/core/src/engine.ts. - UI route: the Next.js App Router entrypoint is
/atapps/web/src/app/page.tsx. - Local storage outputs: rule state and attempts are stored under keys
le.user.<userId>.rulesandle.user.<userId>.attemptsinapps/web/src/lib/appEngine.ts.
- Engine scheduling and mastery parameters are hardcoded in
apps/web/src/lib/appEngine.ts(min spacing, half-life, increments). - User profile defaults (
userId,level) are hardcoded inapps/web/src/app/page.tsx. - Next.js config is in
apps/web/next.config.ts. - TypeScript configs live in
tsconfig.base.json,tsconfig.json, and per-package configs such asapps/web/tsconfig.json. - Environment variables: Unknown. No
.env*files exist in the repo and noprocess.envusage appears in source files. If env vars are required, they should be documented in a.env*file or in a config module (none present). - Secrets: None configured in code. No secret injection mechanism is present.
Dependencies (evidence in apps/web/package.json unless noted):
- Next.js (
apps/web/package.json). - React and React DOM (
apps/web/package.json). - Tailwind CSS and PostCSS (
apps/web/package.jsonandapps/web/postcss.config.mjs), with Tailwind imported inapps/web/src/app/globals.css. - TypeScript and ESLint (
apps/web/package.jsonandapps/web/eslint.config.mjs).
External services:
- None configured. Persistence is local browser storage only (
apps/web/src/lib/appEngine.ts). No database, queue, or external API references exist in the current codebase.
- Tests: Unknown. No test runner or test scripts are defined in
package.jsonorapps/web/package.json. - Linting:
npm run lintruns ESLint with config inapps/web/eslint.config.mjsand the script inapps/web/package.json. - CI: Unknown. No CI configuration files exist (for example
.github/workflows/*is absent). - Static analysis / security scanning: Unknown. No tooling is configured.
- Latest verification:
npm run lintcompleted with warnings about React Hook dependencies inapps/web/src/app/page.tsxand an unused import inapps/web/src/lib/appEngine.ts.
Status: Clean
Reviewed areas:
README.mdapps/web/README.mdpackage.jsontsconfig.base.jsontsconfig.jsonapps/web/package.jsonapps/web/next.config.tsapps/web/eslint.config.mjsapps/web/postcss.config.mjsapps/web/tsconfig.jsonapps/web/src/app/layout.tsxapps/web/src/app/page.tsxapps/web/src/app/globals.cssapps/web/src/lib/appEngine.tspackages/core/package.jsonpackages/core/tsconfig.jsonpackages/core/src/index.tspackages/core/src/engine.tspackages/core/src/strategies.tspackages/plugin-de/package.jsonpackages/plugin-de/tsconfig.jsonpackages/plugin-de/src/index.tspackages/plugin-de/src/rules.tspackages/plugin-de/src/evaluators.tspackages/content/package.jsonpackages/content/tsconfig.jsonpackages/content/src/index.tspackages/content/src/de/exercises.tspackages/content/src/de/vocab.ts
Findings:
- None.
Actions taken:
- None.
Notes:
- No
.env*files or key/cert files were present in the repo. - Binary assets were not inspected:
apps/web/src/app/favicon.ico,apps/web/public/*.svg.
Documentation:
- P1/M: No product scope or learning design rationale. Next action: add a concise scope section to this README that defines target levels, rule count, and content coverage.
Tests:
- P1/M: No automated tests. Next action: add a test runner (e.g., Vitest or Jest) and unit tests for
packages/core/src/engine.tsandpackages/core/src/strategies.ts.
Security:
- P2/S: No secret scanning or dependency auditing beyond
npm audit. Next action: add a lightweight security check script or CI job.
Reliability:
- P1/M: Persistence is localStorage only with no export/import or migration strategy. Next action: add an export format for attempts and rule state.
Operations:
- P2/S: No deployment or CI configuration. Next action: add a CI workflow under
.github/workflowsto run lint.
Developer experience:
- P2/S: No explicit developer guide beyond this README. Next action: add a small developer workflow section with common tasks and data conventions.
- Demonstrates a deterministic rule-based learning loop with explicit, inspectable state updates (
packages/core/src/engine.ts). - Shows a clean separation between language-agnostic engine logic and language-specific evaluators (
packages/core/src/index.tsandpackages/plugin-de/src/evaluators.ts). - Provides a minimal UI for adaptive cloze exercises that can be extended without changing the engine contract (
apps/web/src/app/page.tsx).
- Project type: TypeScript monorepo with a Next.js web app (
package.json,apps/web/package.json). - Primary domain: deterministic, rule-based language learning engine (
packages/core/src/engine.ts). - Core entities:
RuleDefinition,Exercise,AttemptEvent,UserRuleState(packages/core/src/index.ts). - Extension points: rule evaluators and content modules (
packages/plugin-de/src/evaluators.ts,packages/content/src/de/exercises.ts). - Areas safe to modify: UI layout and styling (
apps/web/src/app/page.tsx,apps/web/src/app/globals.css); content data (packages/content/src/de/*). - Areas requiring caution: engine selection/update logic (
packages/core/src/engine.ts,packages/core/src/strategies.ts) and storage keys inapps/web/src/lib/appEngine.tsbecause they affect determinism and persistence. - Canonical commands:
- Run:
npm run dev(rootpackage.json). - Build:
npm run build(rootpackage.json). - Lint:
npm run lint(rootpackage.json). - Tests: Unknown (no test scripts defined).
- Run: