Inspiration

We’ve all been there: you’re deep in a complex coding session, the "flow state" is at its peak, and then—life happens. A phone call, a knock at the door, or a quick coffee break. When you sit back down, the "activation energy" required to rebuild that mental map is immense.

I built nudge because focus is the most fragile resource we have. I wanted a "Butler" that didn't just nag me with lists, but one that could actually archive my mental state and give it back to me when I was ready to resume.


What it does

Nudge isn't just another to-do list; it’s a high-performance cognitive toolkit designed to protect your deep work:

  • The Intent Engine (The Brain): I implemented a sophisticated NLU (Natural Language Understanding) layer using Gemini. The Butler doesn't just "read" text; it classifies user input into four distinct intents: Intel, Tasks, Assets, and Capsules.
  • Intelligent Task System: Beyond a simple checkbox, I built a smart task manager. The Butler extracts actionable deadlines from natural language (e.g., "Remind me to push the code in 2 hours"). I implemented the logic to transform these relative times into precise database timestamps, ensuring you never miss a mission.
  • Context Capsules: This is the flagship "save-point" feature. I built a system where users snap a photo of their environment paired with a technical note. This creates a visual and logical restore point in the PostgreSQL database for instant mental recovery.
  • The Asset Vault: A relational archive for the physical world. I used Serverpod’s ORM to build a secure vault for tracking physical items and their warranties. The Butler tracks the "expiry" of your physical assets so you don't have to.
  • Ghost Focus Mode: A specialized UI overlay I designed to visually isolate the user from digital noise, locking the focus on the mission defined by the Butler.

How we built it

The architectural backbone of nudge is a "Single-Language Monolith" approach. By utilizing Serverpod 3 alongside Flutter, I eliminated the "Context Switching" that usually plagues full-stack development. I didn't have to switch between JavaScript/Python for the backend and Dart for the frontend; the entire mental model remained in Dart.

1. The Serverpod Orchestration (The Backbone)

Serverpod acted as the "Command Center" for the Butler:

  • The Protocol Engine: I defined my core business logic—Task, Asset, ContextCapsule, and NudgeResponse—using Serverpod's YAML protocol files. The Automatic Code Generation then created perfectly typed Dart classes and client-side mirrors.
  • ORM & Relational Database: I used Serverpod’s built-in Object Relational Mapper to manage a PostgreSQL database. This allowed me to perform complex database queries using pure Dart code, maintaining strict type safety.
  • Authentication & Session Management: Every request is handled via a Serverpod Session, allowing for server-side logging and error tracking to monitor the AI's "thought process."

2. The Flutter Client (The Interface)

The Flutter application serves as the "Senses" of the Butler:

  • Native Integration: Utilized hardware access to capture high-fidelity images for Context Capsules.
  • State Management & UI: Built a reactive UI that updates in real-time. The Ghost Focus Mode uses custom Flutter painters to create a distraction-free, immersive overlay.
  • Cloud Connectivity: Used the generated Client library to establish a secure link to the Serverpod Cloud backend.

3. The AI Integration

The "Brain" of the Butler lives entirely on the server to ensure security and performance:

  • Server-Side Intent Extraction: The Flutter app sends raw text to a Serverpod Endpoint, which communicates with the Gemini using engineered prompts to extract structured JSON.
  • The Safety Governor: A logic layer that parses the AI's response. If the AI identifies a "Task," the server calculates the timestamp; if it's an "Asset," it prepares a database entry.

4. DevOps & Deployment

  • Dockerized Development: Used Docker to maintain a local PostgreSQL environment mirroring production.
  • Serverpod Cloud: Deployed the backend using scloud, providing a global, SSL-secured API endpoint and a live production database.

Challenges we ran into

  • Hardware & Environment Hurdles: Early in the hackathon, I faced significant issues setting up the Android Studio emulator. Rather than wasting precious hours troubleshooting, I pivoted immediately and conducted the entire development cycle directly on a physical Android device. This forced me to deal with real-world constraints like network latency and hardware camera access from day one.
  • JSON Reliability: Forcing an LLM to consistently return structured data for the Intent Engine required rigorous prompt engineering and the implementation of a "Safety Governor" logic to handle malformed responses.

limitations

As a hackathon prototype, we prioritize transparency regarding our current implementation:

  • System Alarm Restrictions (Android): While logic is architected, we encountered strict OS-level restrictions regarding the Android Alarm Manager API. System-level alarms are currently disabled to ensure stability.
  • Web Platform Notifications: Due to browser-level security and permission "handshake" issues, push notifications are not currently active on the Web platform.
  • The Notification Silence: Currently, the Butler communicates primarily through the in-app interface. The final delivery of local push notifications remains a "Future Scope" item.
  • Gemini API Rate Limiting (Free Tier): Powered by the Gemini Free Tier, the API may return a 429 Too Many Requests error if requests are sent in rapid succession.
  • Demo Optimization: To ensure judges see the AI loop without waiting 3 hours, the "Task" and "Asset" logic provides instant feedback rather than delayed scheduling.

Accomplishments that we're proud of

  • Pivoting Under Pressure: Successfully managing the entire development cycle on a physical Android device ensured the app was optimized for actual hardware early on.
  • The "Butler" Intelligence: Implementing a reliable Intent Engine was a massive win, ensuring Gemini consistently returns structured data my backend can act upon.
  • The Context Capsule System: Bridging the gap between mobile camera hardware and a persistent PostgreSQL database to create a "mental save-point" for the user.
  • Unified Dart Mastery: Mastering the Serverpod 3 ecosystem to build a complete full-stack system where the frontend and backend share the same logic and models.

What we learned

  • The "Hacker Spirit" in Debugging: Facing emulator issues taught us to be adaptable, leading us to discover the critical importance of usesCleartextTraffic configurations for local development.
  • Infrastructure Mastery: Navigating Serverpod Cloud, managing live migrations, and debugging cloud startup logs provided us with a "production-first" mindset.
  • The Efficiency of Context: We learned that "resuming" work is often harder than "doing" it. This inspired our technical formula for the project:

Maximizing this ratio through Context Capsules became our guiding principle.


What's next for NUDGE

  • The "Social Sentry" (Close Ones Calling): A feature monitoring interaction patterns with your "Inner Circle," triggering a "Connection Alarm" if you've been isolated too long.
  • The Bookmark Librarian: A Serverpod Browser Extension to sync bookmarks and suggest relevant reading during your "mean time" (low-activity slots).
  • Hydration Intelligence: A managed 3-Hour Water Cycle using Serverpod’s background scheduling to ensure persistent hydration and prevent brain fog.
  • The Emergency SOS (Safety Mailing): Automatically trigger an email to a trusted contact if the Butler detects complete inactivity during a high-stakes mission.
  • Automated Asset OCR: Implementing Google ML Kit on the frontend to scan physical receipts and warranties directly into the Asset Vault.
  • The "Ghost" Ecosystem: Expanding Ghost Focus Mode into a full suite of desktop and mobile integrations that "lock down" distracting apps via OS-level integration.
  • Voice-First Interaction: Implementing Speech-to-Text processing so you can "whisper" a mission to your Butler while your hands are busy.

Built With

Share this project:

Updates