# neha150803/scriptural-sentiment-text-analyzer-final architecture

> Architecture diagram of the GitHub repository neha150803/scriptural-sentiment-text-analyzer-final, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neha150803/scriptural-sentiment-text-analyzer-final
- Repository: https://github.com/neha150803/scriptural-sentiment-text-analyzer-final

## Overview

This is a Next.js scripture sentiment-analysis frontend and API proxy. Users submit text or a PDF; the UI posts to a route, which forwards to a configurable backend and falls back to mock results when unavailable. Results expose word statistics and ML, VADER, and TextBlob sentiment, with comparison views, charts, and JSON/CSV/PDF downloads. The README describes a broader Python/pandas/NLTK analyzer, but no such implementation appears in the supplied tree; backend analysis internals are therefore represented only as an external service. The graph follows shown calls and documented capabilities.

Main entry points: [`app/page.tsx`](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/page.tsx) (Analysis workspace), [`components/analysis-results.tsx`](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/analysis-results.tsx) (Analysis results), [`components/file-upload.tsx`](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/file-upload.tsx) (PDF upload), [`components/text-input.tsx`](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/text-input.tsx) (Text entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Analysis Inputs"]
  node_home["Analysis workspace<br/>[page.tsx]"]
  node_text["Text entry<br/>[text-input.tsx]"]
  node_file["PDF upload<br/>[file-upload.tsx]"]
end

subgraph group_api["API and Analysis"]
  node_textapi["Text prediction route<br/>[route.ts]"]
  node_fileapi["File prediction route<br/>[route.ts]"]
  node_mock["Demo result data<br/>[mock-data.ts]"]
end

subgraph group_results["Result Views"]
  node_result["Analysis results"]
  node_stats["Text statistics"]
  node_comparison["Model comparison"]
  node_charts["Sentiment charts"]
  node_exports["Result exports"]
end

subgraph group_ui["Interface Components"]
  node_tabs["Input mode tabs<br/>[tabs.tsx]"]
  node_cards["Card primitives<br/>[card.tsx]"]
  node_buttons["Button primitive<br/>[button.tsx]"]
  node_layout["Application layout<br/>[layout.tsx]"]
end

node_user(("Scripture analyst"))
node_backend{{"Sentiment backend"}}

node_user -->|"opens"| node_home
node_home -->|"renders"| node_tabs
node_home -->|"renders"| node_text
node_home -->|"renders"| node_file
node_text -->|"posts text"| node_textapi
node_file -->|"posts PDF"| node_fileapi
node_textapi -->|"forwards text"| node_backend
node_fileapi -->|"forwards file"| node_backend
node_textapi -->|"fallback data"| node_mock
node_fileapi -->|"fallback data"| node_mock
node_text -->|"sets results"| node_home
node_file -->|"sets results"| node_home
node_home -->|"renders results"| node_result
node_result -->|"renders"| node_stats
node_result -->|"renders"| node_comparison
node_result -->|"renders"| node_charts
node_result -->|"provides downloads"| node_exports
node_home -->|"renders"| node_cards
node_result -->|"renders"| node_cards
node_file -->|"uses"| node_buttons
node_layout -.->|"wraps page"| node_home

click node_home "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/page.tsx"
click node_text "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/text-input.tsx"
click node_file "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/file-upload.tsx"
click node_textapi "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/api/sentiment/predict-text/route.ts"
click node_fileapi "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/api/sentiment/predict-file/route.ts"
click node_mock "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/lib/mock-data.ts"
click node_result "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/analysis-results.tsx"
click node_stats "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/statistics-cards.tsx"
click node_comparison "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/model-comparison.tsx"
click node_charts "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/sentiment-charts.tsx"
click node_exports "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/analysis-results.tsx"
click node_tabs "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/tabs.tsx"
click node_cards "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/card.tsx"
click node_buttons "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/button.tsx"
click node_layout "https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/layout.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_text,node_file toneBlue
class node_textapi,node_fileapi,node_mock toneAmber
class node_result,node_stats,node_comparison,node_charts,node_exports toneMint
class node_tabs,node_cards,node_buttons,node_layout toneRose
class node_user,node_backend toneIndigo
```

## Components

### Analysis Inputs

- [Analysis workspace](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/page.tsx): `app/page.tsx`
- [Text entry](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/text-input.tsx): `components/text-input.tsx`
- [PDF upload](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/file-upload.tsx): `components/file-upload.tsx`

### API and Analysis

- [Text prediction route](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/api/sentiment/predict-text/route.ts): `app/api/sentiment/predict-text/route.ts`
- [File prediction route](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/api/sentiment/predict-file/route.ts): `app/api/sentiment/predict-file/route.ts`
- [Demo result data](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/lib/mock-data.ts): `lib/mock-data.ts`

### Result Views

- [Analysis results](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/analysis-results.tsx): `components/analysis-results.tsx`
- [Text statistics](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/statistics-cards.tsx): `components/statistics-cards.tsx`
- [Model comparison](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/model-comparison.tsx): `components/model-comparison.tsx`
- [Sentiment charts](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/sentiment-charts.tsx): `components/sentiment-charts.tsx`
- [Result exports](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/analysis-results.tsx): `components/analysis-results.tsx`

### Interface Components

- [Input mode tabs](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/tabs.tsx): `components/ui/tabs.tsx`
- [Card primitives](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/card.tsx): `components/ui/card.tsx`
- [Button primitive](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/components/ui/button.tsx): `components/ui/button.tsx`
- [Application layout](https://github.com/neha150803/scriptural-sentiment-text-analyzer-final/blob/main/app/layout.tsx): `app/layout.tsx`

### Other components

- **Scripture analyst**
- **Sentiment backend**

## Connections

- Scripture analyst → Analysis workspace: opens (evidence: `app/page.tsx`)
- Analysis workspace → Input mode tabs: renders (evidence: `app/page.tsx`)
- Analysis workspace → Text entry: renders (evidence: `app/page.tsx`)
- Analysis workspace → PDF upload: renders (evidence: `app/page.tsx`)
- Text entry → Text prediction route: posts text (evidence: `components/text-input.tsx`)
- PDF upload → File prediction route: posts PDF (evidence: `components/file-upload.tsx`)
- Text prediction route → Sentiment backend: forwards text (evidence: `app/api/sentiment/predict-text/route.ts`)
- File prediction route → Sentiment backend: forwards file (evidence: `app/api/sentiment/predict-file/route.ts`)
- Text prediction route → Demo result data: fallback data (evidence: `app/api/sentiment/predict-text/route.ts`)
- File prediction route → Demo result data: fallback data (evidence: `app/api/sentiment/predict-file/route.ts`)
- Text entry → Analysis workspace: sets results (evidence: `app/page.tsx`)
- PDF upload → Analysis workspace: sets results (evidence: `components/file-upload.tsx`)
- Analysis workspace → Analysis results: renders results (evidence: `app/page.tsx`)
- Analysis results → Text statistics: renders (evidence: `components/analysis-results.tsx`)
- Analysis results → Model comparison: renders (evidence: `components/analysis-results.tsx`)
- Analysis results → Sentiment charts: renders (evidence: `components/analysis-results.tsx`)
- Analysis results → Result exports: provides downloads (evidence: `components/analysis-results.tsx`)
- Analysis workspace → Card primitives: renders (evidence: `app/page.tsx`)
- Analysis results → Card primitives: renders (evidence: `components/analysis-results.tsx`)
- PDF upload → Button primitive: uses (evidence: `components/file-upload.tsx`)
- Application layout → Analysis workspace: wraps page
