SugarSense is a AI-Powered mobile-first diabetes tracking app built with Next.js, React, Tailwind CSS, and Zustand. It helps users log glucose readings, insulin doses, meals, moods, and symptoms, then turns that data into readable trends, charts, and AI-supported insights.
This project is local-first by default. Data is stored in the browser, the UI is optimized for phones, and the app includes light/dark mode, English/Arabic support, backup/restore, and an AI assistant with safety guardrails.
- Glucose tracking with meal relation, notes, and automatic low/normal/high status
- Insulin logging with dose type, time, and units
- Meal and wellness tracking for richer pattern analysis
- Dashboard with alerts, summaries, and quick actions
- History and statistics views with charts and filtering
- AI insights for patterns, food impact, predictive alerts, mood correlation, and chat
- Floating AI chat on the home page
- Theme support: light and dark
- Localization: English and Arabic
- Backup and restore via JSON
- Local persistence with Zustand +
localStorage
The AI features are designed to stay educational and observational only.
- No diagnosis
- No replacement for doctors
- No insulin dose prescriptions
- No dangerous medical instructions
- Next.js 16 App Router
- React 19
- TypeScript
- Tailwind CSS 4
- Zustand
- Recharts
- React Hook Form
- i18next
- Lucide React
- Today’s glucose and insulin overview
- Alerts for high and low readings
- Notification bell for alert summaries
- Quick jump to AI patterns
- Floating AI chat widget
- Add glucose readings
- Add insulin doses
- Add meals
- Add wellness entries
- Browse saved entries
- Filter and search records
- Review glucose, insulin, meals, and wellness logs
- Daily, weekly, and monthly trends
- Time-in-range and distribution views
- Visual charts for glucose patterns
- Pattern Detection
- Food Impact Analysis
- Predictive Alerts
- Emotional / Mood Correlation
- AI Chat Assistant
- Node.js 18+
- pnpm recommended
pnpm installpnpm devOpen http://localhost:3000.
pnpm build
pnpm startCreate .env.local with your AI provider settings.
Example:
GROQ_API_KEY=your_key_here
GROQ_MODEL=llama-3.1-8b-instantCurrent AI route supports:
GROQ_API_KEYGROQ_MODELGROQ_BASE_URLQWEN_API_KEYas a fallback key name
The API route currently uses an OpenAI-compatible chat-completions endpoint.
Backup and restore are available from Settings.
Export includes:
- glucose
- insulin
- meals
- wellness
- settings
Restore writes data back into the persisted local stores and reloads the app.
app/ Next.js routes, layouts, API
components/ Reusable UI and feature components
lib/ Types, utilities, AI helpers, stores, i18n
public/ Static assets, icons, manifest
styles/ Additional styling assets
- This app is not a medical device.
- Data is stored locally in the browser unless you extend the project with a backend.
- AI quality depends on the completeness of logged glucose, meal, insulin, and wellness data.
- Rate limits depend on the configured provider.
pnpm dev
pnpm build
pnpm start
pnpm lint- Provider switching for Groq / Qwen-compatible / OpenRouter / Gemini
- Local caching for AI insight requests
- Better export formats like PDF
- Optional cloud sync
- Push reminders and wearable integrations
HabebaEhab dev