How mdyeasinsamadarnob/bfiu_app_web works
1. This is a Next.js App Router application, not just a static site. The top-level shell is in app/layout.tsx, global styling is in app/globals.css, and theme support is wired through components/ThemeProvider.tsx and components/ThemeToggle.tsx.
2. The app has three main user-facing surfaces: the landing page at app/page.tsx, an architecture browser at app/architecture/page.tsx, and a timeline view at app/timeline/page.tsx. These pages are mostly composition layers that assemble reusable components around preloaded content.
3. The architecture content is file-backed and organized as structured datasets under data/architecture.json, data/architecture_eaip-langgraph.json, data/architecture_eaip-orch.json, and data/architecture_eaip-rag.json, with TypeScript helpers in data/architectureData.ts. This suggests multiple architecture variants or scenarios are first-class in the UI.
4. The architecture visualization itself is componentized in components/architecture/ArchitectureNode.tsx, ArchitectureGroupNode.tsx, and likely uses components/HighlightableText.tsx for emphasis/search highlighting. The architectural diagram is therefore a presentational tree/group rendering layer over static model data, rather than a live modeling backend.
5. The timeline subsystem is similarly data-driven: data/timeline.json and data/timelineData.ts feed components/TimelineView.tsx and the app/timeline route. This is a separate content domain from the architecture model, but the same app shell and styling system are reused.
6. There is a chat assistant subsystem exposed through components/ChatInterface.tsx and app/api/chat/route.ts. That route is a server boundary for message processing, so the UI can talk to backend logic without embedding model calls directly in the client.
7. The presence of app/api/ollama-status/route.ts and lib/config.ts indicates the chat layer depends on an Ollama runtime being reachable and configurable. In architecture terms, Ollama is an external local/sidecar AI service that the app probes and likely uses for generation.
8. Additional API routes expose structured content to the frontend: app/api/architecture/route.ts, app/api/timeline/route.ts, and app/api/rules/route.ts. This makes the content model available through server endpoints as well as direct imports, creating a clear separation between content storage and UI consumption.
9. The repo also includes extraction and parsing tooling: extract-docx.js, extract-pdf.js, parse-rules.js, and extracted-content.txt. These scripts imply an ingestion pipeline that converts source documents into normalized text/rules, which then feed the app’s rule or architecture datasets.
10. Supporting content is modeled as reusable domain widgets: components/UseCaseCard.tsx plus data/useCases.json/data/useCases.ts. This suggests the app presents curated use cases alongside architecture and timeline information, likely as part of the same storytelling or knowledge-exploration flow.
11. The overall boundary pattern is: static/domain data and extracted content in data/ and scripts, server API routes in app/api/, and interactive presentation in components/ and app/* pages. There is no evidence of a traditional database or auth layer; the architecture is centered on file-based content, serverless route handlers, and a local AI backend.
12. Tooling is standard Next.js/TypeScript/Tailwind: next.config.ts, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs, and tsconfig.json. These affect implementation, but the architecture is dominated by content-driven UI, lightweight server routes, and an external Ollama model service.
Main entry points: layout.tsx Layout · page.tsx Architecture · TimelineView.tsx Timeline view · parse-rules.js Rules parse
Components 29
App shell
Next.js routes, global layout, and theme/styling foundation.
- Layout · Root application shell and providers.
app/layout.tsx - Landing · Top-level landing page.
app/page.tsx - Architecture · Architecture browser page.
app/architecture/page.tsx - Timeline · Timeline view page.
app/timeline/page.tsx - Global CSS · Global styling for the app.
app/globals.css
Content data
File-backed domain datasets and helpers.
- Architecture data · Primary architecture dataset and variants.
data/architecture.json - Arch helpers · TypeScript accessors and transforms for architecture data.
data/architectureData.ts - Timeline data · Timeline dataset.
data/timeline.json - Timeline helpers · TypeScript accessors for timeline data.
data/timelineData.ts - Use cases · Curated use case content.
data/useCases.json - Use case helpers · TypeScript accessors for use case content.
data/useCases.ts
UI components
Reusable presentation components and views.
- Theme provider · Wires theme state into the app.
components/ThemeProvider.tsx - Theme toggle · UI control for switching theme.
components/ThemeToggle.tsx - Chat UI · Interactive assistant interface.
components/ChatInterface.tsx - Arch node · Renders an architecture node.
components/architecture/ArchitectureNode.tsx - Group node · Renders grouped architecture structure.
components/architecture/ArchitectureGroupNode.tsx - Highlight text · Emphasis and search highlighting for labels.
components/HighlightableText.tsx - Timeline view · Renders timeline content.
components/TimelineView.tsx - Use case card · Reusable card for curated use cases.
components/UseCaseCard.tsx
API routes
Server boundaries exposing content and chat capabilities.
- Arch API · Serves architecture content to the frontend.
app/api/architecture/route.ts - Timeline API · Serves timeline content to the frontend.
app/api/timeline/route.ts - Rules API · Serves parsed rules or policy content.
app/api/rules/route.ts - Chat API · Server boundary for assistant messaging.
app/api/chat/route.ts - Ollama status · Probes availability of the local AI runtime.
app/api/ollama-status/route.ts - Config · Shared configuration for backend connectivity.
lib/config.ts
Ingestion
Scripts and extracted source content used to build normalized data.
- DOCX extract · Converts Word documents to text.
extract-docx.js - PDF extract · Converts PDFs to text.
extract-pdf.js - Rules parse · Parses extracted text into normalized rules.
parse-rules.js - Extracted text · Intermediate normalized content produced by ingestion.
extracted-content.txt
Connections 29
- Layout → Theme provider: wraps · Provides theme context to the app.
- Layout → Global CSS: loads · Applies global styling.
- Layout → Landing: hosts · Serves the landing route inside the root shell.
- Layout → Architecture: hosts · Serves the architecture browser route.
- Layout → Timeline: hosts · Serves the timeline route.
- Theme provider → Theme toggle: enables · Provides theme state for user switching.
- Landing → Chat UI: composes · Landing page can surface the assistant interface.
- Architecture → Arch node: composes · Page assembles architecture node rendering.
- Architecture → Group node: composes · Page assembles grouped architecture rendering.
- Architecture → Highlight text: uses · Supports emphasis and matching in architecture labels.
- Timeline → Timeline view: composes · Page assembles the timeline viewer.
- Timeline view → Use case card: reuses · Timeline-related content cards share presentation patterns.
- Arch node → Architecture data: reads · Architecture nodes are driven by dataset content.
- Group node → Architecture data: reads · Grouped rendering is based on architecture data.
- Arch helpers → Architecture data: maps · Helpers normalize and expose architecture records.
- Timeline view → Timeline data: reads · Timeline view renders file-backed timeline content.
- Timeline helpers → Timeline data: maps · Helpers normalize timeline records.
- Use case card → Use cases: reads · Use case cards render curated content.
- Use case helpers → Use cases: maps · Helpers expose use case records.
- Arch API → Arch helpers: serves · API exposes architecture content from helpers.
- Timeline API → Timeline helpers: serves · API exposes timeline content from helpers.
- Rules API → Rules parse: serves · Rules endpoint is backed by parsed rule content.
- Chat API → Config: uses · Chat route depends on shared runtime configuration.
- Chat API → Ollama status: checks · Chat flow depends on Ollama availability.
- Ollama status → Config: uses · Status probe uses runtime configuration.
- DOCX extract → Extracted text: produces · DOCX ingestion contributes to normalized text.
- PDF extract → Extracted text: produces · PDF ingestion contributes to normalized text.
- Rules parse → Extracted text: consumes · Rules parsing consumes extracted text.
- Rules parse → Rules API: feeds · Parsed rule content powers the rules endpoint.