The Spark of Inspiration
Walking through modern suburban neighborhoods, a striking architectural duality becomes apparent: rooftops covered with solar arrays, driveways holding high-capacity electric vehicle (EV) batteries, and home offices packed with idle processing power. Yet, these infrastructure investments exist as isolated islands. If a neighbor experiences a localized brownout or needs sudden high-performance AI compute nodes to render a complex model, there is no fluid, friction-free mechanism to trade these fractional physical assets locally.
Our inspiration for GridShare was born out of this exact inefficiency. We envisioned a decentralized physical infrastructure network (DePIN) marketplace that treats local energy and computing power as a shared liquidity pool. We set out to build an app where your home battery, solar array, or workstation could autonomously negotiate trades with your neighbors' devices, executing micro-transactions entirely on autopilot.
How We Built GridShare
Building a system capable of managing rapid, real-time telemetry from thousands of consumer IoT components meant avoiding traditional, heavy relational database clusters or expensive persistent server architectures. We designed a hyper-scalable, entirely serverless stack powered by Amazon DynamoDB and Vercel.
1. Data Modeling & The DynamoDB Moat
High-frequency IoT devices send continuous streams of connection pings, status metrics, and resource availability snapshots. To ingest this without astronomical writing and processing costs, we deployed a NoSQL Single-Table Design.
Every telemetry frame targets a precise key configuration: Partition Key \( PK = \text{NODE#}{NodeId} \) and Sort Key \( SK = \text{PING#}{Timestamp} \). Inside each record, we evaluate localized dynamic surge pricing based on the immediate micro-market balance:
$$P_{\text{unit}} = P_{\text{base}} \times \left( \frac{D_{\text{local}}}{S_{\text{local}}} \right)^{\gamma}$$
Where \( P_{\text{unit}} \) represents the real-time resource cost per unit, \( D_{\text{local}} \) is neighborhood demand, \( S_{\text{local}} \) is available node supply, and \( \gamma \) is a volatility scaling exponent.
The Free Storage Hack: To keep data storage costs flat, every ping is stamped with a Time-To-Live (TTL) attribute set to \( T_{\text{current}} + 86400 \) seconds (24 hours). DynamoDB natively sweeps and wipes out expired pings from our storage tier completely free of charge, completely avoiding heavy cron-clearing processes or costly query deletions.
2. Instantaneous UI Updates via Streams
When a local node drops below a safety threshold (e.g., home battery storage capacity \( C_{\text{avail}} < 20\% \)), an immediate write modification happens on the database table. DynamoDB Streams intercepts this modification instantly and invokes a globally distributed Vercel Edge Function. The Edge Function processes the delta change and broadcast-pushes the market shift directly to neighboring consumers' map UIs via WebSockets instantly.
3. Frontend Generation with Vercel v0
Using Vercel v0, we crafted a mobile-first, dark-mode P2P dashboard. It provides the "Grandma Test" accessibility layer for what is otherwise highly technical infrastructure, providing simple toggle bars for "Auto-Pilot Mode", real-time localized demand heatmaps, and streaming earnings graphs.
What We Learned
This hackathon expanded our horizon regarding the capabilities of serverless architectures when applied to real-world edge hardware. We learned that NoSQL database design is not just a storage system, but a highly effective compute orchestration engine when paired with native streaming mechanisms. We mastered paged-state UI synchronization and realized that hiding deep infrastructural complexities beneath a dead-simple B2C interface increases consumer user adoption dramatically.
The Challenges We Faced
The path was not without roadblocks. Managing race conditions when multiple buyers attempted to secure a single, rapidly depleting EV charging slot required strict conditional expressions inside our DynamoDB writes. We had to ensure transactions only committed if the record matched specific conditional thresholds:
$$\text{Status} = \text{"AVAILABLE"} \quad \text{AND} \quad \text{Capacity}_{\text{current}} \ge \text{RequestedAmount}$$
Additionally, simulating thousands of mock IoT hardware devices concurrently pinging our API endpoints threatened to throttle our local test clients. We overcame this by building an asynchronous, lightweight event emitter script running inside an edge worker wrapper to cleanly simulate active neighborhood grid activities.
Judge Appeal & Future Vision
GridShare serves as a blueprint for cost-efficient infrastructure systems. By turning architectural limitations into structural advantages through DynamoDB TTL and rapid event streaming, we achieved high-velocity micro-trading mechanics with a minimal operational footprint. In the future, we hope to establish GridShare as an open innovation protocol, allowing smart appliances everywhere to plug, play, and monetize autonomously.
Built With
- amazon-dynamodb
- next.js
- no-sql
- single-table-design
- tailwing-css
- typescript
- vercel-v0
- websockets
Log in or sign up for Devpost to join the conversation.