The PlantCare Enterprise API is built on a Cloud-Native, Stateless architecture designed to handle massive IoT workloads with zero downtime.
1. Edge Security & Metering
Every request to our Enterprise endpoints is intercepted by a high-performance Security Middleware that enforces security policies and usage quotas at the edge before any business logic is executed.
sequenceDiagram
participant Client
participant Edge as "Security Middleware"
participant DB as "Quota/Audit Store"
participant API as "Analyze Service"
Client->>Edge: "Request (with API Token)"
Edge->>Edge: "Validate Payload Size (<10MB)"
Edge->>Edge: "Verify Token Format (API2)"
Edge->>DB: "Check Quota & Role (RBAC)"
alt "Quota Exceeded"
Edge-->>Client: "429 Too Many Requests"
else "Authorized"
Edge->>DB: "Log Audit Trail"
Edge->>API: "Forward Request"
API-->>Client: "Analysis Result"
end
2. Reliable Webhook Delivery
Our webhook system is decoupled from the main request lifecycle using Google Cloud Pub/Sub. This ensures that even if your endpoint is temporarily down, we will retry delivery with exponential backoff.
sequenceDiagram
participant API as "Analyze Service"
participant Topic as "Pub/Sub Topic"
participant Worker as "Webhook Worker"
participant Hub as "Client Endpoint"
API->>Topic: "Publish: analysis.completed"
API-->>API: "HTTP 202 Accepted"
Topic->>Worker: "Trigger: New Event"
Worker->>Worker: "Sign Payload (HMAC-SHA256)"
Worker->>Hub: "POST (with PlantCare-Signature)"
alt "Endpoint Down (5xx/4xx)"
Hub-->>Worker: "Error"
Worker->>Worker: "Retry with Exponential Backoff"
else "Success (2xx)"
Hub-->>Worker: "200 OK"
end
3. Stateless Scalability
The Analyze Service is purely stateless. This allows the platform to:
- Auto-Scale: Handle sudden traffic spikes by spawning hundreds of instances in seconds.
- Self-Heal: If an instance fails, another one immediately takes its place without losing session state.
- Global Reach: Deploy code to multiple GCP regions simultaneously for low-latency access.
4. Unified Analysis Pipeline
Our Go-based Enterprise API handles both mobile and third-party programmatic inputs through a single, intelligent endpoint.
- Native Mobile Support: Automatically detects
storagePathpayloads from our mobile apps, utilizing optimized WebP files already present in our secure Cloud Storage buckets. - Programmatic Base64 Support: Accepts raw image data from enterprise clients, automatically handling secure ingestion, malware scanning, and optimization before AI analysis.
- Multilingual Analysis: Enterprise clients and mobile users can specify a
languageparameter to receive localized diagnoses and care advice in their preferred language.