Inspiration
During emergencies, power outages, or natural disasters, the first thing to fail is often connectivity, but the need for food sharing and mutual aid increases. Most community and food-sharing apps assume reliable internet access, which makes them unusable exactly when they are needed most.
We wanted to design something more realistic: a system that works both in normal conditions and failure conditions. Knit was inspired by the idea that communities are strongest when they can rely on each other, not just centralized infrastructure. If neighbors are physically nearby, they should still be able to share resources, even if the cloud is unreachable.
What it does
Knit is an AI-powered, hybrid online/offline food-sharing app that allows neighbors to share surplus food and household resources in real time.
When the internet is available, users can post items to a city-wide feed backed by Supabase with realtime updates.
When the internet is unavailable, the app automatically switches to local peer-to-peer sharing using Bluetooth and Wi-Fi Direct.
Posts are still discoverable by nearby users, even during outages.
The app uses AI to:
Identify and categorize food items (when online)
Assign a risk tier (high, medium, low) that determines how long a post should stay active
Each post expires automatically based on spoilage risk, ensuring the feed stays relevant and safe.
How we built it
Knit is built as an Android-only React Native app using a bare workflow to allow native system access.
Core technologies:
React Native + TypeScript for the mobile app
Supabase for authentication, database storage, and realtime updates
Google Nearby Connections for offline peer-to-peer communication
Gemini AI (online) for food recognition and classification
Zustand / Context for lightweight state management
Architecture highlights:
A transport router dynamically decides whether data should be sent via Supabase (online), Nearby Connections (offline), or both (hybrid).
A custom Kotlin native module bridges Google Nearby Connections into React Native.
A TTL (time-to-live) system automatically removes expired posts based on food risk.
A presence system tracks nearby devices using lightweight heartbeats.
The result is a system that gracefully degrades instead of failing.
Challenges we ran into
Bridging native Android APIs into React Native required careful handling of lifecycle events, permissions, and payload size limits.
Managing connectivity state transitions without confusing the user was non-trivial—especially switching cleanly between online, offline, and hybrid modes.
Designing a system that works without user accounts, yet still supports interest requests and responses, required pseudonymous identity handling.
Battery and permission constraints forced us to optimize Nearby Connections usage to avoid draining the device or breaking Android background rules.
Accomplishments that we're proud of
Building a real hybrid network that works both online and offline
Successfully integrating Bluetooth mesh networking into a React Native app
Designing an app that continues to function during outages
Implementing AI in a way that improves usability without becoming a single point of failure
Creating a system that prioritizes resilience, safety, and real-world constraints
What we learned
Resilience requires designing for failure from the start—not as an afterthought.
Offline-first or hybrid systems introduce complexity, but dramatically increase reliability.
AI is most effective when paired with strong fallbacks instead of hard dependencies.
Clear user feedback during connectivity changes is just as important as the underlying technology.
What's next for Knit
Expand to iOS using Multipeer Connectivity
Improve AI classification accuracy and offline inference
Add trust signals and lightweight reputation systems
Support non-food resources (medicine, supplies, tools)
Explore use cases in disaster response and campus safety networks
Built With
- gemini
- google-nearby-connections
- kotlin
- react
- reactnative
- supabase
- typescript
- zustand
Log in or sign up for Devpost to join the conversation.