How 777natalie/groupg_cs4273capstone works
Project Type and Purpose
• Type: Full-stack web application (React frontend + FastAPI backend).
• Purpose: Receive EMS call transcripts, apply rule-based grading against an EMS protocol CSV, and display results for quality assurance and training.
File Structure
• Top-level directories:
• frontend/ – React + Vite UI
• backend/ – Python FastAPI API and grading logic
• Call_Files/ – raw audio (.wav) files (for testing)
• backend/data/ – protocol CSV and prebuilt index JSONs
• backend/schema/ – pydantic models
• Key files:
• frontend/src/api.js – HTTP helper
• EMS_CallAnalyzer.py – core rule-based grading
• api.py – FastAPI app exposing /analyze endpoint
• EMS-Calltaking-QA.csv – reference protocol questions
README Insights
• Workflow: Upload transcript → POST to /analyze → analyzer compares against CSV → returns asked/missed/coverage → frontend renders results.
• Future: AI grading layer, secure on-premise deployment (not yet in scope).
Main Components & Their Relationships
a. User Interface (Browser)
• React app pages (Upload, Results, History, Dispatchers).
b. Frontend Client
• Vite dev server (localhost:3000)
• Components call api.js → HTTP POST to backend.
c. API Layer (FastAPI)
• /analyze endpoint
• Receives transcript text or parsed lines.
d. Grading Engine
• EMS_CallAnalyzer.py + TranscriptExtractQ.py
• Loads EMS-Calltaking-QA.csv
• Compares token overlap, applies rules.
e. Data Storage
• CSV file (protocols) in backend/data
• Optional JSON index files in backend/data/db_indexing
• Transcripts stored temporarily or in memory
f. Response Models
• schema/models.py defines Pydantic schemas for result payload
g. (Future) AI Module
• Plug-in point for AI-based grading
Architectural Patterns & Principles
• Layered architecture: Presentation → API → Business Logic → Data.
• Single-responsibility: separate analyzer logic from HTTP handling.
• File-based “database”: simple CSV + JSON stores, no external RDBMS.
• Modular frontend: page-based routing, reusable components.
Technologies & Frameworks
• Frontend: React, Vite, JavaScript/JSX, CSS modules
• Backend: Python 3.9+, FastAPI, Pydantic, Uvicorn
• Data: CSV protocols, JSON vector/index stores
• (Planned) AI: future integration with NLP/LLM