a chat client for gamecode AI tool suite in rust and webassembly
- Rust 84.5%
- HTML 13.5%
- Just 1.5%
- Dockerfile 0.5%
- Parses both content and thinking deltas (both default-friendly so the deserializer never breaks on missing fields). - Tracks in_thinking state across chunks; emits <think> on the first thinking delta, closes with </think> when content arrives or the stream ends. - Runs stop-pattern detection only over real content, so reasoning text can mention "the user" without false-tripping. - Skips empty non-terminal chunks so the SSE channel only carries real events. |
||
|---|---|---|
| .forgejo/workflows | ||
| client | ||
| config | ||
| dist | ||
| docs | ||
| server | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| justfile | ||
| README.md | ||
| rust-toolchain.toml | ||
GameCode Web
A secure web chat interface for AI models, starting with local Ollama integration.
Architecture
- Frontend: Rust/Leptos WebAssembly app
- Backend: Rust/Axum server with provider abstraction
- Security: Password protection with JWT sessions
Quick Start
1. Start Ollama with your model
ollama run fortean
2. Build and run the server
cd server
cargo run --release
Configuration
Edit config/default.toml:
- Change the password hash (default password is "gamecode")
- Update JWT secret
- Configure Ollama models
Development
Server
cd server
cargo watch -x run
Client (coming next)
cd client
trunk serve
CI parity
The justfile is the single source of truth for build/test/lint; GitHub
Actions calls the same recipes. Before pushing, run:
just ci
just ci runs, in order: fmt-check (rustfmt), lint (clippy with
-D warnings on server + wasm client), test (server tests), and build
(server via cargo, client via trunk). The Rust toolchain is pinned to
1.93.0 in rust-toolchain.toml and in every .github/workflows/ci-*.yml —
both must agree.
Security Notes
- Change the default password in production
- Use a strong JWT secret
- Enable ngrok authentication for additional security
- Monitor ngrok dashboard for abuse
Future Providers
The architecture supports adding:
- AWS Bedrock
- OpenAI API
- Local models via candle
- MCP tool integration