AWS Builder Center

Building MechOnWay: An On-Demand Roadside Assistance Platform on AWS Serverless

Discover how MechOnWay connects stranded motorists with nearby mobile mechanics in minutes across India using AWS Amplify, Amazon API Gateway, AWS Lambda on ARM64 Graviton, and Amazon DynamoDB with zero idle infrastructure costs.

Student

πŸš— Building MechOnWay: How I Architected an On-Demand Roadside Assistance Platform on AWS Serverless

By Prateek Yadav | Built for the WeMakeDevs "First Commit" Hackathon β€” Bharat Builds Tour 2026

ο»Ώ

🌟 The Problem: Stranded on the Highway

Picture this: It's late evening on the Yamuna Expressway or a remote stretch of a national highway, and suddenly your vehicle's engine overheats or a tire punctures.
In India, emergency roadside assistance has historically been broken. Drivers face frantic phone calls to unverified local numbers, opaque waiting times of 2–3 hours, and predatory towing surcharges. On the other side, skilled local mechanics lack a digitized dispatch system to discover and accept nearby emergency calls fairly.
As a Computer Science Engineering student participating in the WeMakeDevs "First Commit" Hackathon (Bharat Builds Tour 2026), I set out to solve this by building MechOnWay β€” an intelligent, on-demand roadside assistance platform built for Bharat and deployed 100% on AWS Serverless infrastructure.

ο»Ώ

🎯 What MechOnWay Does

MechOnWay is an Uber/Linear-inspired, two-sided emergency dispatch platform:
  1. Customer Dispatch Flow: Stranded motorists can log a roadside emergency in under 45 seconds without pre-registration or subscription fees.
  1. Intelligent Matching Engine: Computes spherical Haversine geographical distances in real time, matching the driver with the nearest available technician whose service rig matches the vehicle’s specific constraints (e.g., EV auxiliary battery booster, heavy hydraulic winch, motorcycle tire plug kit).
  1. Mechanic Partner Workbench: Certified technicians receive live dispatch work orders with customer telephone privacy masking and step-by-step lifecycle actions.
  1. $0 Map Infrastructure: Interactive route visualization and tracking built on client-side Leaflet + OpenStreetMap, eliminating expensive third-party map API bills.

ο»Ώ

πŸ—οΈ Production Architecture on AWS

To compete in the "Ship It" track, MechOnWay was engineered not just as a local prototype, but as a production-live cloud platform running in AWS Asia Pacific Mumbai (Β ap-south-1Β ):
  • AWS Amplify Hosting (Frontend & Global Edge): The frontend is built with Next.js 16 (App Router), React 19, and Tailwind CSS v4. It is continuously deployed using AWS Amplify Hosting connected directly to our GitHub repository. Amplify automatically handles SSL certificates and global edge caching through Amazon CloudFront CDN.
  • Amazon API Gateway (HTTP API v2): For our API routing layer, we chose HTTP API v2 over classic REST APIs. HTTP APIs provide ultra-low latency (<50ms) and cost approximately 70% less. It handles CORS preflight options and routes all Β /api/*Β  endpoints cleanly to our Lambda function.
  • AWS Lambda on ARM64 Graviton: Our entire backend compute (Zod validation, Haversine matching calculations, and state transitions) runs on a single serverless Lambda function using Node.js 20 on ARM64 Graviton2. Setting Β Architectures: - arm64Β  in our AWS SAM template reduced cold start latency to under 180ms, while distance calculations execute in less than 25ms with $0 idle compute cost.
  • Amazon DynamoDB (On-Demand / PAY_PER_REQUEST): All assistance requests and technician statuses are stored across two DynamoDB tables (Β MechOnWay-Requests-devΒ  and Β MechOnWay-Mechanics-devΒ ). Using on-demand capacity ensures automatic scaling with zero capacity planning, while Global Secondary Indexes (Β StatusCreatedAtIndexΒ  and Β StatusRatingIndexΒ ) deliver sub-10ms queries.
  • AWS SAM (Serverless Application Model): The entire cloud infrastructure is defined as code in Β template.yamlΒ . Using the open-source AWS SAM CLI, building and deploying reproducible CloudFormation stacks requires just two commands (Β sam buildΒ  and Β sam deployΒ ).

ο»Ώ

⚑ Key Engineering Challenges & Solutions

1. The Proximity Matching Algorithm

Traditional dispatch systems often fail when matching the wrong vehicle (e.g., sending a motorcycle puncture tech to jumpstart an electric vehicle). Our Lambda matching engine evaluates spherical Haversine distance, calculates realistic arrival times based on 35 km/h transit speeds, and enforces a 75 km regional emergency guard.

2. Strict Central Finite State Machine (FSM)

To avoid race conditions or invalid order jumps (such as marking an order "Completed" before the mechanic even "Arrived"), I implemented an immutable 8-stage state machine:
SEARCHING βž” MATCHED βž” REQUESTED βž” ACCEPTED βž” ON_THE_WAY βž” ARRIVED βž” IN_SERVICE βž” COMPLETED └────────────────── CANCELLED (Permitted from non-terminal states) β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. Stale Dispatch Auto-Recovery

In live environments, technicians can become locked if an old test request is never completed. I engineered a 60-minute auto-expiry sweep that automatically recovers stranded dispatches and returns mechanics to available standby status.

ο»Ώ

πŸ§ͺ Testing & Quality Assurance

Reliability in emergency software is non-negotiable. MechOnWay maintains a 100% test pass rate:
  • 108 Automated Unit & Integration Tests covering API Gateway payloads, Haversine accuracy, phone masking regex, and FSM transition safety.
  • 0 ESLint Errors / 0 Warnings.
  • Clean Next.js 16 Turbopack production builds.

ο»Ώ

πŸ’‘ What I Learned from Building on AWS

  1. Serverless is a Superpower for Hackathons: In under 48 hours, I was able to build and ship an enterprise-grade backend without spending hours configuring Linux servers, NGINX reverse proxies, or SSL certificates.
  1. Graviton (ARM64) is an Immediate Win: Switching from x86_64 to ARM64 in AWS Lambda was a single-line configuration change in SAM that immediately improved compute speed and reduced cost.
  1. On-Demand DynamoDB Eliminates Stress: For real-world applications with spiky traffic patterns, DynamoDB on-demand pricing removes all the guesswork of capacity provisioning.

ο»Ώ

🌐 Live Links & Open Source

Special thanks to WeMakeDevs and the AWS team for hosting the Bharat Builds Tour 2026!
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