How kushall-j-4/sagar-ai-poc works
Purpose and Runtime
SAGAR is a static, client-side Next.js demo illustrating conversion of government webpage content into Schema.org/JSON-LD-style semantic data and the resulting improvement to AI answers. It has no real ingestion, AI, database, or backend service; all displayed processing and graph data are static/demo state.
Runtime: Next.js 14 App Router, React, TypeScript, Tailwind CSS, and Lucide icons. Production output is a static export intended for GitHub Pages.
Application Entry and Shell
The App Router entry point is app/page.tsx, which owns the guided multi-screen demo flow and likely switches between the input, comparison, AI-answer, and processing views. app/layout.tsx provides the shared document/layout boundary, while app/globals.css establishes global visual styling.
Paths:
• app/page.tsx
• app/layout.tsx
• app/globals.css
Stage 1: Government URL Intake
The initial UI captures a government-site URL as the conceptual source material for semantic processing. This is a presentation/input boundary rather than a network integration: the URL advances the demo but does not invoke a scraping or processing backend.
Paths:
• app/page.tsx
• app/components/SourceView.tsx
Stage 2: Semantic Schema Transformation
The schema-comparison view presents the central product claim: unstructured/current source representation is transformed into an AI-readable semantic structure based on standards such as Schema.org and JSON-LD. This is visualized client-side from predefined data, not generated dynamically.
Paths:
• app/components/SchemaComparisonView.tsx
• app/page.tsx
Stage 3: Citizen/AI Answer Comparison
The citizen-question stage contrasts AI results derived from ordinary webpage content with results supported by structured semantic data. It represents the consumer-facing outcome of the transformation pipeline and remains isolated from external LLM APIs.
Paths:
• app/components/CitizenQuestionView.tsx
• app/page.tsx
Stage 4: Processing Pipeline and Knowledge Graph
The backend-process view visualizes the conceptual internal pipeline—source processing, semantic extraction/structuring, and knowledge-graph representation. Interactive graph nodes are a frontend visualization boundary; there is no persisted graph database, processing worker, or API behind it.
Paths:
• app/components/BackendProcessView.tsx
• app/page.tsx
Deployment Boundary
The application is configured as a static Next.js export, so the build produces HTML/CSS/JS deployable without a Node server. GitHub Actions handles deployment to GitHub Pages on repository pushes; deployment-specific behavior is documented separately.
Paths:
• .github/workflows/deploy.yml
• next.config.js
• DEPLOYMENT.md
Main entry points: page.tsx Demo flow controller · layout.tsx Document shell · SourceView.tsx Government URL intake · SchemaComparisonView.tsx Schema comparison
Components 15
Guided Demo UI
Client-side screens coordinated by the App Router page.
- Document shell
app/layout.tsx - Demo flow controller · Owns guided multi-screen navigation and static demo state.
app/page.tsx - Global styles
app/globals.css - Government URL intake · Captures a conceptual source URL without network ingestion.
app/components/SourceView.tsx - Schema comparison · Shows predefined unstructured versus Schema.org/JSON-LD representations.
app/components/SchemaComparisonView.tsx - AI answer comparison · Contrasts static ordinary-content and semantic-data answer examples.
app/components/CitizenQuestionView.tsx - Pipeline and graph view · Visualizes conceptual processing and an interactive knowledge graph.
app/components/BackendProcessView.tsx
Conceptual Demo Flow
Static visualized stages; no live processing services.
- Source webpage content · Demo-only representation of government content.
- Semantic structure · Static AI-readable structured-data representation.
- Improved AI answer · Illustrated consumer-facing result, not an LLM response.
- Knowledge graph · Frontend-only graph representation with no persistence layer.
Static Delivery
Static export and GitHub Pages deployment.
- Static export config · Configures production output for static hosting.
next.config.js - Static site output · Deployable assets requiring no Node server.
- GitHub Pages deploy · Deploys the static export on repository pushes.
.github/workflows/deploy.yml - Deployment guide
DEPLOYMENT.md
Connections 16
- Document shell → Demo flow controller: wraps
- Global styles → Document shell: styles
- Demo flow controller → Government URL intake: renders stage 1
- Demo flow controller → Schema comparison: renders stage 2
- Demo flow controller → AI answer comparison: renders stage 3
- Demo flow controller → Pipeline and graph view: renders stage 4
- Government URL intake → Source webpage content: illustrates
- Source webpage content → Semantic structure: conceptually transforms
- Schema comparison → Semantic structure: visualizes
- Semantic structure → Improved AI answer: supports
- AI answer comparison → Improved AI answer: compares
- Semantic structure → Knowledge graph: represented as
- Pipeline and graph view → Knowledge graph: visualizes
- Static export config → Static site output: produces
- Static site output → GitHub Pages deploy: deployed by
- Deployment guide → GitHub Pages deploy: documents