Skip to content

A smart break tracker app for orthodontic patients using AI-powered advice

License

Notifications You must be signed in to change notification settings

patrikrek/dentalpause

Repository files navigation

DentalPause

🦷 A smart break tracker app for orthodontic patients using AI-powered advice

What is DentalPause?

DentalPause is a web application designed to help orthodontic patients manage their daily breaks and track progress with their aligners or braces. The app provides personalized AI-powered advice using Google's Gemini API and integrates with MongoDB for secure data storage.

Key Features:

  • 📊 Track dental pause sessions (automatic or manual logging)
  • 🤖 AI-powered daily advice based on your progress
  • 🔐 Secure authentication with JWT tokens
  • ⚙️ Customizable settings (patient name, gender, aligner details)
  • 📈 Progress tracking by aligner stage
  • 🔔 Optional app reminders

Run Locally

Prerequisites: Node.js

  1. Install dependencies: npm install
  2. Set the GEMINI_API_KEY in .env.local to your Gemini API key
  3. Run the app: npm run dev

Backend (Express + MongoDB Atlas)

  1. Copy .env.example to .env and set:
    • MONGODB_URI for your MongoDB Atlas cluster
    • JWT_SECRET for signing auth tokens
    • Optional: PORT (defaults to 5000) and CLIENT_ORIGIN (allowed frontend origin)
    • Optional frontend helpers: VITE_API_BASE_URL (defaults to http://localhost:5000/api) and VITE_GEMINI_API_KEY fallback if you don't want the key in settings
  2. Start the API server: npm run server
  3. Available endpoints (all prefixed with /api):
    • POST /auth/register – body { email, password }
    • POST /auth/login – body { email, password }
    • GET /settings – requires Authorization: Bearer <token>
    • PUT /settings – body { geminiApiKey?: string, aiAdviceEnabled?: boolean } with the same Authorization header
    • GET /sessions – returns sessions of the logged-in user
    • POST /sessions/start – starts an active break
    • POST /sessions/stop – ends an active break
    • POST /sessions/manual – adds a manual entry { startTime, endTime }
    • GET /advice/today – returns Gemini advice based on today's sessions (requires API key)

Frontend Connection to Backend

  • Login/registration is performed via the API; JWT is stored in localStorage.
  • In settings, you can enter your Gemini API key, name, and gender, and enable/disable AI advice (saved in MongoDB for your account).
  • If you prefer to use a global key instead of settings, set VITE_GEMINI_API_KEY in .env.local; the backend also has a fallback to GEMINI_API_KEY.
  • Additionally, you can set the start date of aligner wear, number of brackets for upper/lower arch, change day/time, enable in-app reminders, and track progress by arch in History.
  • AI advice also uses bracket progress (percentages by arch) for more personalized responses.

About

A smart break tracker app for orthodontic patients using AI-powered advice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published