• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
shalini

shalini

plant-health-monitor

Smart Plant Health Monitoring System - IoT Dashboard
Public
Like
plant-health-monitor
Home
Code
5
backend
2
frontend
3
shared
1
README.md
H
main.ts
Environment variables
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

🌿 PlantCare — Smart Plant Health Monitoring System

A full-stack IoT-inspired smart plant health dashboard with real-time sensor monitoring, AI-based health analysis, automation controls, and trend visualization.

✨ Features

FeatureDetails
📊 Live DashboardSoil moisture, temperature, humidity with progress bars
🚨 Smart AlertsColor-coded warnings (🟢 Healthy / 🟡 Moderate / 🔴 Critical)
🧠 AI DecisionsStress level analysis with actionable suggestions
⚙️ AutomationAuto watering & cooling fan toggle controls
📈 Trend ChartLine graph of last 20 readings (Chart.js)
🏗️ ArchitectureSystem diagram showing full IoT data flow
📡 REST APIPOST sensor data from real Arduino/ESP32

🏗️ System Architecture

Rendering mermaid diagram...

📁 Project Structure

plant-health-monitor/
├── main.ts              # HTTP entrypoint
├── backend/
│   ├── index.ts         # Hono routes
│   └── database.ts      # SQLite queries
├── shared/
│   └── types.ts         # Types + AI health analysis
└── frontend/
    ├── index.html       # HTML shell
    ├── style.css        # Green eco theme
    └── app.tsx          # React dashboard

🔌 API Endpoints

GET /api/status

Returns latest sensor reading + AI health analysis + automation state.

GET /api/history?limit=20

Returns last N readings for chart rendering.

POST /api/reading

Ingest real sensor data from Arduino/ESP32:

{ "soilMoisture": 45, "temperature": 28, "humidity": 60 }

POST /api/simulate

Generate a simulated sensor reading (for demo/testing).

GET|POST /api/automation

Read or update watering/fan automation state.

🤖 AI Health Logic

ConditionScoreAlert
Moisture < 20%+3🚨 Critical dry
Moisture < 40%+1⚠️ Low moisture
Temp > 38°C+3🔥 Critical heat
Temp > 32°C+1🌡️ Too warm
Temp < 10°C+2🥶 Too cold
Humidity < 30%+1💨 Dry air
Humidity > 85%+1🌧️ Fungal risk
  • Score 0 → Healthy 🟢
  • Score 1–2 → Moderate 🟡
  • Score 3+ → Critical 🔴

🌱 Connecting a Real Sensor (Arduino/ESP32)

// Arduino / ESP32 snippet #include <WiFi.h> #include <HTTPClient.h> HTTPClient http; http.begin("https://your-val-endpoint.web.val.run/api/reading"); http.addHeader("Content-Type", "application/json"); String body = "{\"soilMoisture\":" + String(moistureVal) + ",\"temperature\":" + String(tempVal) + ",\"humidity\":" + String(humidityVal) + "}"; int code = http.POST(body);
Code
backendfrontendsharedREADME.md
H
main.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.