AWS Builder Center

Recyvia: Building a Cloud-Native Recyclable Waste Collection Platform with AWS | WeMakeDevs Bharat Builds First Commit

Recyvia is a recyclable-waste collection and recovery platform connecting customers, collectors, and recovery partners through one structured workflow. Built with React, TypeScript and AWS services including Amplify, API Gateway, Lambda, DynamoDB and AppSync Events. We tackled state management, realtime communication, cloud architecture and the collection-to-recovery workflow while gaining hands-on AWS experience. #AWS #WeMakeDevs #BharatBuilds #FirstCommit #Recyvia #Serverless #DynamoDB #Lambda #AppSync

Recyvia — Request. Collect. Recover.
Doorstep recyclable waste collection in urban India is fundamentally fragmented. Every day, households and commercial facilities generate substantial quantities of recyclable materials, including paper, cardboard, plastics, metals, glass, and electronic waste. However, the systems that connect these waste generators with informal waste collectors and formal recovery facilities operate almost entirely in silos.
As part of the WeMakeDevs Bharat Builds First Commit initiative, we built Recyvia—a cloud-native, serverless platform designed to bring operational structure, verified doorstep collection, and end-to-end traceability to recyclable waste recovery using Amazon Web Services (AWS).



The Problem

The lifecycle of recyclable scrap typically involves three distinct groups:
  1. Waste Generators (Households & Businesses): Individuals and commercial establishments often have recyclables ready for disposal, but lack predictable, scheduled collection channels. They are frequently unsure when a collector will visit their street or what market rates apply to different scrap categories.
  1. Informal Waste Collectors: Independent collectors navigate neighborhoods with pushcarts or small vehicles. They spend significant time and fuel searching door-to-door for available scrap without forward visibility into demand, relying on informal pen-and-paper accounting.
  1. Recovery & Recycling Partners: Processing facilities receive materials in unpredictable batches. Because there is no structured intake pipeline connecting collectors to facility gates, facilities struggle to track material provenance and manage inventory queues efficiently.
Without a coordinated communication channel between these three participants, recyclable materials often end up mixed with municipal solid waste, discarded in landfills, or delayed in informal holding yards. Recyvia was created to address this coordination breakdown through a unified, event-driven web application.



What We Built

Recyvia is a multi-role operational web platform designed around three core user experiences:

1. The Customer Interface (Individuals & Businesses)

  • Pickup Scheduling: Users select scrap categories (such as Old Newspapers, Corrugated Cardboard, PET Bottles, Metal Scrap, and E-Waste), enter estimated quantities in kilograms, specify a pickup date and time window, and choose their preferred settlement method (Cash or UPI).
  • Security OTP Generation: Upon request submission, the platform issues a 6-digit Security One-Time Password (OTP) displayed directly on the user's dashboard. This code authenticates the collector upon physical doorstep arrival before any material is handed over.
  • Live Status Tracking: Customers monitor their pickup's progression through each operational stage via real-time WebSocket event updates.

2. The Collector Interface

  • Available Jobs Radar: Nearby pickup requests appear in an operational feed, allowing collectors to review item categories, estimated weights, and general location before accepting a job.
  • Trip Workflow Management: Collectors advance the pickup status through structured operational steps: starting transit ( ON_THE_WAY ) and marking doorstep arrival ( ARRIVED ).
  • Doorstep Verification & Digital Scale Input: Before collecting scrap, the collector validates physical custody by entering the customer's 6-digit OTP. Once authenticated, the collector inputs calibrated scale weights for each individual scrap stream.
  • Settlement Recording: The platform computes the final payout amount using verified weights and standard scrap rate tables, allowing the collector to record the transaction settlement.

3. The Recovery Partner Interface

  • Gate Intake Queue: Completed collections flow into the recycling facility queue with a status of  AVAILABLE .
  • Material Processing Tracking: Facility operators log material intake ( RECEIVED ), move batches onto sorting and mechanical conversion lines ( PROCESSING ), and verify final recovery ( RECOVERED ).
  • Inventory Ledger: Recovery records track material composition, total diverted weight, and batch identifiers across all processing stages.



The Recyvia Workflow

The entire lifecycle follows a strict, single-direction operational pipeline:
[Customer Requests Pickup]
│
▼
[Collector Accepts Job]
│
▼
[Collector Starts Trip & Arrives]
│
▼
[6-Digit Doorstep OTP Verification]
│
▼
[Scale Weighing & Settlement Calculation]
│
▼
[Transaction Recorded & Collection Completed]
│
▼
[Recovery Partner Receives Material at Gate]
│
▼
[Facility Processing & Sorting]
│
▼
[Material Recovered]
Every stage in this workflow represents an explicit state mutation enforced by the backend, ensuring that no step can be skipped or recorded out of sequence.



Technology Stack

To build a responsive, maintainable, and cost-effective application, we selected a lightweight modern frontend paired with an entirely serverless AWS backend:
  • Frontend Core: React 19, TypeScript, Vite
  • Styling: Tailwind CSS v4 (designed with a dedicated dark-themed operations layout)
  • Client Storage & State: React Context API, IndexedDB (via Dexie.js for client-side persistence and offline resilience)
  • Hosting & Edge Delivery: AWS Amplify Hosting
  • API Management: Amazon API Gateway (HTTP API)
  • Serverless Compute: AWS Lambda (Node.js 20.x, TypeScript)
  • Operational Database: Amazon DynamoDB (Single-Table Design, On-Demand Capacity)
  • Real-Time Communication: AWS AppSync Events (WebSockets)
  • Cloud SDK: AWS SDK for JavaScript v3 ( @aws-sdk/client-dynamodb ,  @aws-sdk/lib-dynamodb )



AWS Architecture

The application is architected around serverless AWS primitives to eliminate idle server costs and provide managed scalability:
┌───────────────────────┐
│ CLIENT BROWSER │
│ (React 19 / Vite SPA) │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ AWS AMPLIFY HOSTING │
│ (Global Edge CDN) │
└───────────┬───────────┘
│
┌────────────────────────────────┴────────────────────────────────┐
│ HTTPS REST Calls │ WebSockets Real-Time
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ AMAZON API GATEWAY │ │ AWS APPSYNC EVENTS │
│ (HTTP API CORS) │ │ (Channel: /pickups/*)│
└──────────┬───────────┘ └──────────▲───────────┘
│ │
▼ Lambda Proxy │
┌─────────────────────────────────────────────────────────────┐ │ Publish
│ AWS LAMBDA ROUTER │ │ Event
│ ┌──────────────┬──────────────────┬───────────────────────┐ │ │
│ │ Auth Handler │ Pickup Lifecycle │ Material Recovery Flow│ │────────────┘
│ └──────────────┴──────────────────┴───────────────────────┘ │
└──────────────────────────────┬──────────────────────────────┘
│
▼ Read / Write
┌───────────────────────────┐
│ AMAZON DYNAMODB │
│ (Single-Table: "Recyvia") │
└───────────────────────────┘
  1. The client browser loads the static single-page application from AWS Amplify Hosting.
  1. State mutations (creating pickups, accepting jobs, verifying OTPs, submitting scale weights, updating recovery batches) are sent as HTTPS requests to Amazon API Gateway.
  1. API Gateway proxies the requests directly to AWS Lambda, which executes business validation, checks state transitions, and reads/writes from Amazon DynamoDB.
  1. When a lifecycle event occurs, the Lambda handler publishes the domain event to AWS AppSync Events via HTTP.
  1. AppSync Events broadcasts the payload over an active WebSocket connection to all subscribed browser clients on the  /pickups/*  namespace, updating customer, collector, and recycler views in real time.



How We Used AWS

AWS Amplify

We used AWS Amplify Hosting to deploy, manage, and distribute the React/TypeScript frontend. Amplify serves the compiled production build across AWS edge locations with automated HTTPS/TLS. Because Recyvia is a Single Page Application with client-side routing ( /request-pickup ,  /my-pickups ,  /transactions ), we configured custom rewrite rules in Amplify to route non-file requests to  /index.html , preventing 404 errors on direct navigation and page reloads.

Amazon API Gateway

Amazon API Gateway serves as the entry point for the REST API layer. We deployed an HTTP API with built-in Cross-Origin Resource Sharing (CORS) configured to handle incoming HTTP requests ( GET ,  POST ,  OPTIONS ). API Gateway utilizes a zero-overhead Lambda proxy integration, passing the complete HTTP event context (path parameters, headers, and request body) directly to our backend handler.

AWS Lambda

Our serverless compute layer consists of a unified Node.js 20.x TypeScript handler running in AWS Lambda. The handler acts as a stateless request router that dispatches incoming calls to specific sub-services:
  • Authentication: Managing the 6-digit OTP verification flow and demo fallback credentials.
  • Pickup Lifecycle Service: Enforcing single-direction state progression ( REQUESTED  ->  MATCHING  ->  ACCEPTED  ->  ON_THE_WAY  ->  ARRIVED  ->  OTP_VERIFICATION  ->  COLLECTING  ->  WEIGHT_VERIFICATION  ->  PAYMENT_PENDING  ->  COMPLETED ).
  • Recovery Service: Tracking the downstream intake, conveyor sorting, and completion stages for recycling facilities.
  • Transaction Ledger: Persisting completed pickup records, weighed items, and calculated settlement values.

Amazon DynamoDB

We designed the persistence layer using a Single-Table Design pattern in Amazon DynamoDB with a single table named  Recyvia . Configured with On-Demand capacity ( PAY_PER_REQUEST ), the database incurs zero cost when idle and automatically scales during usage bursts. All entities share common compound keys:
  • Partition Key ( pk ): High-cardinality prefixes distinguishing entity types (e.g.,  USER#<id> ,  COLLECTOR#<id> ,  PICKUP#<id> ,  TRANSACTION#<id> ,  RECOVERY#<id> ).
  • Sort Key ( sk ): Contextual descriptors ( PROFILE  or  META ).
This pattern allows point-in-time item lookups by entity ID with sub-10ms response times, alongside deterministic prefix scans for operational lists.

AWS AppSync Events

To eliminate continuous client polling and ensure immediate UI synchronization between customers, collectors, and recyclers, we utilized AWS AppSync Events. We configured an Event API with API Key authentication and a channel namespace of  /pickups/* . When a collector accepts a job or verifies an OTP, the backend publishes a lightweight domain event ( PICKUP_ACCEPTED ,  OTP_VERIFIED , etc.), which AppSync instantly pushes to connected clients via WebSockets.

AWS SDK for JavaScript

Within our Lambda handlers, we utilized the official AWS SDK for JavaScript v3 ( @aws-sdk/client-dynamodb  and  @aws-sdk/lib-dynamodb ). The DynamoDB Document Client simplifies data marshaling, allowing our TypeScript services to interact with DynamoDB items using native JavaScript objects.



What Fought Back

Building an end-to-end multi-role system under hackathon timelines came with distinct technical hurdles:

1. Enforcing Multi-Party State Consistency

A waste collection workflow involves physical interactions (a collector arriving at a doorstep, inspecting materials, and weighing scrap). Ensuring that the digital state strictly matched physical reality required rigid validation. We had to ensure that collectors could not enter verified weights without passing the 6-digit OTP verification stage, and that completed pickups could not be re-accepted or modified once finalized. Writing deterministic state-machine validators on both the backend and client-side was essential to prevent illegal state transitions.

2. Real-Time WebSockets Subprotocol Authentication

Integrating AWS AppSync Events from a browser client without heavy external client libraries required adhering to the standard AppSync event WebSocket subprotocol. The connection requires passing custom headers formatted as  aws-appsync-event-ws  alongside a base64-encoded URL-safe JSON string containing the API key and host. Debugging subprotocol handshakes, ping/pong heartbeats, and reconnect backoff intervals gave us a deep understanding of managed WebSocket transport layers.

3. Bridging Doorstep Collection to Facility Recovery

Initially, our project treated pickup completion as the end of the user journey. However, in a genuine circular economy, doorstep collection is only the first half of the process—the collected material must physically move to a recycling partner. Designing the schema and data flow so that completing a pickup automatically instantiates a downstream  RecoveryRecord  with status  AVAILABLE  required structuring shared entity identifiers and updating facility views in real time.

4. SPA Route Rewrites on CloudFront / Amplify

When deploying the frontend to AWS Amplify, direct navigation to URLs such as  /my-pickups  or  /request-pickup  initially yielded HTTP 404 errors. Because client-side routing is managed in the browser by React, CloudFront CDN edge servers looked for non-existent physical directories. Diagnosing and configuring the regular expression rewrite rule in Amplify Hosting to route non-file requests to  /index.html  resolved client routing across all browser reloads.



What We Learned

  1. A Complete Product Requires Backend Integrity: A slick frontend interface is only half the battle. Without robust server-side validation, error handling, and persistent data structures, client applications remain fragile demo prototypes.
  1. Deterministic State Machines Prevent Chaos: In multi-user workflows involving handoffs between independent parties, explicitly defining allowable state transitions ( currentStatus -> nextStatus ) prevents race conditions and corrupted data states.
  1. Real-Time Architecture Demands Resilient Reconnection: WebSockets are powerful, but cellular connections on doorstep collection routes are inherently prone to drops. Applications must implement exponential backoff reconnection and reconcile authoritative state from the database upon reconnecting.
  1. Serverless Composability: Combining purpose-built AWS managed services—Amplify for edge delivery, API Gateway for ingress, Lambda for compute, DynamoDB for storage, and AppSync for pub/sub—allows a small team to build an enterprise-grade cloud architecture with zero server maintenance overhead.



Built With AWS

  • AWS Amplify Hosting
  • Amazon API Gateway
  • AWS Lambda
  • Amazon DynamoDB
  • AWS AppSync Events
  • AWS SDK for JavaScript v3



The Idea Behind Recyvia

Our core philosophy is simple:
  • Request: Give waste generators transparent scrap pricing, convenient scheduling, and identity protection.
  • Collect: Provide informal collectors with real-time job availability, digital scale verification, and immediate settlement clarity.
  • Recover: Ensure collected materials have a traceable downstream destination at certified recovery and processing facilities.
By using cloud-native AWS architecture to organize this three-way coordination, Recyvia demonstrates how serverless technology can address everyday environmental and logistical challenges.



Closing

Building Recyvia for the WeMakeDevs Bharat Builds First Commit hackathon was an invaluable engineering experience. It challenged us to think beyond isolated frontend components and design a cohesive, end-to-end cloud platform. We are grateful to the WeMakeDevs community and AWS for fostering an environment where developers can build practical, scalable software that addresses real-world challenges across Bharat.


#Recyvia #AWS #AmazonWebServices #AWSCommunity #AWSBuilders #AWSBuild #AWSIndia #WeMakeDevs #WeMakeDevsIndia #BharatBuilds #FirstCommit #AWSFirstCommit #Serverless #ServerlessComputing #CloudComputing #CloudNative #AWSAmplify #Amplify #AWSLambda #Lambda #DynamoDB #AmazonDynamoDB #APIGateway #AmazonAPIGateway #AppSync #AppSyncEvents #AWSSDK #React #ReactJS #TypeScript #JavaScript #Vite #WebDevelopment #SoftwareEngineering #BackendDevelopment #FullStackDevelopment #CloudArchitecture #CloudDevelopment #Realtime #RealtimeApplications #EventDrivenArchitecture #WasteManagement #WasteCollection #Recycling #RecyclableWaste #WasteRecycling #CircularEconomy #Sustainability #SustainableTechnology #GreenTech #TechForGood #ClimateTech #Innovation #Hackathon #HackathonProject #StudentDeveloper #StudentDevelopers #IndianDevelopers #IndiaTech #BuildInPublic #LearnInPublic #DeveloperCommunity #OpenSource #Technology
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article