Example Templates

Rakiba includes five example templates that demonstrate different capabilities and use cases. Use --example when initializing to scaffold a complete working application.

Quick Comparison

ExampleFrontendDatabaseAuthKey Feature
FinanceUIxPostgreSQLEmail + GoogleFull-stack auth, AI assistant
ChatUIx/Re-frame/FulcroNoneNoneWebSocket streaming, Ollama
Image GalleryUIxIn-memoryNoneCLIP embeddings, semantic search
TodoUIx/Re-frame/FulcroNoneNoneFramework comparison
Auth Re-frameRe-frameN/AMagic linkReference implementation

Finance Tracker

A full-featured personal finance application demonstrating authentication, database integration, caching, and AI-powered features.

bb init my-finance --example finance
cd projects/my-finance

# Start managed services
docker compose up -d

# Start development
bb clj && bb cljs && bb sass

Features

  • Multi-provider Authentication - Email/password with verification + Google OAuth
  • Transaction Management - Create, edit, delete with full audit history
  • Account Tracking - Multiple accounts with balance tracking
  • Category System - Organize transactions with customizable categories
  • Dashboard - Real-time summary with cached aggregations
  • Clippy Assistant - AI-powered contextual tips (requires Ollama)

Configuration

{:state-management :mount
 :server :http-kit
 :frontend :uix
 :database [:sql]                    ; PostgreSQL
 :auth [:email-password :google]     ; Multi-provider auth
 :cache [:valkey]                    ; Session storage
 :ai-providers [:ollama]             ; Clippy assistant
 :ai-models ["gemma3:1b"]}

Best For

Learn authentication flows, database integration, caching patterns, and building real-world applications with Rakiba.

Chat Application

AI chat with real-time streaming responses via WebSockets. Demonstrates Ollama integration with model selection.

bb init my-chat --example chat
cd projects/my-chat

# Ensure Ollama is running with a model
ollama pull gemma3:1b

# Start development
bb clj && bb cljs && bb sass

Features

  • WebSocket Streaming - Real-time token-by-token response delivery
  • Ollama Integration - Local LLM inference with configurable models
  • Model Selection - Switch between available models in the UI
  • Conversation History - Context-aware chat sessions

Configuration

{:state-management :mount
 :server :http-kit
 :frontend :uix              ; Also supports :re-frame, :fulcro
 :database []                ; No database needed
 :auth []                    ; No auth for demo
 :features [:websockets]     ; Required for streaming
 :ai-providers [:ollama]
 :ai-models ["gemma3:1b" "gemma3:270m"]}

Best For

Learn WebSocket patterns, AI/LLM integration, and real-time streaming responses in Clojure applications.

Semantic visual search using CLIP embeddings. Search images with natural language queries like “red sports car” or “sunset at beach”.

bb init my-gallery --example image-gallery
cd projects/my-gallery

# Set Replicate API key (required for embeddings)
export REPLICATE_API_TOKEN="your-replicate-api-token"

# Start development
npm install
bb clj && bb cljs && bb sass

Features

  • Semantic Search - Natural language image queries powered by CLIP
  • Multiple Sources - Configure JSON APIs as image sources
  • Flexible Extraction - JSONPath, regex, or LLM-based URL extraction
  • Live Results - Debounced search with sub-500ms response times
  • In-Memory Vector Store - Fast cosine similarity (no external DB required)
  • Demo Source - Pre-configured Picsum demo loads on startup

Configuration

{:state-management :mount
 :server :http-kit
 :frontend :uix
 :database []                ; In-memory vector store
 :auth []                    ; No auth for demo
 :cache [:valkey]            ; Session middleware
 :ai-providers [:ollama]     ; For LLM extraction
 :example :image-gallery}

Prerequisites

  • Replicate API Key - Required for CLIP embeddings (free tier available)
  • Ollama - Optional, only for LLM-based image extraction

Best For

Learn embedding-based search, external API integration, async indexing patterns, and vector similarity search.

Todo Application

Classic TodoMVC implementation available in all three frontend frameworks. Perfect for comparing UIx, Re-frame, and Fulcro side-by-side.

# UIx version (default)
bb init my-todo --example todo
cd projects/my-todo

# Or specify a different frontend
# Edit rakiba.edn and set :frontend to :re-frame or :fulcro

# Start development
bb clj && bb cljs && bb sass

Features

  • Add/Edit/Delete Todos - Full CRUD operations
  • Filter by Status - All, Active, Completed views
  • WebSocket Sync - Real-time state synchronization
  • Three Frameworks - Same app in UIx, Re-frame, and Fulcro

Configuration

{:state-management :mount
 :server :http-kit
 :frontend :uix              ; Change to :re-frame or :fulcro
 :database []                ; No persistence
 :auth []                    ; No auth
 :features [:websockets]     ; Real-time sync
 :example :todo}

Best For

Learn Rakiba basics and compare how the same application looks across UIx, Re-frame, and Fulcro.

Auth Re-frame (Reference)

Note: This is not a scaffoldable example. It contains reference implementation files to copy into Re-frame projects.

Magic link authentication reference code for Re-frame projects. Copy these files when implementing email-based authentication.

Files Provided

  • reframe/auth/events.cljs - Re-frame events for magic link flow
  • reframe/auth/views.cljs - Login/logout UI components

Features

  • Magic Link Flow - Request link via email, verify with token
  • Session Management - Check session on init, logout support
  • Dev Mode Support - Clickable links displayed during development
  • Error Handling - Comprehensive error states

Usage

# Copy files to your Re-frame project
cp templates/examples/auth-reframe/reframe/auth/* \
   projects/my-app/src/cljs/app/auth/

Backend Routes

Works with rakiba.lib.auth.email-password which provides:

  • POST /api/auth/magic-link/request - Request magic link
  • GET /api/auth/magic-link/verify - Verify and login
  • POST /api/auth/logout - Clear session
  • GET /api/auth/me - Check current session

Best For

Copy-paste reference for Re-frame projects implementing magic link authentication.

Next Steps

  • Configuration - Customize your stack after scaffolding
  • Frontend - Deep dive into UIx, Re-frame, and Fulcro
  • Commands - Learn all available bb tasks