AWS Builder Center

build and pitch hackathon winning strategy: learned ones

hackathon experience

Project Overview
  • Name: QuickBite
  • Goal: Connect local restaurants, hungry customers, and delivery drivers with live map tracking and instant order updates.
  • Team Size: 4 developers
  • Tech Stack: React Native (frontend), Node.js with Express (backend), PostgreSQL (relational data), Redis (caching and pub/sub), and Socket.io (real-time communication).


System Design Architecture
[Customer / Driver App]
│
▼ (WebSockets / HTTP)
[API Gateway / Load Balancer]
│
├────────────────────────┐
▼ ▼
[Order / User Service] [Delivery / GPS Tracking Service]
│ │
▼ ▼
[PostgreSQL Database] [Redis In-Memory (Pub/Sub)]

Core Components
  1. API Gateway: Acts as the single entry point, routing requests to appropriate backend microservices and handling basic rate limiting.
  1. Order Service (PostgreSQL): Handles transactional data like user accounts, restaurant menus, and order states (Placed, Preparing, Out for Delivery, Delivered). We used relational tables with ACID compliance to ensure no payments or orders were lost.
  1. Tracking Service (Redis): Handles high-frequency GPS coordinate updates from delivery drivers. Instead of writing every GPS ping to a heavy SQL database, we stored active driver coordinates in Redis using Geo-spatial data structures for blazing-fast reads and writes.
  1. Real-Time Communication (Socket.io): Maintains persistent WebSocket connections between the server, customer, and driver to push live order status changes and map marker shifts.


Key Technical Challenges & Solutions
1. High-Frequency Location Pings
  • The Problem: 50 active drivers sending GPS coordinates every 5 seconds would flood a standard relational database with 600 writes per minute, causing lag.
  • The Solution: We offloaded live location tracking to Redis. Coordinates were updated in an in-memory key-value store, and only the final delivery route was saved to PostgreSQL once the order finished.
2. Race Conditions in Order Assignment
  • The Problem: Multiple nearby drivers might accept the same unassigned delivery request at the exact same millisecond.
  • The Solution: We implemented atomic operations using Redis locks ( SET NX  command). The first driver to trigger the request successfully locks the order ID, rejecting concurrent accept attempts instantly.
3. Scaling WebSocket Connections
  • The Problem: A single Node.js process struggled to keep thousands of persistent socket connections open while handling API queries.
  • The Solution: We decoupled the chat/tracking socket layer from the main REST API server, ensuring that a spike in map viewing did not block user checkout requests.


Hackathon Takeaways & Lessons Learned
  • Keep the DB Simple: Avoid complex multi-table joins during a tight deadline; denormalize data slightly if it speeds up read times for the demo.
  • Mock Gracefully: When third-party APIs (like payment gateways or map routing services) fail or rate-limit during a demo, fallback mock scripts save the presentation.
  • Prioritize the Critical Path: We made sure the "Customer places order → Restaurant accepts → Driver delivers" loop worked flawlessly before adding nice-to-have features like ratings or chat.
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