A chat application powered by AI with a WebAssembly frontend and Rust backend.
gisty/
├── src/
│ └── main.rs # Rust backend server (Actix-web)
├── frontend/
│ ├── src/
│ │ └── lib.rs # WASM chat interface logic
│ ├── pkg/ # Compiled WASM output
│ ├── index.html # Frontend UI
│ └── Cargo.toml # WASM dependencies
├── Cargo.toml # Backend dependencies
└── .env # API configuration
# Build and run with Docker Compose
docker compose up --build
# Or run in background
docker compose up -d --build
# Open your browser to http://localhost:8080# 1. Build the WASM frontend
./build.sh
# 2. Run the server
cargo run
# 3. Open your browser to http://127.0.0.1:8080-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install wasm-pack:
cargo install wasm-pack
-
Copy the environment template:
cp .env.example .env
-
Edit
.envwith your actual API key:API_KEY=your_actual_api_key_here BASE_URL=https://portal.infotitans.com/v1/chat/completions MODEL=azure/gpt-5
.env file to version control. It's already in .gitignore.
This application is designed to work with chat completion APIs. The default configuration points to Infotitans API with GPT-5, but you can configure it to work with any compatible API:
- Infotitans API: Use the defaults above
- OpenAI Compatible APIs: Set
BASE_URL=https://api.openai.com/v1/chat/completionsand appropriate model - Anthropic Claude: Set
BASE_URL=https://api.anthropic.com/v1/messagesand Claude model - Custom APIs: Configure your
BASE_URLandMODELaccording to your API provider
Note: Different APIs may have different response formats. You may need to modify the JSON parsing logic in src/main.rs to match your API's response structure.
Option 1: Using the build script (recommended)
./build.sh # Builds WASM frontend
cargo run # Starts the serverOption 2: Manual build
cd frontend
wasm-pack build --target web
cd ..
cargo runThen open http://127.0.0.1:8080 in your browser.
- Backend code:
src/main.rs - Frontend WASM:
frontend/src/lib.rs - Frontend UI:
frontend/index.html
After making changes to frontend/src/lib.rs:
cd frontend && wasm-pack build --target web && cd ..Then restart the server to see changes.
# Using Docker Compose
docker compose up -d
# Using Docker directly
docker build -t gisty .
docker run -p 8080:8080 -e API_KEY=your_key gistySee docs/docker-guide.md for detailed Docker documentation.
For production deployment without Docker:
- Build WASM with optimizations:
cd frontend && wasm-pack build --target web --release && cd .. - Build backend with optimizations:
cargo build --release - Run:
./target/release/gisty
docker build -t gisty:latest .
docker run -d -p 8080:8080 \
--name gisty \
--restart always \
-e API_KEY=your_api_key \
gisty:latest- Beginner's Guide - Complete codebase explanation for Rust beginners
- Docker Guide - Comprehensive Docker deployment guide