How mugilanm23/nlp-driven-personal-memory-assistant-with-real-time-alerts works
Purpose and Entry Points
A local personal reminder/memory assistant: a React SPA submits natural-language reminders and chat commands to an Express API, which persists reminders in MySQL, invokes Gemini or local parsing, and runs background alerts. Backend startup is backend/server.js; frontend bootstraps at frontend/src/main.jsx and renders frontend/src/App.jsx.
Client Application
The Vite/React single-page client provides the dashboard, reminder input, category filtering, chat companion, and browser-side audio alerts. It communicates with the backend REST endpoints and holds presentation/state logic primarily in:
• frontend/src/App.jsx
• frontend/src/App.css
• frontend/src/main.jsx
HTTP API and Application Boundary
Express routes separate transport concerns from application logic. Reminder CRUD and chat are exposed through reminder routes/controllers; memory analytics and filtered retrieval are exposed separately. This is the main client/server boundary:
• backend/server.js
• backend/routes/reminderRoutes.js
• backend/routes/memoryRoutes.js
• backend/controllers/reminderController.js
• backend/controllers/memoryController.js
Reminder Creation and Conversational Actions
Natural-language submission is handled by the reminder controller. It converts text into structured reminder attributes, creates database records, and supports chat-driven CREATE, UPDATE, and DELETE actions. Chat first reads active records to provide current context to the AI, then executes returned structured actions.
• backend/controllers/reminderController.js
• backend/services/geminiService.js
• backend/utils/parser.js
AI Parsing Resilience
geminiService is the Gemini-first integration for date/time, intent, priority, category, recurrence, and chat action extraction. The local parser is a degradation boundary: it preserves basic reminder creation when Gemini is unavailable, misconfigured, or fails.
• backend/services/geminiService.js
• backend/utils/parser.js
Persistence and Schema Evolution
MySQL is the system of record for reminders and their lifecycle states (PENDING, TRIGGERED, MISSED), schedules, recurrence, priority, and category. Database access is centralized through a connection pool; startup migration updates existing schemas without destructive reset.
• backend/config/db.js
• backend/config/schema.sql
• backend/config/migrate.js
Scheduler and Alert Delivery
A server-resident cron worker runs every minute, finds pending due reminders, marks severely overdue records missed, triggers reminders, and creates next instances for recurring schedules. Alert delivery crosses external/system boundaries: desktop notifications via the host OS and high-priority email via Gmail SMTP.
• backend/utils/cron.js
• backend/utils/email.js
• backend/server.js
Runtime and External Dependencies
The system uses Node.js/Express (Node 18+), React/Vite, and a locally reachable MySQL server. External integrations require Google Gemini API credentials and optional Gmail app-password SMTP credentials; desktop notifications depend on the runtime host’s notification support.
Main entry points: server.js Express server · cron.js Reminder scheduler · db.js Database pool · reminderController.js Reminder controller
Components 17
Client
- React dashboard · Dashboard, reminder input, filters, chat, and browser audio alerts.
frontend/src/App.jsx - Vite bootstrap
frontend/src/main.jsx
Backend
- Express server · Starts HTTP API, migrations, and scheduler.
backend/server.js - Reminder routes · Reminder CRUD and chat transport boundary.
backend/routes/reminderRoutes.js - Memory routes · Analytics and filtered-memory retrieval endpoints.
backend/routes/memoryRoutes.js - Reminder controller · Creates reminders and executes AI-derived chat actions.
backend/controllers/reminderController.js - Memory controller
backend/controllers/memoryController.js - Gemini integration · Extracts reminder fields, intent, and structured chat actions.
backend/services/geminiService.js - Local parser · Preserves basic reminder creation when AI parsing fails.
backend/utils/parser.js - Database pool · Centralized database connection access.
backend/config/db.js - Schema migration · Evolves existing schema without destructive reset.
backend/config/migrate.js - Reminder scheduler · Runs each minute to trigger, miss, and recur due reminders.
backend/utils/cron.js - Email delivery · Sends high-priority reminder emails.
backend/utils/email.js
External systems
- MySQL reminders · Stores reminder schedules, lifecycle, recurrence, priority, and category.
- Google Gemini
- Host notifications
- Gmail SMTP
Connections 19
- Vite bootstrap → React dashboard: renders
- React dashboard → Express server: REST requests
- Express server → Reminder routes: mounts
- Express server → Memory routes: mounts
- Express server → Schema migration: runs at startup
- Express server → Reminder scheduler: starts
- Reminder routes → Reminder controller: dispatches
- Memory routes → Memory controller: dispatches
- Reminder controller → Gemini integration: parses text and chat
- Gemini integration → Local parser: falls back on failure
- Gemini integration → Google Gemini: AI requests
- Reminder controller → Database pool: reads and writes reminders
- Memory controller → Database pool: queries memories
- Reminder scheduler → Database pool: finds and updates due records
- Schema migration → MySQL reminders: evolves schema
- Database pool → MySQL reminders: connection pool
- Reminder scheduler → Host notifications: desktop alerts
- Reminder scheduler → Email delivery: high-priority alerts
- Email delivery → Gmail SMTP: sends via SMTP