- π€ AI Flashcard Generation β Powered by NVIDIA AI for text + Pollinations for save-time mnemonic images
- π§ Spaced Repetition System (SRS) β Hybrid SM-2 + Leitner algorithm for optimal memory retention
- ποΈ Vocabulary Islands β Learn words in contextual topics (cooking, politics, tech, etc.)
- π Smart Analytics β Track your learning progress, streaks, and mastered words
- π OAuth Authentication β Secure login via W9 Labs unified auth system
- π¨ Modern UI β 2026 trending color palette with 8-bit voxel arcade elements
- Backend: Rust 1.94 + Axum 0.7 + tokio
- Database: PostgreSQL 16 (shared with W9 Labs ecosystem)
- AI: NVIDIA API for text generation + Pollinations for image generation
- Authentication: OAuth 2.0 via w9-db
- Deployment: Docker + Docker Compose + Caddy reverse proxy
- Frontend: Server-rendered HTML + vanilla JavaScript
# Clone the repository
git clone https://github.com/w9labs/vocai.git
cd vocai
# Copy environment file
cp .env.example .env
# Start PostgreSQL (or use existing w9-postgres)
# Create database: CREATE DATABASE w9_vocabai;
# Run the server
cd server
cargo rundocker compose up -dvocai/
βββ server/
β βββ Cargo.toml # Rust dependencies
β βββ src/
β βββ main.rs # Application entry point
β βββ db.rs # Database connection & migrations
β βββ models.rs # Data models
β βββ handlers/ # Route handlers
β β βββ mod.rs
β β βββ auth.rs # OAuth authentication
β β βββ flashcards.rs # Flashcard CRUD & generation
β β βββ islands.rs # Vocabulary islands
β β βββ review.rs # SRS review sessions
β βββ nvidia.rs # NVIDIA AI integration
β βββ srs.rs # Spaced repetition algorithms
β βββ auth.rs # OAuth callback & login
β βββ session.rs # Session management
βββ public/
β βββ assets/
β βββ css/vocai.css # 2026 color palette + voxel theme
β βββ js/vocai.js # Frontend interactions
βββ Dockerfile # Multi-stage Docker build
βββ docker-compose.yml # Docker Compose config
βββ .env.example # Environment template
Vocai uses a hybrid SRS combining:
- SM-2 Algorithm (SuperMemo) β Calculates optimal review intervals based on recall quality
- Leitner System β Moves mastered words to less frequent review boxes
| Rating | Meaning | Interval Effect |
|---|---|---|
| 0 | Complete blackout | Reset to 1m |
| 1 | Incorrect response | Reset to 1m |
| 2 | Correct recalled, hard | Short interval |
| 3 | Correct recalled, difficult | Normal interval |
| 4 | Perfect response | Extended interval |
| 5 | Perfect + trivial | Maximum interval |
| Box | Review Interval | Description |
|---|---|---|
| 1 | Every day | New/difficult words |
| 2 | Every 3 days | Learning words |
| 3 | Every 7 days | Familiar words |
| 4 | Every 14 days | Well-known words |
| 5 | Every 30 days | Mastered words |
Vocai deploys to the W9 Labs VPS alongside other services:
# SSH to server
ssh -p 22001 root@ffm.w9.nu
# Navigate to deployment directory
cd /opt/w9-labs
# Pull latest and redeploy
docker compose pull vocai && docker compose up -d vocaiAdd to /etc/caddy/Caddyfile:
vocai.top {
reverse_proxy vocai:3010
}For static frontend:
wrangler pages deploy public --project-name=vocaiusersβ User accounts (synced with w9-db OAuth)vocabulary_islandsβ Topic-based word collectionsflashcardsβ Individual vocabulary cards, image prompts, and Pollinations image URLssrs_reviewsβ Spaced repetition progressstudy_sessionsβ Review historyuser_statsβ Aggregated learning statistics
Vocai uses the W9 Labs unified OAuth 2.0 system:
- User clicks "Login with W9" on
vocai.top - Redirect to
db.w9.nu/oauth/authorize - User authenticates via w9-db
- Callback to
vocai.top/auth/callbackwith auth code - Exchange code for token via
/oauth/token - Session created, user redirected to dashboard
- The text model generates flashcards and an
image_promptfor each card. - Pollinations renders the image only when the user saves a card.
- Vocai stores the returned image URL plus prompt/model metadata in PostgreSQL.
- If image generation fails, the flashcard still saves so study flow is never blocked.
- Primary: Electric Indigo (#6366F1)
- Secondary: Neo Mint (#A7F3D0)
- Accent: Digital Lavender (#E9D5FF)
- Background: Deep Space (#0F172A)
- Success: Cyber Green (#22D3EE)
- Warning: Solar Orange (#FB923C)
- Error: Crimson Glitch (#F43F5E)
- Headings: Space Grotesk (geometric, modern)
- Body: Inter (clean, readable)
- Code/Accent: JetBrains Mono (technical)
MIT License β see LICENSE for details.
Contributions welcome! Please read our Contributing Guide first.
Part of the W9 Network ecosystem. Learn more at w9.nu