TerasTani — Rafif Sava Adyvka Pratama
2026Decentralized Urban Micro-Farm Operating System & AI Precision Agriculture

TerasTani.

A decentralized urban micro-farm operating system designed to reduce post-harvest loss and retail fragmentation. Aligned with UN SDGs (2, 11, 12, 13), TerasTani aggregates balcony and yard harvests within 200–500m into communal RW crate hubs with AI leaf spectrometry and smart escrow settlement.

Role
Full Stack Engineer & System Architect
Purpose
National Agricultural & Food Security Innovation
Timeline
Oct 2026
Architecture
Clean Layered Architecture (Monorepo pnpm)
Design System
Tactile Editorial Neo-Brutalism & Botanical Luxury
React 19Vite 8Node.js 20Express 5PostgreSQLSupabaseTailwind CSS v4Computer Vision AISmart EscrowIoT Telemetry

200-500m

Walking Radius

Zero-mile micro-transport connecting home gardens to RW hub

Grade A+

Computer Vision AI

Canvas pixel spectrometry estimating SPAD & leaf chlorosis

Smart Escrow

Financial Settlement

Locked distributor funds automatically disbursed upon weighing

4 SDGs

Global Alignment

SDG 2 (Zero Hunger), 11 (Cities), 12 (Production), 13 (Climate)

4 Land Types

Precision Agronomy

Balconies, residential yards, concrete rooftops, and vertical walls

1-Click

Role Switcher

Seamless perspective toggle: Citizen Cultivator to Partner Distributor

The Operational Mandate

Context & High-Stakes Constraints

Urban farming in major cities suffers from fragmentation: home growers produce high-quality micro-harvests (5–15 kg) but lack retail market access, while commercial buyers face high logistics costs and middlemen markups.

TerasTani bridges this gap with an operating system that consolidates neighborhood harvests within 200–500m walking radius into communal RW hubs, backed by AI leaf quality grading and smart escrow financial settlement.

02DECENTRALIZED URBAN AGRI OS

The TerasTani Operating Ecosystem in Action

An interactive walkthrough of the TerasTani platform: IoT microclimate telemetry, AI agronomic simulation, browser canvas leaf spectrometry, and communal crate logistics with smart escrow finance.

🔒terastani.id/platform/overview
Official Platform Architecture & Overview
01 / 05Brand Architecture & SDGs Alignment

Official Platform Architecture & Overview

Platform architecture overview highlighting zero-mile urban harvest aggregation and UN SDGs alignment.

◆ UN SDGs 2, 11, 12, 13 Alignment◆ Walking Distance Consolidation (200-500m)◆ Clean Layered Monorepo Architecture
03CAPABILITIES & WORKFLOW

4 Architectural Pillars & Core Capabilities

Built to automate mission-critical operations — unifying domain workflows, core services, and interactive user experiences.

Decentralized Hub Crate Topology

Aggregates small residential harvests into bulk commercial crates within a 200–500m walking radius.

Computer Vision Leaf Spectrometry

In-browser canvas color-space analysis evaluating leaf vitality and locking purchase prices without external GPU APIs.

Smart Escrow Financial Security

Locks distributor funds in advance and automatically releases payouts to grower wallets upon weighing verification.

Live IoT Microclimate Telemetry

Streams temperature, humidity, light, and pH data with parallel background fetchers to eliminate loading flicker.

5 Mission-Critical Operating Modules

A decentralized civic food system combining microclimate IoT telemetry, client-side computer vision spectrometry, zero-mile communal crate logistics, and smart escrow settlement.

MODULE // 01 OF 05Microclimate IoT

IoT Microclimate Telemetry & Cluster Dashboard

Live command center tracking environmental conditions across neighborhood clusters.

  • Real-Time Sensor Telemetry: Streams solar radiation (BH1750), ambient temperature, humidity (SHT31), and nutrient pH.
  • Crate Capacity Aggregation: Monitors communal crate fill levels across registered local micro-growers.
  • Role Switcher: 1-click toggle to preview perspectives for Cultivator, Distributor, and RW Administrator.

6-Stage Decentralized Aggregation & Escrow Settlement

End-to-end zero-mile agricultural lifecycle from algorithmic land planning and AI leaf grading to communal crate drop-off and automated escrow disbursement.

Stage 01Citizen Cultivator

AI Land Simulation & Guided Cultivation

Cultivators calculate planting hole density via the AI Land Calculator and track microclimates via neighborhood IoT telemetry.

Land Simulation & IoT Monitoring
Stage 02Cultivator & AI Vision

Morning Harvest & Spectrometry Grading

Fresh leaves are scanned using in-browser Computer Vision to compute the SPAD chlorophyll index and lock in Grade A+ certification.

Spectrometry Scan & Quality Lock
Stage 03TerasTani Platform

Digital QR Deposit Pass Issuance

The platform issues a cryptographic QR deposit ticket (format TT-RW07-XXXXXX) with locked forward contract purchase pricing.

Scannable QR Pass Issuance
Stage 04Citizen Cultivator

Zero-Mile Hub Aggregation (200–500m)

Cultivators transport fresh crops to the neighborhood Lumbung RW drop-off point and place them into cold storage crates (4.5°C).

Zero-Mile Consolidation Without Transit Fees
Stage 05RW Hub Manager

Weight Verification & Smart Escrow Payout

The hub manager scans the QR ticket and weighs the produce; the system automatically triggers escrow disbursement into the grower's digital wallet.

QR Verification & Instant Escrow Release
Stage 06Partner Distributor

Cold-Chain Logistics Fleet Dispatch

Refrigerated distributor transport trucks collect consolidated bulk yields (500–1,000 kg) for delivery to commercial retail and supermarket networks.

Wholesale Cold-Chain Distribution

Smart Escrow Fund Locking & Automated Scale Release

Distributor procurement funds are locked in advance inside escrow contracts and automatically credited to grower digital wallets immediately upon physical scale verification at the neighborhood hub.

04SYSTEM ANATOMY & ARCHITECTURE

System Architecture & Modular Topology

Engineered for high availability, fault tolerance, and clear domain separation across frontend interfaces, service layers, and data stores.

Pattern: Clean Layered Monorepo Architecture (pnpm workspace)
Protocol: Versioned RESTful JSON API (/api/v1) with JWT Bearer

Frontend Client SPA

React 19 + Vite 8 + Tailwind 4

Single-Page Application styled with Tactile Editorial Neo-Brutalism, incorporating AuthContext role switcher, and resilient Axios interceptors.

Gateway & Security Middleware

Express 5 + CORS + JWT + Rate Limiter

High-resolution latency logging, strict CORS origin whitelisting, fail-fast input sanitizers, and JWT role-based access control.

Business Logic & Service Layer

Domain Services

Decoupled domain services executing mathematical agronomic calculations, plant spectrometry processing, and multi-tier escrow state transitions.

Persistence & Data Layer

PostgreSQL 15 + Supabase Pooler

High-performance relational database with PgBouncer connection pooling, parameterized SQL queries, and idempotent competition seeders.

Curated Technology Stack

A modern engineering stack combining high-throughput user interfaces, modular backend architecture, and resilient data layers.

Frontend Web Application

React 19Latest Component Architecture & Hooks
Vite 8High-Speed Asset Bundler & HMR
Tailwind CSS v4Utility-First CSS & Neo-Brutalist System
HTML5 CanvasReal-time Pixel Spectrometry Engine
AxiosHTTP Client with Bearer Interceptors
Lucide & Tabler IconsTactile Editorial Vector Iconography

Backend RESTful API

Node.js 20+High-Performance Server Runtime
Express 5RESTful HTTP Engine & Middleware Router
Clean Layered ArchitectureDecoupled Controllers, Services & Repos
JSON Web Tokens (JWT)Stateless Authentication & Role Verification
Input SanitizationFail-Fast Payload Validation Rules

Database & Cloud Infrastructure

PostgreSQL 15Relational Master Data & Ledger Storage
Supabase CloudManaged Database & PgBouncer Connection Pool
Parameterized SQLSQL Injection Proof Repository Layer
pnpm WorkspacesEfficient Monorepo Dependency Management

Precision Agronomy & Smart Finance

Leaf SPAD AlgorithmChlorophyll Index & Health Estimation
Land Capacity EngineDensity & Nutrient Calculation Formulas
Smart Escrow LedgerLocked Distributor Payout Contract
IoT Sensor AggregatorMicroclimate Telemetry Processor

Codebase Structure & Data Models

Clear boundary separation between system components, paired with modular schemas and structured repositories.

📁 tera-backend/ (Express 5 + Clean Layered Architecture)
├──src/controllers/ — HTTP handlers (auth, dashboard, harvest, quota, wallet)
├──src/services/ — AuthService, LandCalculator, PlantVision, SmartEscrow
├──src/repositories/ — Isolated PostgreSQL queries with parameterized SQL
├──src/routes/ — Versioned /api/v1 routing (14 specialized API endpoints)
├──src/middlewares/ — JWT auth, RBAC, latency logger, fail-fast validator
├──src/config/ — Database connection pool (pg.Pool), constants, env parser
├──src/seed/ — Idempotent database seeder for jury competition evaluation

Decentralized Agri Data Models & Ledgers

users & user_wallets & wallet_transactions

Identity management for citizen cultivators and commercial distributors, digital wallet balances, locked escrow balances, and immutable financial transaction ledgers.

clusters & sensor_logs

Lumbung RW communal hub registry, cooling crate capacity metrics, and continuous 24/7 environmental IoT sensor telemetry logs.

harvest_submissions & qr_tickets

Citizen micro-harvest records, Computer Vision AI quality certification grades (Grade A+ through D), cryptographic QR tokens, and scale verification statuses.

distributor_quotas & fleet_schedules

Wholesale bulk procurement quotas, locked forward contract pricing, and refrigerated logistics fleet delivery manifests.

land_calculations & user_missions

Persistent agricultural plot models stored in PostgreSQL, along with community gamification quest progression and XP rewards.

05SECURITY, API & PRODUCTION IMPACT

Hardened Perimeter & Proven Impact

Enterprise-grade security policies, documented API contracts, and the quantifiable outcomes achieved during production deployment.

API Endpoints & Routing Architecture

Authentication & User Identity (/api/v1/auth)

POST/api/v1/auth/loginEmail and password authentication issuing signed JWT Bearer tokens
POST/api/v1/auth/registerUser registration for Citizen Cultivators and Commercial Partner Distributors
GET/api/v1/auth/meFetch active session profile, wallet balances, and accumulated gamification XP

IoT Telemetry & Cluster RW (/api/v1/clusters & /sensors)

GET/api/v1/healthExpress server health diagnostic and Supabase PostgreSQL pool verification
GET/api/v1/clustersCatalog of all registered RW communal hubs and real-time crate fill capacities
GET/api/v1/sensors/latestEnvironmental IoT sensor streams (solar radiation, ambient temp, pH, humidity)

AI Land Calculator & Plots (/api/v1/calculator)

GET/api/v1/calculator/myRetrieve all saved hydroponic plot models for the authenticated cultivator
POST/api/v1/calculator/savePersist AI land simulation parameters and activate active plot monitoring
DELETE/api/v1/calculator/:idRemove completed or archived agricultural plots from the active dashboard

Harvest Submissions & QR Passes (/api/v1/harvests)

GET/api/v1/harvests/myHistorical digital QR deposit passes and hub verification statuses
POST/api/v1/harvests/submitIssue new digital QR deposit passes for communal cold-crate delivery

B2B Quota Exchange & Logistics Fleets (/api/v1/quotas & /fleets)

GET/api/v1/quotasWholesale procurement quotas available for commercial distributor reservation
POST/api/v1/quotas/:id/bookReserve neighborhood harvest quotas backed by automated escrow fund locking
GET/api/v1/fleetsReal-time dispatch schedules and tracking for refrigerated cold-chain trucks
PATCH/api/v1/fleets/:id/statusUpdate fleet logistics status (Scheduled, In Transit, Arrived, Completed)

Smart Escrow Finance & Gamification (/api/v1/wallet & /gamification)

GET/api/v1/walletDetailed breakdown of available balance, locked escrow funds, and ledger audit history
POST/api/v1/wallet/withdrawDisburse wallet funds to Indonesian bank accounts (BCA, Mandiri, BRI) or e-wallets
GET/api/v1/gamification/missionsDaily and weekly agricultural quests with XP reward completion tracking
POST/api/v1/gamification/claimClaim XP rewards upon verified completion of cultivation and harvest milestones
GET/api/v1/gamification/leaderboardDistrict-wide community leaderboard of top neighborhood micro-cultivators

Enterprise Security & Governance Standards

Stateless JWT Bearer Authentication & RBAC

Stateless authentication protocol utilizing signed JSON Web Tokens (JWT) with cryptographic secret keys and dynamic role-based access control.

Fail-Fast Input Sanitization & Payload Validation

Rigorous input sanitization pipelines validating data types, string boundaries, and numeric ranges prior to executing service layer transactions.

Parameterized SQL Queries (Supabase PostgreSQL)

All database queries in the repository layer utilize strict parameter binding with pg.Pool, fully preventing SQL injection vulnerabilities.

Isolated Smart Escrow Ledger Architecture

Strict segregation between liquid wallet balances and escrowed funds prevents double-spending and ensures guaranteed grower disbursements.

Engineering Challenges & Production Results

How critical technical bottlenecks were overcome and verified under real production conditions.

200-500mZero-Mile Walking Radius Eliminating Transport Cost
Grade A+AI Computer Vision Leaf Chlorophyll SPAD Certification
100%Guaranteed Payout Settlement via Smart Escrow Contracts
4 SDGsDirect Alignment with UN Sustainable Goals (2, 11, 12, 13)
What's next

Let's build something.

Recruiting, contracting, or just curious — the inbox is open.

aRafif Sava Adyvka Pratama