- Add 3-message intro (self-intro → empathetic ack → new/existing question) via single TwiML response to guarantee delivery order - Detect reschedule intent from first message; look up existing appointment date - New patient flow: ask insurance type → MassHealth consent → member ID + DOB → Selenium eligibility check - Post-eligibility: active → ask appointment date/time with office-hours validation; inactive → ask other insurance or collect contact info - Date/time collection mirrors reschedule flow: check office day open, ask time, validate against office hours - Auto-create appointment in schedule for known patients on confirmation; use first available staff member - Add openPhoneReply toggle (Settings → AI Chat) to respond to any number at any time - Add 5-minute inactivity timeout: reset conversation to initial stage and clear pending state - Normalize MassHealth DOB to zero-padded MM/DD/YYYY before Selenium submission - Expand isExistingPatient classifier to recognize "old patient", "old", "previous", "prior" - Existing patient confirmation message now acknowledges patient type before asking about insurance Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dental Manager - Starter
A monorepo setup to manage both Backend and Frontend of the Dental Manager application.
🖥️ Setup Guide (Fresh Machine)
Follow these steps in order after cloning the repository.
Step 1 — Clone the repository
git clone <your-repo-url>
cd DentalManagementMHAprilgg
Step 2 — Install Node.js
Required to run the Backend and Frontend.
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify
node -v # should print v20.x.x
npm -v
Step 3 — Install Python
Required to run the Selenium and OCR services.
sudo apt-get install -y python3 python3-pip python3-venv
# Verify
python3 --version # should print 3.10 or higher
Step 4 — Install Chrome
Required for the Selenium service to control a browser.
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable
# Verify
google-chrome --version
The
webdriver-managerpackage (included inrequirements.txt) automatically downloads the matching ChromeDriver — no manual driver setup needed.
Step 5 — Install PostgreSQL
Primary database for the application.
sudo apt-get install -y postgresql postgresql-contrib
sudo systemctl enable postgresql
sudo systemctl start postgresql
# Create the database the app uses
sudo -u postgres psql -c "CREATE DATABASE dentalapp OWNER postgres;"
# Set the postgres user password to match packages/db/.env
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'mypassword';"
Enable password authentication over TCP
By default Debian uses scram-sha-256 or peer auth for local connections, which blocks password login. Switch to md5:
sudo sed -i 's/scram-sha-256/md5/g' /etc/postgresql/*/main/pg_hba.conf
sudo systemctl restart postgresql
Verify
psql -U postgres -d dentalapp -h 127.0.0.1 -W
# Enter: mypassword
# You should see: dentalapp=#
The
DATABASE_URLinpackages/db/.envis already set to:DATABASE_URL="postgresql://postgres:mypassword@localhost:5432/dentalapp"
Step 6 — Install Redis
Used as the job queue for Selenium and OCR background tasks.
sudo apt-get install -y redis-server
sudo systemctl enable redis-server
sudo systemctl start redis-server
# Verify
redis-cli ping # should print: PONG
Step 7 — Install Node.js dependencies
npm install
Step 8 — Install Python dependencies
Python dependencies are installed automatically by npm install (Step 7) via each service's postinstall script. Each service creates its own .venv virtual environment — no manual pip commands needed.
This approach is required on Debian 13+ where system-wide pip installs are blocked (PEP 668).
Step 9 — Set up environment variables
Copy the .env.example files and fill in the required values.
npm run setup:env
Step 10 — Set up the database
# Run migrations
npm run db:migrate
# Generate Prisma types
npm run db:generate
# Insert seed data
npm run db:seed
Step 11 — Configure nginx
The repo includes nginx.conf in the project root. Install it as the active site config:
sudo cp nginx.conf /etc/nginx/sites-available/dental-app
sudo ln -sf /etc/nginx/sites-available/dental-app /etc/nginx/sites-enabled/dental-app
sudo nginx -t && sudo systemctl reload nginx
Important: The
/api/location block must includeproxy_set_header Authorization $http_authorization;Without it, nginx strips the Authorization header and the backend returns "Access denied. No token provided."
Step 12 — Run the app
Open two terminals:
Terminal 1 — Backend + Frontend:
npm run dev
On first boot the server automatically seeds all AI chat templates, SMS templates, and greeting messages for every user — no manual configuration needed.
Terminal 2 — Selenium service:
cd apps/SeleniumService
.venv/bin/python3 agent.py
📖 Developer Documentation
- Setting up server environment — the first step, to run this app in environment.
- Development Hosts & Ports — which app runs on which host/port
This is a Turborepo. What's inside?
Apps and Packages
apps/Backend— Express.js API serverapps/Frontend— React + Vite frontendapps/SeleniumService— Python FastAPI service for browser automation (insurance eligibility, claims)apps/PaymentOCRService— Python service for payment OCR extraction@repo/eslint-config— shared ESLint configuration@repo/typescript-config— sharedtsconfig.jsons
Each package/app is 100% TypeScript (except the Python services).
Utilities
- Tailwind CSS for styles
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting