shared/exposes serde-ready models, dialect enums, and logic reused by backend and frontend crates.backend/contains the Axum WebSocket server plus AI services; keep runtime config like.envand tracing filters at the repo root.frontend/is the Yew + Trunk WASM client (frontend/srcfor components,frontend/staticfor assets).corpus-processor/provides the CLI for processing dialect corpora; raw text lives undercorpus-data/and staged exports undercorpus-downloads/.
cargo build(root) compiles the entire workspace; add--releasebefore publishing artifacts.cargo run -p backendstarts the WebSocket API onhttp://localhost:3000(health probe at/health).cd frontend && trunk servelaunches the development UI athttp://localhost:8080and re-builds on change.cd corpus-processor && cargo run -- process --input corpus-data/spanish_mexican --output processed/es-mx.jsonlprepares data beforecargo run -- upload --input processed/es-mx.jsonlsyncs to Qdrant. The upload (and other Qdrant commands) requireQDRANT_URLin.envor via the--urlflag.
The local Compose overlay selects qwen3.8:27b-q4_K_M for the backend's LLM calls, including OCR. It uses the existing frontend, database, and Docker network. Set model tags in config.ollama.yaml and keep the model files in the Compose volume.
For the 36 GiB Apple Silicon host, allocate 28 GiB to the existing Colima profile. Restarting Colima briefly interrupts its Docker workloads.
colima stop && colima start --memory 28 --cpus 8From the repository root, build the backend image and download the model before starting the application.
docker buildx bake backend
docker compose -f docker-compose.yml -f docker-compose.ollama.yml up -d ollama
docker compose -f docker-compose.yml -f docker-compose.ollama.yml exec ollama ollama pull qwen3.8:27b-q4_K_M
docker compose -f docker-compose.yml -f docker-compose.ollama.yml up -dThe frontend opens at http://localhost:8080. The Ollama container defaults to a 22 GiB memory limit, an 8,192-token context, and a 1 GiB llama.cpp prompt cache. The local OCR channel gives vision requests up to 300 seconds to finish, including model startup. Set request_timeout_seconds on a channel to tune its deadline for the runtime and hardware. The backend reads the existing PostgreSQL, Qdrant, and authentication settings.
- Run
cargo fmtandcargo clippy --all-targets --all-featuresbefore committing; CI expects Rust 2024 defaults and zero warnings. - Files and modules use snake_case (e.g.,
agent_service.rs), public types PascalCase (TeachingMode), and constants SCREAMING_SNAKE_CASE. - Prefer explicit
anyhow::Resultreturns, instrument async paths withtracing, and keep Yew hooks small, composable functions.
cargo testcovers every crate; scope tocargo test -p backendorcargo test -p sharedfor targeted runs.- Integration specs live under
backend/tests/and workspace-level checks such astest_unicode_safety.rs; mirror the{module}_testsnaming style. - Exercise the WebSocket manually with
websocat ws://localhost:3000/wsand the sampleClientEnveloperequest fromDEVELOPER_GUIDE.mdbefore PR submission. Every request, reply and usage push travels over this one connection; a reply carries its request'sid.
- Follow the concise, imperative commit summaries visible in
git log(e.g.,"Document provider support"); wrap detailed explanations in the body when behavior changes. - PRs must link the tracking issue, outline backend/frontend/corpus impact, call out env vars or datasets touched, and include screenshots or console transcripts for UI/CLI changes.
- Verify
cargo fmt,cargo clippy, relevantcargo testtargets, and any trunk builds before requesting review.
- Store all secrets and instance-specific config in a root
.env(gitignored); never commit secrets or corpus exports. - Set
QDRANT_URLandQDRANT_API_KEYfor retrieval. Hosted LLM and TTS credentials depend on the configured services. SeeDEVELOPER_GUIDE.mdfor the full list. docker-compose.ymlreadsPOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBfrom.envfor the local Postgres instance.config.yamlholds only non-sensitive configuration (server bind address, LLM model names, TTS settings, rate limits).- Treat resources inside
corpus-data/andcorpus-downloads/as licensed assets—share only processed outputs and keep raw sources in approved storage. - DO NOT use large blocks or entire files as TargetContent for editing tools. EVen the SLIGHTEST change to newlines and formatting makes it impossible for the user to properly review changes.