Technology

A serverless design on AWS, sized for pilots.

Wastora's architecture uses Amazon API Gateway and AWS Lambda to receive WhatsApp messages, Amazon S3 for batch photos, Amazon DynamoDB for batch records, Amazon Bedrock to read photos, and AWS IoT Core for sensor readings.

Deployed and tested

None yet. Wastora is in development and no part of this architecture is running for customers.

Configured, not yet tested

None yet.

Proposed

Every service on this page. This is the design we plan to build for the Lagos pilots, and it may change as we build.

Architecture

Four lanes, one shared record.

Batches come in over WhatsApp, are forecast on a schedule and whenever readings change, trigger alerts and offers, and are viewed in a web dashboard. Every lane reads and writes the same batch record.

Wastora proposed AWS architecture Four lanes. Log: WhatsApp Business Platform to Amazon API Gateway to AWS Lambda intake to Amazon S3. Forecast: AWS IoT Core to Amazon SQS to Amazon Bedrock to AWS Lambda forecast. Act: Amazon EventBridge Scheduler to AWS Lambda alerts to Amazon SQS to WhatsApp. View: browser to Amazon CloudFront to Amazon Cognito to API Gateway and Lambda. All lanes read and write Amazon DynamoDB. AWS IAM, KMS, CloudTrail and CloudWatch apply across all lanes. Logbatch intakeWhatsAppstaff messages (Meta)Amazon API Gatewaywebhook endpointAWS Lambdaintake, log batchAmazon S3photos, encryptedForecastdays leftAWS IoT Coresensor readingsAmazon SQSforecast jobsAmazon Bedrockreads batch photoAWS Lambdaforecast rulesActalerts & offersAmazon EventBridgehourly re-runAWS Lambdaalerts & offersAmazon SQSoutbound queueWhatsAppmanagers, buyers (Meta)ViewdashboardBrowsermanager dashboardAmazon CloudFrontdashboard deliveryAmazon Cognitosign-in, rolesAPI Gateway+ Lambda: dashboard API AmazonDynamoDB sites, batches,readings, offers,audit events Across every lane: AWS IAM least-privilege roles · AWS KMS encryption keys · AWS CloudTrail audit logs · Amazon CloudWatch monitoring and alarms Dashed boxes are outside AWS. Proposed design for the pilot build; not yet deployed.
Services

What each service would do.

Proposed AWS services and their roles
ServiceRole in WastoraStatus
Amazon API GatewayReceives incoming WhatsApp messages (webhook) and serves the dashboard API.Proposed
AWS LambdaRuns batch intake, the forecast engine, alerts and rescue offers, and the dashboard API.Proposed
Amazon S3Stores batch photos, encrypted, with lifecycle rules to delete them after a set period. Also hosts the dashboard files.Proposed
Amazon DynamoDBStores sites, batches, sensor readings, forecasts, offers and audit events.Proposed
Amazon BedrockGives access to a vision-capable foundation model that reads batch photos and writes plain-language explanations from calculated values.Proposed
AWS IoT CoreReceives temperature readings from cold-room and chiller sensors.Proposed
Amazon SQSQueues forecast jobs and outgoing WhatsApp messages so spikes don't drop work.Proposed
Amazon EventBridge SchedulerRe-runs forecasts hourly and sends daily logging reminders.Proposed
Amazon CognitoDashboard sign-in and roles (owner, manager, staff) for pilot sites.Proposed
Amazon CloudFrontDelivers the dashboard over HTTPS.Proposed
AWS KMSManages the keys used to encrypt photos and records.Proposed
AWS CloudTrail and Amazon CloudWatchAudit logs of account activity, and application logs, metrics and alarms.Proposed
WhatsApp Business PlatformNot an AWS service. Meta's platform for sending and receiving the WhatsApp messages; Wastora connects to it through API Gateway.Proposed
Forecast engine

Rules do the maths. The model reads the photo.

The days-left estimate is calculated, not generated. That keeps it explainable and stops the model from inventing inputs.

  1. Check inputs. Produce type, arrival date and either a sensor temperature or a storage type. If the date or temperature input is missing, stop: the estimate is unavailable, with the reason.
  2. Base shelf life. Each produce type has a rule for expected life at a given temperature, including chilling damage for produce like tomatoes kept too cold.
  3. Photo reading. A vision model on Amazon Bedrock rates ripeness and visible damage from the batch photo. That rating adjusts the base estimate.
  4. Rank and explain. Days left sets the status: sell today, sell this week or safe. The model then writes a short explanation using only the calculated values.
  5. Correct over time. During pilots, actual outcomes per site are compared with forecasts to tune the rules.

Choices behind the design

  • Serverless and pay-per-use. Pilot volumes are small and spiky (deliveries arrive in the morning), so nothing runs idle.
  • WhatsApp first. Staff already use it; there is no app to install or update.
  • Model access inside AWS. Amazon Bedrock keeps photo reading within our AWS account. AWS states that Bedrock does not use customer prompts or outputs to train models.
  • Region chosen for Lagos. The AWS Region will be chosen for latency to Lagos and for availability of the services above.
  • Queues between steps. SQS keeps photos and alerts from being lost if a step slows down.
Data model

What gets stored.

Site

Name, type (cold room, depot, supermarket), sensors, people who get alerts.

Batch

Produce, quantity, unit, source, arrival date, photo reference, storage type or sensor.

Reading

Sensor ID, temperature, time.

Forecast

Days left, status, reasons, confidence, inputs used, time calculated.

Offer

Batch, approved discount, approver, buyers sent to, acceptance (roadmap).

Audit event

Who did what and when: logs, edits, approvals, deletions.

How this data is protected

Talk to us about a pilot

If you run a cold room, depot or fresh section in Lagos, we would like to hear how you track stock today.