Skip to content

hankerspace/garenne

Repository files navigation

Garenne - Rabbit Breeding Management Application

TypeScript React Material-UI PWA

Garenne Dashboard

Garenne is a modern and comprehensive web application for rabbit breeding management, developed with React 19, TypeScript, and Material-UI v5. It provides breeders with a professional solution to efficiently manage their animals, litters, weighings, treatments and much more, all in offline mode with secure local storage.

🌟 Main Features

🐰 Complete Animal Management

  • βœ… Full CRUD: Create, view, edit and delete animals
  • βœ… Detailed sheets: Comprehensive view with tabs (Overview, Reproduction, Weighings, Health)
  • βœ… Advanced search: By name, identifier, breed, status and sex with combined filters
  • βœ… Kinship management: Mother/father linking with automatic validation and interactive family tree
  • βœ… Multiple statuses: Growth, Breeder, Retired, Deceased, Consumed with automatic transitions
  • βœ… Unique identifiers: Support for tattoos, QR codes and custom identifiers
  • βœ… Tag system: Custom tags for flexible animal organization
  • βœ… Cage management: Assignment and tracking of animal locations
  • βœ… Printable sheets: Generation of detailed sheets for each animal with QR code
  • βœ… Consumption: Management of slaughtered animals with date and consumption weight

πŸ“Š Performance Data Tracking

  • βœ… Complete weighings: Weight tracking with history, growth charts and quick entry
  • βœ… Medical treatments: Care management with automatic withdrawal periods and quick entry
  • βœ… Detailed litters: Birth recording, automatic estimated weaning (28 days), mortality
  • βœ… Advanced reproduction: Mating tracking, gestation diagnosis, kindling planning
  • βœ… KPI statistics: Dashboards with key metrics and population charts
  • βœ… Mortality tracking: Death recording with suspected causes and necropsy
  • βœ… Performance metrics: Automatic calculation of reproduction and survival performance
  • βœ… Export/Import: Data backup and restoration with multiple formats
  • βœ… Sample data: Automatic generation for quick discovery

🎨 Modern User Interface

  • βœ… Responsive design: Optimized for mobile, tablet and desktop
  • βœ… Material Design 3: Modern interface following the latest guidelines
  • βœ… Adaptive themes: Light/dark support with automatic system detection
  • βœ… Intuitive navigation: Adaptive navigation bar with shortcuts
  • βœ… Complete PWA: Installable as native application, works offline
  • βœ… Accessibility: Support for screen readers and keyboard navigation

🎯 Advanced Analytics and Goal Tracking

  • βœ… Performance dashboards: Real-time KPIs with interactive charts and trend analysis
  • βœ… Individual performance reports: Detailed metrics for growth, reproduction, and health
  • βœ… Goal tracking system: Set and monitor breeding objectives with automatic progress calculation
  • βœ… Configurable alerts: Smart notifications for withdrawal periods, breeding schedules, and anomalies
  • βœ… Comparative analytics: Benchmarking against averages and historical data
  • βœ… Automated scoring: Performance rankings and recommendations for improvement

πŸ”’ Security and Performance

  • βœ… Quick Actions hub: Centralized page for rapid data entry and common tasks
  • βœ… Express entry modals: Quick weight recording, treatment logging, and breeding notes
  • βœ… Smart navigation: Breadcrumbs and keyboard shortcuts for efficient workflow
  • βœ… Bulk operations: Batch import functionality with validation and preview
  • βœ… Intelligent search: Advanced filtering with saved filter sets and fuzzy matching
  • βœ… Secure local storage: Encrypted and compressed data
  • βœ… Offline mode: Complete functionality without internet connection
  • βœ… Optimized performance: Fast loading, automatic code splitting
  • βœ… Robust validation: Consistency and data integrity checks

πŸš€ Installation and Quick Start

System Requirements

  • Node.js 18.0+ (download here)
  • npm 8+ or yarn 1.22+
  • Git for repository cloning
  • Modern browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)

Quick Installation

# 1. Clone the repository
git clone https://github.com/hankerspace/garenne.git
cd garenne

# 2. Install dependencies
npm install

# 3. Start the application in development
npm run dev

# 4. Open in browser
# The application will be accessible at http://localhost:5173

Available Scripts

# πŸ”§ Development
npm run dev          # Start development server with hot-reload
npm run test         # Run tests in watch mode
npm run test:ui      # Graphical interface for tests

# πŸ—οΈ Build and Production  
npm run build        # Build for production (dist/ folder)
npm run preview      # Preview production build
npm run test:run     # Run all tests once
npm run test:coverage # Test coverage report

# πŸ“‹ Code Quality
npm run lint         # Analyze code with ESLint
npm run lint:fix     # Automatically fix ESLint errors
npm run type-check   # TypeScript verification without build

Production Installation

To deploy the application, check our Deployment Guide which covers:

  • GitHub Pages
  • Netlify / Vercel
  • Docker
  • PWA configuration
  • Performance optimizations

πŸ“± Usage

First Start

  1. Sample data: Click "Load sample data" to discover the application
  2. First animal: Or directly create your first animal

Animal Management

Create an Animal

  1. Click the "+" button in the bottom right or "Create my first animal"
  2. Fill in basic information (name, identifier, sex, etc.)
  3. Define origin (born here/purchased) and kinship if applicable
  4. Save

The animal list displays all essential information with search and filtering options:

Animal List

View Details

  1. Click "Details" on an animal card
  2. Navigate between tabs:
    • Overview: General information and kinship
    • Reproduction: Mating history (coming soon)
    • Weighings: Weight tracking
    • Health: Treatments and withdrawal periods

Animal Details

Weight Tracking

  1. In animal details, click the "Weighings" tab
  2. View weight evolution with interactive charts
  3. Add new weighings with the "New weighing" button
  4. Check statistics (current weight, total gain, average daily gain)

Weight Tracking

Edit an Animal

  1. Click "Edit" on the card or in details
  2. Modify desired fields
  3. Save changes

Family Tree

  1. In animal details, view the interactive family tree
  2. Explore family relationships across multiple generations
  3. Click on an animal in the tree to navigate to its details

Quick Entry

  • Quick weighing: Floating action button to quickly add a weighing
  • Quick treatment: Express entry for medical treatment
  • Printable sheets: Instant generation of animal sheet with QR code

Cage Management

  1. Assign cages to animals during creation/modification
  2. Track cage occupancy from the dashboard
  3. Organize your breeding facilities efficiently

Tag System

  1. Create custom tags to organize your animals
  2. Filter by tags for specific groups
  3. Use colors for quick visual identification

Search and Filters

  • Search bar: Search by name, identifier or breed
  • Status filter: All, Breeders, Growing, Retired
  • Sex filter: All, Females, Males

πŸ—οΈ Technical Architecture

Modern Technology Stack

  • Frontend: React 19 + TypeScript 5.8+ (strict mode)
  • UI Framework: Material-UI v5 with Material Design 3
  • Global State: Zustand v5 (simple and performant store)
  • Routing: React Router v7 with data loading
  • Validation: Zod + React Hook Form for type-safe forms
  • Build Tool: Vite 7.0+ with ultra-fast HMR
  • PWA: Vite PWA Plugin with Workbox
  • Tests: Vitest + Testing Library + jsdom
  • Linting: ESLint 9 + TypeScript ESLint

Data Architecture

Local Storage (LocalStorage + LZ-String compression)
β”œβ”€β”€ animals[]           # Animal registry with genealogy and tags
β”œβ”€β”€ weights[]           # Weighing history with growth analytics
β”œβ”€β”€ treatments[]        # Treatments and withdrawal periods
β”œβ”€β”€ litters[]           # Litters with automatic estimated weaning
β”œβ”€β”€ breedings[]         # Matings and reproduction planning
β”œβ”€β”€ mortalities[]       # Death tracking and causes
β”œβ”€β”€ cages[]             # Location management and occupancy tracking
β”œβ”€β”€ tags[]              # Custom tag system with colors
β”œβ”€β”€ goals[]             # Breeding objectives and progress tracking
β”œβ”€β”€ alerts[]            # Configurable alerts and notifications
β”œβ”€β”€ performanceMetrics[] # Reproduction performance metrics
β”œβ”€β”€ savedFilters[]      # User-saved filter configurations
└── settings            # User preferences and customizable durations

Project Structure

src/
β”œβ”€β”€ πŸ“ components/          # Reusable components
β”‚   β”œβ”€β”€ charts/             # Charts (Recharts) with PopulationChart
β”‚   β”œβ”€β”€ modals/             # Specialized modals (QuickWeight, QuickTreatment, Breeding, Mortality)
β”‚   β”œβ”€β”€ ErrorBoundary.tsx   # Global error handling
β”‚   β”œβ”€β”€ GenealogyTree.tsx   # Interactive family tree
β”‚   β”œβ”€β”€ PrintableRabbitSheet.tsx # Printable sheets with QR code
β”‚   └── QRCodeDisplay.tsx   # QR code display
β”œβ”€β”€ πŸ“ pages/              # Main application pages
β”‚   β”œβ”€β”€ Animals/           # 🐰 Animal management with advanced genealogy
β”‚   β”œβ”€β”€ Litters/           # πŸ‘Ά Litter management with estimated weaning
β”‚   β”œβ”€β”€ Statistics/        # πŸ“Š Detailed metrics and performance analytics
β”‚   β”œβ”€β”€ Treatments/        # πŸ’Š Treatment management with withdrawal tracking
β”‚   β”œβ”€β”€ QuickActionsPage.tsx # ⚑ Quick Actions hub for rapid data entry
β”‚   β”œβ”€β”€ GoalsTrackingPage.tsx # 🎯 Goals and objectives tracking
β”‚   β”œβ”€β”€ DashboardPage.tsx  # πŸ“ˆ Main dashboard with real-time KPIs
β”‚   β”œβ”€β”€ ReproductionPlanningPage.tsx # πŸ“… Breeding calendar and planning
β”‚   β”œβ”€β”€ Tags/              # 🏷️ Tag management and organization
β”‚   β”œβ”€β”€ Cages/             # 🏠 Cage management and occupancy
β”‚   └── Settings/          # βš™οΈ Configuration and customizable durations
β”œβ”€β”€ πŸ“ services/           # Business services and data generation
β”‚   β”œβ”€β”€ qrcode.service.ts   # QR code generation
β”‚   β”œβ”€β”€ statistics.service.ts # Performance calculations
β”‚   β”œβ”€β”€ search.service.ts   # Advanced search with fuzzy matching
β”‚   β”œβ”€β”€ export.service.ts   # Multi-format export (JSON, CSV, Excel)
β”‚   β”œβ”€β”€ backup.service.ts   # Backup and restoration
β”‚   β”œβ”€β”€ i18n.service.ts     # Multilingual support
β”‚   β”œβ”€β”€ alerting.service.ts # Smart alerts and notifications
β”‚   β”œβ”€β”€ performance-report.service.ts # Individual performance analysis
β”‚   β”œβ”€β”€ metrics-monitoring.service.ts # Real-time metrics tracking
β”‚   β”œβ”€β”€ genealogy.service.ts # Pedigree and family tree services
β”‚   β”œβ”€β”€ batch-import.service.ts # Bulk data import with validation
β”‚   β”œβ”€β”€ cache.service.ts    # Intelligent caching system
β”‚   β”œβ”€β”€ storage-abstraction.service.ts # Storage layer abstraction
β”‚   └── error-interceptor.service.ts # Error handling with retry logic
β”œβ”€β”€ πŸ“ state/             # Zustand store and selectors
β”œβ”€β”€ πŸ“ utils/             # Utilities (dates, validation, storage)
β”œβ”€β”€ πŸ“ models/            # TypeScript types and extended interfaces
β”œβ”€β”€ πŸ“ hooks/             # Custom hooks (useTranslation)
└── πŸ“ test/              # Unit and integration tests

Data Management

Storage and Persistence

  • LocalStorage with automatic LZ-String compression (~60% reduction)
  • Automatic backup on every state change
  • Backup and restoration via JSON export/import
  • Consistency validation on data loading
  • Automatic migration during schema updates

Performance and Optimization

  • Automatic code splitting by route
  • Lazy loading of heavy components
  • Memoization with strategic React.memo and useMemo
  • Virtual scrolling for large lists
  • Debouncing of searches and filters

πŸ› οΈ Development Guide

Environment Setup

Recommended VSCode Extensions

{
  "recommendations": [
    "bradlc.vscode-tailwindcss",
    "ms-vscode.vscode-typescript-next", 
    "dbaeumer.vscode-eslint",
    "esbenp.prettier-vscode",
    "ms-vscode.vscode-react-javascript-snippets"
  ]
}

ESLint and TypeScript Configuration

  • TypeScript strict mode enabled with all checks
  • ESLint 9 with modern configuration and React rules
  • Path mapping configured for absolute imports
  • Auto-fix on save configured

Development Workflow

For detailed guidelines, check CONTRIBUTING.md.

Testing Strategy

Test Types

  • Unit Tests: Utils, services, store actions (95%+ coverage)
  • Component Tests: Rendering, interactions, props (85%+ coverage)
  • Integration Tests: Complete user flows (75%+ coverage)
  • Service Tests: All 14+ services with comprehensive test coverage

Test Commands

npm run test              # Watch mode for development
npm run test:ui           # Vitest graphical interface  
npm run test:run          # Complete CI/CD execution
npm run test:coverage     # Detailed coverage report

πŸ“š Complete Documentation

User Guides

Technical Documentation

Quick API Reference

Main Store Actions

// Animal management
const animal = addAnimal({ name: "Fluffy", sex: Sex.Female, status: Status.Grow });
updateAnimal(animal.id, { status: Status.Reproducer, cage: "A1" });
consumeAnimal(animal.id, { consumedDate: "2024-01-01", consumedWeight: 2500 });
deleteAnimal(animal.id);

// Weighings with quick entry
const weight = addWeight({ animalId: animal.id, weight: 1200, date: "2024-01-01" });
quickAddWeight(animal.id, 1300); // Quick entry with current date

// Treatments with quick entry
const treatment = addTreatment({
  animalId: animal.id,
  product: "RHD Vaccination",
  withdrawalUntil: "2024-02-01"
});
quickAddTreatment(animal.id, "Dewormer"); // Quick entry

// Litters with estimated weaning
const litter = addLitter({
  motherId: animal.id,
  kindlingDate: "2024-01-01",
  bornAlive: 8,
  estimatedWeaningDate: "2024-01-29" // Calculated automatically
});

// Cage and tag management
const cage = addCage({ name: "A1", capacity: 1, location: "Building A" });
const tag = addTag({ name: "Elite Breeder", color: "#4CAF50" });
addTagToAnimal(animal.id, tag.id);

// Mortality tracking
const mortality = addMortality({
  animalId: animal.id,
  date: "2024-01-01",
  suspectedCause: "Disease",
  necropsy: false
});

// Export/Import enhanced
const backup = exportData(); // JSON string
const csvData = exportToCSV(animals); // CSV export
const excelData = exportToExcel(animals); // Excel export
importData(backup); // Restore from backup

// New services - Goals and alerts
const goal = addGoal({
  title: "Increase average weight",
  type: GoalType.GROWTH,
  targetValue: 2500,
  period: GoalPeriod.MONTHLY,
  deadline: "2024-12-31"
});

// Configurable alerting system
const alert = AlertingService.getInstance().createAlert({
  title: "Withdrawal period expired",
  message: "Fluffy's treatment is completed",
  severity: "medium",
  actions: [{ label: "View details", action: () => navigate(`/animals/${animal.id}`) }]
});

// Individual performance reports
const report = PerformanceReportService.generateReport(animal.id);
console.log(report.performance.overallScore); // Score 0-100
console.log(report.performance.recommendations); // Personalized recommendations

// Cache and monitoring services
CacheService.getInstance().set('animals-stats', kpis, 300000); // Cache 5min
const metrics = MetricsMonitoringService.getInstance().getMetrics();

Useful Selectors

// KPIs and statistics
const kpis = getKPIs(state);              // Main metrics
const activeAnimals = getActiveAnimals(); // Living animals  
const breeders = getBreeders();           // Breeding animals
const consumedAnimals = getConsumedAnimals(); // Consumed animals

// Advanced filters and searches
const females = getAnimalsByStatus(Status.Reproducer);
const recent = getRecentWeights(30);      // Last 30 days
const alerts = getActiveAlerts();         // Active withdrawal alerts
const cageOccupancy = getCageOccupancy(); // Cage occupancy
const taggedAnimals = getAnimalsByTag("Elite Breeder");

// Performance metrics
const performanceMetrics = getPerformanceMetrics(animalId);
const populationTrends = getPopulationTrends(); // Population charts
const mortalityStats = getMortalityStatistics(); // Mortality statistics
const weaningProgress = getWeaningProgress(); // Current weaning

For complete documentation, see API.md.

πŸ”’ Security and Data

Data Protection

  • Local storage only: No data sent to the internet
  • No authentication: Single-user local application
  • Recommended backup: Regular data export

Withdrawal Periods

The application automatically monitors treatment withdrawal periods and displays appropriate alerts.

πŸš€ Deployment

GitHub Pages (coming soon)

Automatic deployment to GitHub Pages will be configured via GitHub Actions.

Production Build

npm run build

Files will be generated in the dist/ folder.

🀝 Contribution

Report a Bug

  1. Check that the bug is not already reported
  2. Create an issue with:
    • Detailed description
    • Reproduction steps
    • Screenshots if relevant

Propose a Feature

  1. Create an issue with "enhancement" label
  2. Describe the need and proposed solution
  3. Wait for feedback before starting development

Pull Requests

  1. Fork the project
  2. Create a branch for your feature
  3. Commit your changes
  4. Create a pull request with detailed description

πŸ“ Roadmap and Evolution

Current Version (v0.8-beta)

  • 🐰 Complete animal management with CRUD, kinship, statuses and consumption
  • πŸ“Š Weighings and growth curves with interactive charts and quick entry
  • πŸ’Š Treatments and withdrawal periods with automatic alerts and quick entry
  • πŸ‘Ά Litters and reproduction with automatic estimated weaning and matings
  • 🏷️ Custom tag system for flexible organization
  • 🏠 Cage management with assignment and occupancy tracking
  • πŸ“Š Advanced statistics with performance metrics and population charts
  • 🧬 Interactive family tree to visualize family relationships
  • πŸ“‹ Printable sheets with QR codes for each animal
  • ⚰️ Mortality tracking with causes and necropsy
  • πŸ”„ Multi-format export/import: JSON, CSV, Excel
  • 🌐 Multilingual support with integrated i18n service
  • βš™οΈ Customization: configurable durations (gestation, weaning, reproduction)
  • 🎨 Responsive interface Material Design 3 with themes
  • πŸ’Ύ Robust local storage with compression and validation
  • πŸ“± Complete PWA installable and working offline
  • πŸ§ͺ Automated tests with >85% coverage
  • 🎯 Goal tracking system with progress monitoring and alerts
  • ⚑ Quick Actions hub for rapid data entry and workflow optimization
  • πŸ”” Smart alerting system with configurable thresholds and notifications
  • πŸ“ˆ Individual performance reports with detailed analytics and recommendations

Version 1.0 - Production Ready

  • πŸ”„ Advanced export/import: Excel, CSV, breeding standard formats
  • πŸ“ˆ Advanced statistics: Performance charts, comparisons
  • πŸ” Intelligent search: Complex filters, fuzzy search with saved filter sets
  • 🏷️ Tag system: Custom organization with colors and categories
  • 🎯 Goal tracking: Breeding objectives with progress monitoring
  • ⚑ Quick Actions: Rapid data entry and workflow optimization
  • πŸ”” Smart alerts: Configurable notifications and monitoring
  • Cage visualization: Graphic representation of facilities with animal locations
  • Animal consumption: Management of animals "slaughtered for consumption" with statistics
  • Animal performance: Reproduction performance measures, offspring survival rate, performance statistics
  • 🌐 Internationalization: Multilingual support (FR, EN, ES, DE, PT) for application and readme
  • Customization: Precise configuration of gestation duration, weaning duration, reproduction intervals, etc.

Version 1.1 - Advanced Features

  • 🧬 Advanced genealogy: Interactive tree with navigation between generations
  • πŸ“… Reproduction planning: Intelligent calendar, reminders
  • 🎯 Goals and tracking: Goals tracking, target metrics
  • ☁️ Cloud synchronization: Optional automatic backup
  • πŸ‘₯ Multi-users: Family sharing, permissions
  • PWA quick actions: Add weighing, add treatment from home screen

Continuous Technical Improvements

  • ⚑ Performance: Virtual scrolling, improved lazy loading
  • πŸ”’ Security: End-to-end encryption, audit trails
  • πŸ§ͺ Tests: E2E testing, visual regression testing
  • πŸ“Š Monitoring: Usage analytics, error tracking
  • 🎯 Accessibility: WCAG 2.1 AAA compliance
  • 🌍 Eco-responsibility: Carbon optimizations, green coding

Sought Community Contributions

  • 🌍 Translations: Help with internationalization
  • 🎨 Design: UX/UI improvements, custom icons
  • πŸ§ͺ Tests: Real use cases, manual testing
  • πŸ“š Documentation: User guides, tutorial videos
  • πŸ› Bug hunting: Bug reporting and reproduction
  • πŸ’‘ Ideas: Feature suggestions, user feedback

To contribute, check CONTRIBUTING.md and join our community!

πŸš€ Performance and Optimization

Performance Metrics

  • First Contentful Paint: < 1.5s
  • Largest Contentful Paint: < 2.5s
  • First Input Delay: < 100ms
  • Cumulative Layout Shift: < 0.1
  • Bundle Size: < 1MB (gzipped)

Implemented Optimizations

  • ⚑ Automatic code splitting by route
  • 🎯 Lazy loading of heavy components (charts, modals)
  • 🧠 Strategic memoization with React.memo and useMemo
  • πŸ’Ύ LZ-String compression for storage (-60% space)
  • πŸ”„ Virtual scrolling for large lists
  • ⏱️ Search and filter debouncing (300ms)
  • πŸ“± Service Worker with intelligent cache

πŸ› οΈ Troubleshooting

Common Issues

Application doesn't load

# Check Node.js version
node --version  # Must be >= 18

# Clear npm cache
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

# Check ports
lsof -i :5173  # Default Vite port

Data lost after browser closure

// Check LocalStorage
console.log(localStorage.getItem('garenne-app-state'));

// Check storage quota
navigator.storage.estimate().then(estimate => {
  console.log(`Used: ${estimate.usage} / ${estimate.quota}`);
});

Degraded performance

# Analyze bundle size
npm run build -- --mode analyze

# Profile React components
# Use React DevTools Profiler

PWA doesn't install

  • βœ… Check that application is served over HTTPS
  • βœ… Validate manifest.json in DevTools
  • βœ… Confirm Service Worker is active
  • βœ… Test PWA installability criteria

Debug Mode

Enable debug mode by adding to URL:

http://localhost:5173/?debug=true

This displays:

  • πŸ› Detailed store logs
  • πŸ“Š Performance metrics
  • πŸ” Debug information in console

Support and Help

πŸ“„ License

This project is under MIT license. See the LICENSE file for more details.

πŸ™ Acknowledgments

  • Material-UI for the UI framework
  • React Team for React and development tools
  • Zustand for simple and efficient state management
  • Vite for fast development tooling

Developed with ❀️ for the breeding community

About

Local first web app for bunnies breeding management

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors