Refactor into modular architecture with Supabase integrationf - #46
Open
RomeoJackson199 wants to merge 4 commits into
Open
Refactor into modular architecture with Supabase integrationf#46RomeoJackson199 wants to merge 4 commits into
RomeoJackson199 wants to merge 4 commits into
Conversation
- Added 5 function tools: lookup_patient, check_availability, book_appointment, cancel_appointment, get_patient_appointments - Integrated with DentiBot voice-call-ai Edge Function - Patient lookup on call start using caller ID - Updated system prompt for dental receptionist workflow - Added Supabase environment variables
… testing - Extract config, logging, tools, prompts, routes, and services into src/ modules - Add structured logging with pino (Fastify-native) replacing console.log - Add input validation for phone numbers, dates, and TwiML injection prevention - Add OpenAI WebSocket reconnection logic (up to 2 retries with backoff) - Add Supabase fetch timeout via AbortController (configurable) - Add graceful shutdown on SIGTERM/SIGINT - Add safer JSON parsing with error recovery for function call arguments - Add ESLint config, .editorconfig, and npm scripts (start, dev, lint, test) - Add 27 tests using Node.js built-in test runner (node:test) - Make all hardcoded values configurable via environment variables https://claude.ai/code/session_01Se6xgYt2AtSNkYkwAjVK7E
Author
|
g |
RomeoJackson199
marked this pull request as draft
February 14, 2026 12:18
RomeoJackson199
marked this pull request as ready for review
February 14, 2026 12:18
RomeoJackson199
marked this pull request as draft
February 14, 2026 12:20
RomeoJackson199
marked this pull request as ready for review
February 14, 2026 12:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the monolithic voice assistant application into a modular, production-ready architecture with support for Supabase backend integration, comprehensive configuration management, and test coverage.
Key Changes
Architecture & Code Organization
index.jsinto separate route modules (health.js,incoming-call.js,media-stream.js) with a central route registryconfig.jswith environment variable management, validation, and frozen object pattern for immutabilitytools.jsfor maintainabilityBackend Integration
supabase-client.jswith:Prompt & System Design
prompts.jswith dynamic prompt generation including current date and clinic-specific instructionsTesting & Quality
.editorconfigfor consistent formattingConfiguration & Documentation
.env.example: Documented all configuration options with sensible defaultspackage.json: Added npm scripts (start, dev, lint, test) and updated descriptionMedia Stream Improvements
Notable Implementation Details
https://claude.ai/code/session_01Se6xgYt2AtSNkYkwAjVK7E