Daniel López Azaña

Theme

Social Media

Featured Project

ZooClock - Scientific Pet Age Calculator with Rust and WebAssembly

Bilingual web application built with Rust, Leptos, and WebAssembly that calculates pet ages in human years using scientifically-backed algorithms, delivering real-time interactive calculations with exceptional performance and multilingual SEO optimization.

Pet owners around the world ask the same question: “How old is my companion in human years?” While traditional answers like “multiply by 7” persist, modern veterinary science reveals a far more complex reality. ZooClock transforms this scientific knowledge into an accessible, interactive web application that delivers precise age calculations based on cutting-edge research, wrapped in a beautiful bilingual experience.

ZooClock advanced mode with comprehensive health indicators

I architected and developed this scientific pet age calculator from the ground up using Rust, Leptos, and WebAssembly, creating a platform that combines academic rigor with exceptional user experience. The result is a web application that performs complex calculations in real-time while remaining accessible to pet owners worldwide through its dual-domain, fully bilingual implementation.

The Challenge: Science Meets User Experience

Traditional pet age calculators use oversimplified formulas that ignore crucial biological factors. Veterinary research demonstrates that age progression varies dramatically based on species, breed size, and individual characteristics, but presenting this complexity without overwhelming users requires careful design.

Pet owners need:

  • Scientifically accurate age calculations based on modern veterinary research, not outdated myths.
  • Breed-specific algorithms that account for different maturation rates across dog and cat breeds.
  • Real-time results with smooth, responsive interactions that feel instant.
  • Visual understanding through interactive charts showing age progression over time.
  • Accessible information in their native language (English/Spanish) with proper SEO optimization.

The Technical Challenge:

Building a system that combines scientific accuracy with exceptional user experience meant solving several complex problems simultaneously: implementing sophisticated algorithms that execute instantly, creating a fully reactive interface that updates in real-time, and maintaining two separate domains with perfect bilingual synchronization and SEO optimization.

The Solution: Rust-Powered Reactive Calculations

By leveraging Rust’s performance combined with Leptos’s reactive framework and WebAssembly’s near-native speed, I created a platform where complex calculations happen instantly on every parameter change. The unified Axum routing system ensures predictable SEO behavior, while the database-driven multilingual architecture keeps both language versions perfectly synchronized.

Architecture and Technology Stack

The platform is built on a modern hybrid SSR architecture that maximizes performance while maintaining exceptional SEO characteristics across two domains.

Key Components:

ComponentTechnologyPurpose
Frontend FrameworkLeptos 0.8.2 (Rust)Fully reactive UI with type safety and islands architecture
Computation EngineRust + WebAssemblyHigh-performance scientific calculations executed client-side
Backend ServerAxum (Rust)Unified routing system with server-side rendering
DatabasePostgreSQL + SQLxBreed data, scientific parameters, and multilingual content
StylingTailwind CSS + Font AwesomeModern, responsive interface with dark mode support
SEO SystemDatabase-aware hreflangAutomatic bilingual link generation and URL management

Why Rust + Leptos + WebAssembly

Rust was the natural choice for its exceptional performance, memory safety, and compile-time guarantees. The Leptos framework provides React-level developer experience with superior runtime performance through its islands architecture approach.

Key Benefits:

  • Instant calculations - Complex scientific algorithms execute with near-zero latency.
  • Type-safe reactive state - Compiler catches bugs before they reach users.
  • Optimal bundle size - Tree-shaking and dead code elimination keep WASM modules lean.
  • Zero runtime overhead - No garbage collection pauses during calculations.

Hybrid SSR with Islands Architecture

The application uses selective hydration through Leptos’s islands architecture, where only interactive components include WebAssembly:

Traditional SPA

flowchart TB A[🌐 Initial Request] -->|Large JS Bundle| B[Client] B -->|Parse & Execute| C[Hydrate Everything] C -->|API Calls| D[Server]

⏱️ Slower Initial Load

ZooClock Islands

🌐 Initial Request

flowchart TB subgraph Server[" "] E[SSR HTML] F[Small WASM] end G[Only Calculator Hydrated] E --> G F --> G style Server fill:transparent

⚡ Instant Content Display

Performance Impact:

  • Faster time-to-interactive - Static content renders immediately from SSR.
  • Smaller initial payload - Only calculator component includes WASM.
  • Better SEO - Search engines see fully-rendered HTML.
  • Progressive enhancement - Site functions without JavaScript, calculator enhances when loaded.

Core Features

1. Scientific Age Calculation Algorithms

The platform implements scientifically-backed algorithms based on peer-reviewed veterinary research:

Advanced Dog Age Calculation (Version 3.0):

  • Breed size-based maturation rates - Small breeds mature faster than large breeds.
  • Non-linear progression - First years count differently based on DNA methylation research.
  • Gender and neuter status factors - Accounts for biological differences.
Breed SizeAt 1 YearAt 2 YearsScientific Basis
Small (< 10kg)15.0 human years24.0 human yearsFaster maturation, early sexual maturity (6-8 months)
Medium (10-25kg)13.5 human years23.0 human yearsIntermediate development rate
Large (> 25kg)12.0 human years22.0 human yearsSlower maturation, delayed sexual maturity (12-18 months)

Cat Age Calculation:

  • Distinct feline aging patterns - Different from canines.
  • Breed-specific adjustments - Accounts for breed size variations.
  • Activity level considerations - Indoor vs. outdoor lifestyle factors.

Technical Implementation:

  • Rust-based calculation engine - Compiled to WebAssembly for maximum performance.
  • Database-driven breed data - PostgreSQL stores 200+ dog breeds and 80+ cat breeds.
  • Real-time recalculation - Every parameter change triggers instant updates.
  • Smooth animations - Visual feedback using CSS transitions and Leptos reactivity.

2. Fully Reactive User Interface

Built with Leptos’s fine-grained reactivity, the UI updates instantly without manual DOM manipulation:

Interactive Components:

  • Breed selector with search - Autocomplete searches through hundreds of breeds.
  • Age slider with precision control - Supports month-level granularity.
  • Visual age progression chart - Interactive graph showing lifetime equivalent.
  • Life expectancy indicators - Displays percentage of life lived and remaining.

Reactivity in Action:

// Simplified example showing Leptos reactivity
let (age, set_age) = create_signal(3.0);
let (breed, set_breed) = create_signal(Breed::MixedMedium);

// Human age automatically recalculates when signals change
let human_age = create_memo(move |_| {
    calculate_human_age(age.get(), breed.get())
});

Every signal change propagates automatically through the computation graph, triggering only affected components to re-render with surgical precision.

3. Bilingual Multi-Domain Architecture

The platform serves two distinct domains with perfect synchronization:

Dual Domain Strategy:

Database-Driven SEO:

  • Automatic hreflang generation - Cross-domain language alternates.
  • Unified content management - PostgreSQL stores all translations.
  • SEO-optimized URLs - Clean, descriptive paths in both languages.
  • Server-side language detection - Cookie-based preference system.

Benefits:

  • Improved SEO - Each domain ranks independently in its language.
  • Better user experience - Native domain feels more trustworthy.
  • Flexible growth - Easy to add more languages or domains.

4. Advanced UI/UX Features

Dark Mode Support:

  • Server-side theme detection - No flash of unstyled content.
  • Cookie-based persistence - Preference survives page reloads.
  • Smooth transitions - Animated theme switching.

Accessibility:

  • Keyboard navigation - Full keyboard support for all interactions.
  • Screen reader optimized - Semantic HTML and ARIA labels.
  • High contrast support - Meets WCAG 2.1 AA standards.

Performance Optimizations:

  • Lazy loading - Images and non-critical assets load on demand.
  • Asset minification - Compressed CSS, JavaScript, and HTML.
  • CDN-ready - Static assets optimized for edge delivery.

5. Advanced Mode: In-Depth Custom Calculations

For users who want to fine-tune their pet’s profile with greater precision, ZooClock offers an Advanced Mode that unlocks additional input fields and detailed health indicators.

Additional Input Fields:

  • Exact birth date - Enables day-precision age calculations instead of month approximations.
  • Precise weight - Allows manual weight adjustment to account for deviations from breed average.
  • Gender selection - Male or female, as hormonal differences affect aging rates.
  • Neuter status - Accounts for the biological impact of sterilization on lifespan and aging.

Enhanced Health Indicators:

  • Life stages progression - Visual timeline showing completed stages (Puppy, Teenager, Young, Mature, Senior) with age ranges for each.
  • Current life stage description - Contextual information about the pet’s current developmental phase.
  • Life expectancy - Calculated years of expected lifespan based on breed, size, and health factors.
  • Years to rainbow - Estimated remaining years (life expectancy minus current age).
  • Percentage of life lived vs. remaining - Visual representation of life progress.
  • Health index - Composite score (0-100) based on weight relative to breed average, with feedback messages.
  • Safe temperature range - Species and breed-specific optimal temperature zones (ideal, hot, danger thresholds) for outdoor activities.

Technical Implementation:

  • Conditional rendering - Advanced fields appear only when the mode is activated via a toggle switch.
  • Reactive recalculation - All additional indicators update instantly as the user adjusts any parameter.
  • Visual feedback - Color-coded indicators (green for excellent health, yellow/orange for good, red for concerns).
  • Temperature visualization - Horizontal gauge showing safe, ideal, and danger zones with current ambient consideration.

ZooClock advanced mode showing additional input fields and comprehensive health indicators

This advanced functionality provides veterinarians, breeders, and dedicated pet owners with the detailed insights they need while keeping the interface clean and accessible for casual users through the optional toggle.

Results and Impact

Performance Achievements

Instant calculationsNear-zero latency for complex scientific algorithms thanks to WebAssembly execution.
Smooth animations60 FPS reactive updates throughout the interface with zero janking.
Compact WASM bundleOptimized WebAssembly module under 150KB through aggressive tree-shaking.
Type-safe codebaseRust’s compiler catches bugs at compile-time, ensuring rock-solid reliability.

Business Impact

Dual-domain bilingual platformServing both English (zooclock.com) and Spanish (tiempoanimal.com) markets with native SEO optimization.
Scientific credibilityAlgorithms based on peer-reviewed research enhance trust and authority.
Accessible to pet owners worldwideSimple interface makes complex science approachable for everyone.
Production-ready platformLive on both domains with full feature set and exceptional stability.

Technical Achievements

Demonstrated Leptos islands architecture viability for production web applications combining SSR with selective hydration.
Implemented database-driven multilingual SEO with automatic hreflang generation across dual domains.
Created scientifically-accurate age calculation algorithms based on modern veterinary research.
Established best practices for Rust+Leptos+WASM reactive applications with optimal performance.

Conclusion

The ZooClock project represents a successful fusion of scientific rigor and modern web technology. By leveraging Rust, Leptos, and WebAssembly, I created a platform that delivers complex scientific calculations with instant responsiveness while maintaining exceptional SEO across dual bilingual domains.

This project demonstrates that sophisticated algorithms and beautiful user experience aren’t mutually exclusive. The architectural decision to use Leptos’s islands architecture with selective hydration resulted in a platform that achieves both fast initial loads and instant interactivity where it matters most.

Key Takeaways for Similar Projects

  1. Islands architecture enables optimal performance through selective hydration.
  2. Rust + WebAssembly delivers desktop-class calculation speed in browsers.
  3. Fine-grained reactivity provides smooth UX without framework overhead.
  4. Database-driven multilingual architecture scales elegantly across domains.
  5. Type-safe full stack prevents entire classes of bugs at compile-time.

Need a similar solution?

For businesses requiring high-performance web applications with:

  • Complex real-time calculations (scientific, financial, engineering domains).
  • Multilingual SEO optimization across multiple domains.
  • Instant reactive interfaces with desktop-class performance.
  • Type-safe full-stack development minimizing runtime bugs.

The Rust/Leptos/WebAssembly stack demonstrated in ZooClock provides a robust, performant, and scalable solution.

I’m available for consulting and development on similar high-performance applications, helping you deliver exceptional user experiences backed by solid engineering.

Get in touch →

Daniel López Azaña

About the author

Daniel López Azaña

Tech entrepreneur and cloud architect with over 20 years of experience transforming infrastructures and automating processes.

Specialist in AI/LLM integration, Rust and Python development, and AWS & GCP architecture. Restless mind, idea generator, and passionate about technological innovation and AI.

Comments

Be the first to comment

Submit comment

Have a Similar Project in Mind?

Let's discuss how I can help you achieve your goals

Start a Conversation