Examples
Learn Tova through practical, annotated examples. Whether you are writing scripts, building CLI tools, processing data, integrating AI, or creating full-stack web applications, these examples show idiomatic Tova for every use case.
Getting Started
- Hello World -- Your first Tova program. Covers
print, string interpolation, functions, and running withtova run.
Scripting & CLI
CLI Tool -- Command-line utilities: argument parsing with pattern matching, pipe-based data transformation, Result/Option error handling, and file I/O.
Task Queue -- Async patterns and error resilience: retry logic, parallel processing with error isolation, defer for cleanup, and concurrency-limited task queues.
Data & AI
Data Dashboard -- A full-stack analytics dashboard. Demonstrates CSV reading, data pipelines, AI enrichment, and reactive client-side filtering.
ETL Pipeline -- Standalone data processing: read CSV, clean, join, aggregate, pivot, and write to multiple formats. Demonstrates Tova as a data engineering tool.
AI Assistant -- An AI-powered assistant with tool use, structured extraction, semantic search, and classification. Demonstrates multiple AI providers and conversation management.
Content Platform -- AI-enhanced content management with classification, extraction, and summarization. Demonstrates multi-model strategy, data pipeline enrichment, and refresh policies.
Language Deep Dives
- Type-Driven Design -- Refinement types, algebraic data types, generics, exhaustive pattern matching, Result/Option chaining, and a complete form validation system.
Full-Stack Applications
Counter App -- A client-side reactive counter. Introduces
state,computed,matchexpressions, and JSX components.Todo App -- A complete full-stack CRUD application. Covers shared types, server routes, RPC, client reactivity, effects, and component composition.
Tasks App -- A task management app with SQLite persistence, TailwindCSS styling, priority levels, filtering, and search. Demonstrates the ORM, computed values, match-based filtering, and form state management.
Chat App -- Real-time messaging with Server-Sent Events. Demonstrates SSE endpoints, streaming data to clients, and reactive message lists.
E-Commerce Store -- A full e-commerce app with product browsing, cart, checkout, and orders. Demonstrates client stores, inventory guards, reactive computed values, and match-based routing.
Server Patterns
Multi-Server Architecture -- Named server blocks for separating API, WebSocket, and other concerns into independent processes.
Authentication Flow -- JWT-based authentication with registration, login, and protected endpoints. Covers password hashing, middleware, and token management.
Database & Models -- Database configuration, model definitions, CRUD routes, and query patterns using Tova's built-in ORM.
API Gateway -- Production API configuration: CORS, rate limiting, compression, caching, TLS, sessions, file uploads, middleware composition, and health checks.
Monitoring Service -- Background jobs, scheduled tasks, event bus, lifecycle hooks, service discovery, and circuit breakers for production monitoring infrastructure.
Real-Time Dashboard -- Live streaming dashboard with WebSocket metrics, SSE alerts, rolling-window aggregation, and reactive stores.
Cookbook
- Recipes -- Short, focused examples for common tasks: string manipulation, file operations, HTTP requests, and more.