Skip to content

NewdlDewdl/TheraBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

466 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TherapyBridge

AI-powered therapy session transcription and analysis platform

Transform therapy sessions into actionable insights with automatic transcription, speaker diarization, and intelligent analysis.


πŸš€ Quick Start (Local Development)

Prerequisites

  • Node.js 20+
  • Supabase account (free tier)
  • OpenAI API key

Setup

  1. Clone and install

    git clone <your-repo>
    cd "peerbridge proj/frontend"
    npm install
  2. Configure environment

    # Edit frontend/.env.local with your credentials:
    # - NEXT_PUBLIC_SUPABASE_URL
    # - NEXT_PUBLIC_SUPABASE_ANON_KEY
    # - OPENAI_API_KEY
  3. Set up Supabase

    • Create project at supabase.com
    • Run supabase/schema.sql in SQL Editor
    • Copy URL and anon key to .env.local
  4. Run development server

    npm run dev

    Open http://localhost:3000/patient/dashboard-v3


πŸ“¦ Deployment (Hackathon-Ready)

Deploy in 10 minutes: See RAILWAY_DEPLOYMENT.md

Stack:

  • βœ… Railway - Next.js hosting + backend support ($5 FREE credit)
  • βœ… Supabase - PostgreSQL + file storage (FREE)
  • ⚠️ OpenAI - Whisper API + GPT-4 (~$0.40 per session)

Why Railway over Vercel: Transparent pricing, no dark patterns, developer-first platform


✨ Features

Patient Dashboard

  • Session Timeline - Chronological view of all therapy sessions
  • AI Chat (Dobby) - Ask questions about your therapy journey
  • Notes & Goals - Track progress and treatment plans
  • Progress Patterns - Visualize mood and topic trends
  • Upload Page - Drag-drop audio files for processing

Audio Processing

  • Automatic Transcription - OpenAI Whisper API (accurate, fast)
  • Speaker Diarization - Identify Therapist vs. Client
  • Session Analysis - GPT-4 extracts:
    • Overall mood/tone
    • Main topics discussed
    • Key insights
    • Action items
    • Brief summary

Real-Time Progress

  • Live progress bar during processing
  • Status polling every 2 seconds
  • Estimated completion time

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js 16 + React 19         β”‚
β”‚   (Deployed on Railway)         β”‚
β”‚   - App Router                  β”‚
β”‚   - Server Components           β”‚
β”‚   - API Routes                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β”œβ”€β–Ί Supabase
            β”‚   - PostgreSQL (sessions, users, notes)
            β”‚   - Storage (audio files)
            β”‚   - Row Level Security
            β”‚
            └─► OpenAI APIs
                - Whisper (transcription)
                - GPT-4 (analysis)

Database Schema

Core Tables:

  • users - Therapists and patients
  • patients - Extended patient info
  • therapy_sessions - Session metadata + results
  • session_notes - AI-extracted clinical notes
  • treatment_goals - Goal tracking

Storage:

  • audio-sessions bucket - Uploaded audio files

Project Structure

peerbridge proj/
β”œβ”€β”€ frontend/                      # Next.js application
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/                   # Serverless API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ upload/            # File upload endpoint
β”‚   β”‚   β”‚   β”œβ”€β”€ process/           # Audio processing
β”‚   β”‚   β”‚   β”œβ”€β”€ status/[id]/       # Status polling
β”‚   β”‚   β”‚   └── trigger-processing/ # Async trigger
β”‚   β”‚   └── patient/dashboard-v3/  # Main dashboard
β”‚   β”‚       β”œβ”€β”€ upload/            # Upload page
β”‚   β”‚       └── components/        # UI components
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ supabase.ts            # Supabase client + types
β”‚   β”‚   └── api-client.ts          # API helpers
β”‚   └── package.json
β”‚
β”œβ”€β”€ audio-transcription-pipeline/  # Original pipeline (reference)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pipeline.py            # CPU/API pipeline
β”‚   β”‚   └── pipeline_gpu.py        # GPU pipeline (legacy)
β”‚   └── ui-web/                    # React UI (reference)
β”‚
β”œβ”€β”€ supabase/
β”‚   └── schema.sql                 # Database schema
β”‚
β”œβ”€β”€ DEPLOYMENT.md                  # Deployment guide
└── README.md                      # This file

Quick Start

Each project is self-contained with its own:

  • Virtual environment (venv/)
  • Dependencies (requirements.txt)
  • Configuration (.env, .python-version)
  • Tests and documentation

Run Pipeline:

cd audio-transcription-pipeline
source venv/bin/activate
python tests/test_full_pipeline.py

Run Backend:

cd backend
source venv/bin/activate
uvicorn app.main:app --reload

Documentation

  • Master documentation: Project MDs/TherapyBridge.md (start here!)
  • Organization rules: .claude/CLAUDE.md
  • Orchestration methodology: .claude/DYNAMIC_WAVE_ORCHESTRATION.md
  • Pipeline docs: audio-transcription-pipeline/README.md
  • Backend docs: backend/README.md
  • Frontend docs: frontend/README.md

Environment Setup

Each project needs its own .env file:

Pipeline:

cd audio-transcription-pipeline
cp .env.example .env
# Edit .env with your OpenAI and HuggingFace keys

Backend:

cd backend
cp .env.example .env
# Edit .env with your database URL and OpenAI key

Repository Organization

This repo follows strict organization rules (see .claude/CLAUDE.md):

  • Minimize file count
  • One README per component
  • No implementation plans (execute and delete)
  • No duplicate configs
  • Value over volume

Tech Stack

  • Transcription: OpenAI Whisper API / faster-whisper (GPU)
  • Diarization: pyannote.audio 3.1
  • Backend: FastAPI + PostgreSQL (Neon)
  • AI Extraction: OpenAI GPT-4o
  • Frontend: Next.js 16 + React 19 + Tailwind CSS

Development

Each project has independent development:

  • Separate virtual environments
  • Separate dependencies
  • Separate test suites
  • Can be deployed independently

License

Proprietary - TherapyBridge Project

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published