ANNEXURE A: TECHNICAL ARCHITECTURE & PROJECT SCOPE
Attached to and forming an integral legal schedule of the Master Service Agreement between Ciyo Enterprises and Hira Farms.
Document Ref: HF-CIYO-ANNEX-V1
Target Ecosystem: 7 Distinct Applications
Monorepo Topology: Apps Multi-Workspace
1. System Architecture & Monorepo Topology
The Hira Dairy Farm Digital Ecosystem is engineered as an enterprise-grade multi-client monorepo structure comprising seven (7) dedicated applications sharing a unified, secure database and high-performance serverless backend. Each application operates within strict functional boundaries to prevent operational crossover and ensure zero-baseline ongoing operational overhead.
Next.js App Router (React 19, Tailwind CSS), optimized for search engine crawlability, responsive desktop/tablet workstations, and rapid data entry.
React Native (Expo SDK 52+), touch-first field workflows, camera barcode/RFID integration, offline resilience, and live push notifications.
Node.js / Express microservice wrapped for AWS Lambda (@vendia/serverless-express) and MongoDB Atlas M0 Free Tier (zero fixed monthly cloud cost).
2. Scope Specification: Next.js Web Portals (3 Apps)
2.1Investor Livestock Marketplace Web Portal
apps/marketplace-hira-farms-frontend-next- Live livestock catalog with multi-filter (Murrah, Nili-Ravi, Jaffarabadi, lactation stage).
- Unit detail views with yield benchmarks, vet certification PDFs, and pedigree logs.
- Multi-animal shopping bag with dynamic quantity steppers (+/-), item removal, and auto-subtotals.
- Comprehensive Checkout Engine with advance deposit calculation, statutory legal agreements, and multi-rail payment UI.
- Persistent cart storage across page navigation and offline-tolerant order placement.
- Live procurement tracking with highway transit milestones and timeline visualizer.
2.2Farm Operations & Admin Management Control Portal
apps/marketplace-hira-farms-frontend-admin- Daily Milking Parlor Recording: Morning & evening milk entry by animal ear-tag ID.
- Automated Milk Pricing Ledger: Daily prevailing market rate/liter, FAT %, and SNF % inputs.
- Animal Lifecycle Management: Health status, deworming, vaccination schedule, insemination, calving logs.
- Livestock Listing & Marketplace Catalog Publisher with image uploads and package pricing.
- Procurement & Transit Dispatch Management: Real-time milestone updates and GPS waypoint entry.
- Comprehensive P&L and financial accounting reports with exportable Excel/CSV statements.
2.3Investor Livestock Asset Performance Portal
apps/performance-hira-farms-frontend-next- Personalized Investor Portfolio: Units owned, active milking buffaloes, born calves, yield index.
- Daily Milking Yield Charts: Historical yield graphs with morning/evening split comparisons.
- Monthly Financial Payout Ledger: Milk sales revenue, maintenance deductions, and net yield return.
- Live Farm Parlor CCTV & Camera Feed Integrator for visual transparency.
- Veterinary & Biosecurity Health Records with downloadable medical compliance certificates.
- Downloadable monthly dividend statements and annual taxation audit summaries.
3. Scope Specification: React Native Expo Mobile Apps (3 Apps)
3.1Investor Marketplace Mobile App
apps/marketplace-hira-farms-mobileNative iOS & Android mobile companion mirroring the Marketplace web capabilities with handheld optimization:
- Fluid touch-gesture livestock catalogue browsing with photo/video carousels.
- Persistent mobile bag with haptic feedback steppers and dynamic payment breakdown.
- One-tap KYC document upload via mobile device camera and file picker.
- Real-time push notifications for order confirmation, transit progress, and arrival.
3.2Farm Operations & Supervisor Field Mobile App
apps/admin-hira-farms-mobileHigh-contrast barn-ready interface engineered specifically for rugged on-farm operations:
- Rapid numerical keypad entry for twice-daily milking yield recording in the shed.
- Ear-tag lookup via camera barcode/QR/RFID scanning or fast numerical search.
- Offline-first local SQLite / Async Storage sync for sheds with spotty cellular coverage.
- Direct vet check logging (temperature, mastitis check, medication administration).
3.3Investor Performance & Asset Monitoring Mobile App
apps/performance-hira-farms-mobileInvestor pocket companion providing real-time visibility into livestock well-being and returns:
- Daily milking push alerts immediately upon evening log submission by farm staff.
- Native chart rendering (yield curves, monthly revenues, lactation index).
- Live CCTV RTSP/HLS stream streaming view embedded within animal unit cards.
- Monthly payout wallet and direct bank withdrawal status tracker.
4. Centralized Backend & Database Architecture
apps/hira-farms-backendA single unified REST API built with Node.js and Express, architected to execute either as a persistent local container or serverlessly on AWS Lambda using @vendia/serverless-express. This guarantees 100% cloud zero-baseline cost when idle while autoscaling to handle burst traffic during marketplace drops or milking log hours.
- • LivestockUnit: Ear tag, breed, DOB, cost, advance, photos, transit status.
- • DailyMilkLog: Morning/evening liters, FAT %, SNF %, daily rate, recordedBy.
- • AnimalHealth: Vaccine schedules, illness records, vet certifications.
- • Order & Checkout: Multi-item cart snapshot, advance payment, agreement ref.
- • FarmFinancials: Aggregated milk sales, feed overheads, monthly investor dividend.
- • Role-Based Access Control (RBAC) with stateless JWT tokens (Admin, Farm Staff, Investor).
- • Multi-tenant database partition isolation with index keys (
tenant_id). - • Robust CORS and input validation using strict JSON schema guards.
- • Graceful offline fallback on client apps with idempotent transaction sync.
5. Calculation Engines & Operational Workflows
Milk sales are calculated per individual animal yield adjusted for market FAT and SNF quality multipliers:
All figures lock daily at 23:59:59 IST to guarantee immutable investor accounting.
Every livestock purchase executes through strict sequential milestones tracked via GPS & timestamp:
- 1. Selection & Breed Verification
- 2. Veterinary Health & Serology Clearance
- 3. Transit Dispatch & Highway GPS Telemetry
- 4. Safe Arrival at Hira Dairy Farm
- 5. RFID Ear-Tagging & Registry Indexing
- 6. 14-Day Biosecurity Quarantine Period
- 7. Production Barn Onboarding & Milking Commencement