Skip to content

ThePygmalion/synpacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SynPacs

A radiology transcription and reporting platform that combines real-time medical transcription with AI-powered report generation.

Documentation

The canonical docs live in ../Documentation/:

  • Start here: ../Documentation/README.md
  • Architecture: ../Documentation/Architecture.md
  • Database: ../Documentation/Database.md
  • Credits: ../Documentation/Credits.md
  • Admin: ../Documentation/Admin.md
  • Templates: ../Documentation/Templates.md
  • Pipeline: ../Documentation/Pipeline.md
  • ASR: ../Documentation/ASR.md
  • Testing: ../Documentation/Testing.md
  • Self-hosting: ../Documentation/SelfHosting.md

Features

  • Real-time Medical Transcription: Voice-to-text transcription using advanced ASR (Automatic Speech Recognition) technology
  • AI-Powered Report Generation: Automated radiology report generation from clinical notes using LLM technology
  • Template Management: Flexible template system supporting multiple modalities (CT, MRI, USG, X-Ray)
  • Session Management: Organize and manage radiology reporting sessions with Supabase backend
  • Multi-modality Support: Support for CT, MRI, Ultrasound, and X-Ray imaging modalities
  • Template-driven Reports: Deterministic, template-driven report generation that preserves structure while filling content
  • Safety Validation: Built-in validation to catch contradictions and ensure clinical accuracy

Tech Stack

  • Frontend: SvelteKit 5 + TypeScript + Tailwind CSS
  • Backend: SvelteKit API routes (serverless)
  • Database: Supabase (PostgreSQL + Auth + Storage + Realtime)
  • AI/ML: DeepInfra, Soniox ASR
  • Deployment: Railway

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Supabase project (Auth + Postgres)

Installation

From the repository root:

cd frontend
npm install

Environment variables

Create frontend/.env (you can copy from frontend/env.example).

Required:

# Supabase
PUBLIC_SUPABASE_URL=
PUBLIC_SUPABASE_ANON_KEY=

# LLM (at least one)
GROQ_API_KEY=
# DEEPINFRA_API_KEY=

# ASR (Soniox)
SONIOX_API_KEY=

Database migrations (Supabase)

Apply the migration in frontend/supabase-migrations/001_production_saas_setup_v2.sql (SQL editor or Supabase CLI).

At minimum this creates:

  • user_preferences
  • credit_transactions
  • usage_analytics
  • credit functions like deduct_credits_atomic() and grant_credits_admin()

Run the dev server

npm run dev

Open http://localhost:5173.

Build + preview (prod-like)

npm run build
npm run preview

Preview runs on http://localhost:4173.

Electron

npm run electron

Development

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run test - Run Playwright tests
  • npm run test:unit - Run unit tests with Vitest
  • npm run check - Type check with svelte-check
  • npm run lint - Lint code
  • npm run format - Format code with Prettier
  • npm run electron - Run Electron app
  • npm run electron:build - Build Electron app

Testing

# E2E
npm run test

# Unit
npm run test:unit

Project Structure

frontend/
├── src/
│   ├── lib/
│   │   ├── pipeline/          # Report generation pipeline
│   │   ├── llm/              # LLM client abstraction
│   │   ├── asr/              # ASR transcription
│   │   ├── templates/        # Template management
│   │   └── ...
│   ├── routes/               # SvelteKit routes
│   └── ...
├── static/                   # Static assets
└── tests/                    # Test files

Key Components

Report Generation Pipeline

The system uses a multi-stage pipeline for generating radiology reports:

  1. Template Canonicalization: Parses and normalizes report templates
  2. Reasoner: Extracts findings and derives clinical implications using LLM
  3. Composer: Fills template structure with generated content
  4. Validation: Ensures structural and semantic correctness
  5. Assembly: Final report assembly and formatting

Transcription

  • Real-time voice transcription using Soniox ASR
  • Post-processing for medical terminology normalization
  • Voice Activity Detection (VAD) for optimal transcription quality

License

MIT License

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors