NexaCare: Your AI-Integrated Health Compass
✨ Inspiration
Navigating healthcare today feels like solving a puzzle with missing pieces. Between fragmented insurance data, difficult-to-find clinics, and the friction of manual scheduling, patients are often overwhelmed. We were inspired to build NexaCare to bridge this gap—creating a "single pane of glass" for healthcare that combines AI recommendations with a seamless, one-click booking experience.
🤔 What it does
NexaCare is a comprehensive health management platform:
- AI Health Compass: Recommends clinics and pharmacies based on real-time location and insurance benefits.
- Seamless Booking: Directly integrates with the Google Calendar API to schedule appointments from within the UI.
- Unified Health Profile: Uses Firebase Firestore to securely store and synchronize patient data across sessions.
- Proactive AI Assistant: Leverages Claude 3.5 Haiku to answer health-related queries and navigate complex benefits.
🛠️ How I built it
- Frontend: A modern React application styled with vanilla CSS, utilizing Framer Motion for smooth modal transitions and React Leaflet for interactive mapping.
- Backend: A high-performance FastAPI (Python) server that handles secure API proxying and OAuth2 flows.
- Infrastructure: Firebase Auth for identity management and Firestore for real-time document sync.
- Integrations:
- Google Calendar API: Implemented a robust server-side OAuth2 flow with PKCE $(Proof Key for Code Exchange)$.
- Anthropic API: Proxied through the backend to ensure API keys never reach the client-side.
🚧 Challenges we ran into
The journey was filled with complex engineering puzzles:
1. The Timezone Trap
One of the most persistent bugs was the "4-hour offset" in calendar events. We realized that simple ISO strings are often misinterpreted across different server/client environments. We solved this by implementing a strict normalization pipeline: $$T_{final} = \text{Localize}(T_{naive}, \text{'America/Toronto'}) \rightarrow \text{ConvertToUTC}(T_{localized}) + \text{'Z'}$$ By enforcing UTC on the server and using explicit "Zulu" timestamps, we eliminated all synchronization errors.
2. OAuth2 & PKCE Mismatches
Securing the Google Calendar integration required a precise implementation of the PKCE flow. We faced (invalid_grant) errors due to code verifier mismatches between the authorization and token exchange steps. We resolved this by centralizing the flow on the backend and ensuring the hash was correctly calculated as: $$Code_Challenge = \text{Base64UrlEncode}(\text{SHA256}(Code_Verifier))$$
🎓 What I learned
- The Nuances of Time: Timezones are not just offsets; they are dynamic entities. Localizing to a specific
ZoneInfobefore normalizing to UTC is the only way to ensure "wall time" consistency. - State Management at Scale: Synchronizing local React state with remote Firestore documents while maintaining a snappy UI requires careful use of
useEffectand custom hooks.
🚀 What's next for NexaCare
We plan to integrate Telehealth Video directly into the platform and expand our AI to analyze insurance EOB (Explanation of Benefits) documents, providing even deeper financial clarity for patients.
Log in or sign up for Devpost to join the conversation.