# ianpilon/dec-13-usertest-version architecture

> Architecture diagram of the GitHub repository ianpilon/dec-13-usertest-version, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ianpilon/dec-13-usertest-version
- Repository: https://github.com/ianpilon/dec-13-usertest-version

## Overview

##### Main Components

Frontend Layer:
- React Application (Vite + TypeScript)
- UI Components (shadcn-ui)
- Pages and Routing
- Hooks and Utils

API Layer:
- File Processing Endpoints
- Analysis Endpoints
- Transcription Service
- PDF Sharing Service

Backend Services:
- Claude AI Integration
- Whisper Model Integration
- PDF Processing Service
- File Storage System

##### Component Relationships

Frontend Components:
**[FileUpload] → [SummaryView] → [SharePDFModal]**
- ↓             ↓              ↓
**[API Layer Endpoints (analyze.ts, transcribe.ts, share-pdf.js)]**

API Integration Flow:
**[API Endpoints] → [Service Handlers] → [External Services]**

##### Specific Elements

Client Layer:
- Main React Application Container
- Component Modules (FileUpload, SummaryView, etc.)
- UI Component Library (shadcn-ui)
- State Management & Hooks

API Layer:
- REST Endpoints:
- /api/analyze
- /api/transcribe
- /api/share-pdf
- /api/extract-pdf

Services Layer:
- Claude AI Service Integration
- Whisper Model Integration
- PDF Processing Service
- File Storage System

##### Infrastructure Notes

Deployment-related aspects:
- Development Environment
- Production Environment
- Static Asset Handling
- API Route Handling

This architecture emphasizes the modern web application structure while highlighting the AI and file processing capabilities that make this project unique.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef frontend fill:#3b82f6,color:white
    classDef api fill:#22c55e,color:white
    classDef service fill:#a855f7,color:white
    classDef storage fill:#f97316,color:white
    classDef infrastructure fill:#6b7280,color:white

    subgraph Client["Client Layer"]
        ReactApp["React Application"]:::frontend
        FileUpload["File Upload Component"]:::frontend
        SummaryView["Summary View"]:::frontend
        SharePDF["Share PDF Modal"]:::frontend
        UILib["UI Components Library"]:::frontend
        CustomHooks["Custom Hooks"]:::frontend
        Utils["Utility Functions"]:::frontend
    end

    subgraph APILayer["API Layer"]
        AnalyzeAPI["Analysis Endpoint"]:::api
        TranscribeAPI["Transcription Endpoint"]:::api
        SharePDFAPI["PDF Sharing Endpoint"]:::api
        ExtractPDFAPI["PDF Extraction Endpoint"]:::api
    end

    subgraph Services["Services Layer"]
        ClaudeAI["Claude AI Service"]:::service
        WhisperModel["Whisper Model"]:::service
        PDFProcess["PDF Processing Service"]:::service
        FileStorage["File Storage System"]:::storage
    end

    %% Relationships
    ReactApp --> FileUpload
    ReactApp --> SummaryView
    ReactApp --> SharePDF
    ReactApp --> UILib
    ReactApp --> CustomHooks
    ReactApp --> Utils

    FileUpload --> AnalyzeAPI
    FileUpload --> TranscribeAPI
    SummaryView --> AnalyzeAPI
    SharePDF --> SharePDFAPI
    
    AnalyzeAPI --> ClaudeAI
    AnalyzeAPI --> PDFProcess
    TranscribeAPI --> WhisperModel
    SharePDFAPI --> FileStorage
    ExtractPDFAPI --> PDFProcess

    %% Click Events
    click ReactApp "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/App.tsx"
    click FileUpload "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/components/FileUpload.tsx"
    click SummaryView "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/components/SummaryView.tsx"
    click SharePDF "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/components/SharePDFModal.tsx"
    click UILib "https://github.com/ianpilon/Dec-13-UserTest-Version/tree/main/src/components/ui/"
    click AnalyzeAPI "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/pages/api/analyze.ts"
    click SharePDFAPI "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/api/share-pdf.js"
    click TranscribeAPI "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/pages/api/transcribe.ts"
    click ExtractPDFAPI "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/pages/api/extract-pdf.ts"
    click ClaudeAI "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/lib/claude.ts"
    click PDFProcess "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/lib/fileProcessing.ts"
    click WhisperModel "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/public/models/ggml-base.bin"
    click Utils "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/lib/utils.ts"
    click CustomHooks "https://github.com/ianpilon/Dec-13-UserTest-Version/blob/main/src/hooks/use-mobile.tsx"

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        APIEndpoint["API Endpoint"]:::api
        ServiceComp["Service Component"]:::service
        StorageComp["Storage Component"]:::storage
    end
```
