# devasudant/volume-project architecture

> Architecture diagram of the GitHub repository devasudant/volume-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devasudant/volume-project
- Repository: https://github.com/devasudant/volume-project

## Overview

#### Purpose and Entry Points
This is a Next.js 14/React TypeScript single-page tool for interactively compiling book/content fragments into JSON snippets: chapters, headings, paragraphs, poems, images, tables, footers, and Tamil page numbers. The runtime entry is the App Router root at `src/app/layout.tsx`; the primary application screen is `src/app/page.tsx`.

#### Application Shell
`src/app/layout.tsx` establishes the shared document/layout boundary, while `src/app/globals.css` supplies global styling. `src/app/page.tsx` composes the compiler-oriented UI and owns the top-level interactive workflow. Styling is Tailwind-based, configured through `tailwind.config.ts`.

#### Content Compiler Interfaces
The core domain is represented by dedicated form/compiler interfaces under `src/components/component-interfaces/`. These components gather content-specific fields, apply local React-hook state, and produce JSON-oriented output/preview:
- `src/components/component-interfaces/chapter-interface.tsx`
- `src/components/component-interfaces/heading-interface.tsx`
- `src/components/component-interfaces/paragraph-interface.tsx`
- `src/components/component-interfaces/poem-interface.tsx`
- `src/components/component-interfaces/image-interface.tsx`
- `src/components/component-interfaces/footer-interface.tsx`
- `src/components/component-interfaces/tamil-page-interface.tsx`

The main boundary is client-side: user-entered text and selections are transformed directly into serialized content structures rather than persisted through a visible backend layer.

#### Table and Page-Number Compilation
Table handling is a specialized branch of the compilation workflow. `src/components/table-compiler.tsx` accepts and compiles table content, with `src/components/component-interfaces/table-interface.tsx` providing its domain-facing interface. `src/components/tamil-page-number-compiler.tsx` separately generates Tamil book page-number JSON, likely encapsulating the number-to-language/content transformation.

#### Assembly and Presentation Controls
`src/components/component-toolbar.tsx` is the likely cross-compiler control surface for selecting or coordinating compilation actions. Reusable primitives in `src/components/ui/` provide dialogs, form inputs, selects, tabs, tables, toast feedback, and responsive layout building blocks; this is the presentation boundary around otherwise domain-specific compiler forms.

#### Runtime, Hosting, and Integrations
The app runs under Node.js 18+ using Next.js App Router and React 18. Deployment configuration is present in `apphosting.yaml`, indicating Firebase App Hosting infrastructure. The README references Firebase configuration, though no Firebase client/server source is visible in the provided tree. `next.config.ts` defines Next runtime/build behavior.

#### AI Boundary
`src/ai/genkit.ts` and `src/ai/dev.ts` establish an isolated Genkit AI integration/dev entry area. No flow files are present, so AI appears scaffolded or minimally integrated rather than part of the visible primary compiler path.

#### Supporting Shared Behavior
`src/lib/utils.ts` contains shared utility logic, while `src/hooks/use-toast.ts` and `src/hooks/use-mobile.tsx` support notification and responsive UI behavior. These support the interactive compilation experience without defining the content model itself.

Main entry points: [`src/app/page.tsx`](https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/page.tsx) (Compiler screen), [`src/components/component-toolbar.tsx`](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-toolbar.tsx) (Component toolbar), [`src/app/layout.tsx`](https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/layout.tsx) (App layout), [`src/components/component-interfaces/chapter-interface.tsx`](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-interfaces/chapter-interface.tsx) (Content interfaces)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Next.js App"]
  node_layout["App layout<br/>Next.js layout<br/>[layout.tsx]"]
  node_page["Compiler screen<br/>Next.js page<br/>[page.tsx]"]
  node_globals["Global styles<br/>CSS<br/>[globals.css]"]
  node_tailwind["Tailwind config<br/>styling config<br/>[tailwind.config.ts]"]
  node_next_config["Next runtime config<br/>build config<br/>[next.config.ts]"]
end

subgraph group_compiler["Content Compilation"]
  node_toolbar["Component toolbar<br/>compiler controls"]
  node_content_interfaces["Content interfaces<br/>React form compilers"]
  node_table_interface["Table interface<br/>React form compiler"]
  node_table_compiler["Table compiler<br/>content compiler<br/>[table-compiler.tsx]"]
  node_tamil_pages["Tamil page compiler<br/>content compiler"]
  node_json_output["Serialized snippets<br/>client-side JSON output"]
end

subgraph group_presentation["UI Support"]
  node_ui_primitives["UI primitives<br/>component library"]
  node_toast_hook["Toast state<br/>React hook<br/>[use-toast.ts]"]
  node_mobile_hook["Mobile state<br/>React hook<br/>[use-mobile.tsx]"]
  node_utils["Shared utilities<br/>utility module<br/>[utils.ts]"]
end

subgraph group_ai["AI Integration"]
  node_genkit{{"Genkit setup<br/>AI integration<br/>[genkit.ts]"}}
  node_ai_dev{{"Genkit dev entry<br/>AI development entry<br/>[dev.ts]"}}
end

node_firebase_hosting{{"Firebase App Hosting<br/>deployment platform<br/>[apphosting.yaml]"}}

node_layout -->|"renders"| node_page
node_layout -->|"loads"| node_globals
node_globals -->|"uses"| node_tailwind
node_page -->|"composes"| node_toolbar
node_page -->|"hosts"| node_content_interfaces
node_page -->|"hosts"| node_table_interface
node_page -->|"hosts"| node_tamil_pages
node_toolbar -->|"selects"| node_content_interfaces
node_toolbar -->|"selects"| node_table_interface
node_content_interfaces -->|"serializes"| node_json_output
node_table_interface -->|"provides input"| node_table_compiler
node_table_compiler -->|"compiles"| node_json_output
node_tamil_pages -->|"generates"| node_json_output
node_page -->|"uses"| node_ui_primitives
node_ui_primitives -.->|"uses"| node_toast_hook
node_ui_primitives -.->|"uses"| node_mobile_hook
node_page -.->|"uses"| node_utils
node_ai_dev -->|"initializes"| node_genkit
node_next_config -.->|"configures runtime"| node_layout
node_firebase_hosting -.->|"deploys"| node_next_config

click node_layout "https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/layout.tsx"
click node_page "https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/page.tsx"
click node_globals "https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/globals.css"
click node_tailwind "https://github.com/devasudant/volume-project/blob/Version-2.0/tailwind.config.ts"
click node_toolbar "https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-toolbar.tsx"
click node_content_interfaces "https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-interfaces/chapter-interface.tsx"
click node_table_interface "https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-interfaces/table-interface.tsx"
click node_table_compiler "https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/table-compiler.tsx"
click node_tamil_pages "https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/tamil-page-number-compiler.tsx"
click node_toast_hook "https://github.com/devasudant/volume-project/blob/Version-2.0/src/hooks/use-toast.ts"
click node_mobile_hook "https://github.com/devasudant/volume-project/blob/Version-2.0/src/hooks/use-mobile.tsx"
click node_utils "https://github.com/devasudant/volume-project/blob/Version-2.0/src/lib/utils.ts"
click node_genkit "https://github.com/devasudant/volume-project/blob/Version-2.0/src/ai/genkit.ts"
click node_ai_dev "https://github.com/devasudant/volume-project/blob/Version-2.0/src/ai/dev.ts"
click node_firebase_hosting "https://github.com/devasudant/volume-project/blob/Version-2.0/apphosting.yaml"
click node_next_config "https://github.com/devasudant/volume-project/blob/Version-2.0/next.config.ts"

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_layout,node_page,node_globals,node_tailwind,node_next_config toneBlue
class node_toolbar,node_content_interfaces,node_table_interface,node_table_compiler,node_tamil_pages,node_json_output toneAmber
class node_ui_primitives,node_toast_hook,node_mobile_hook,node_utils toneMint
class node_genkit,node_ai_dev toneRose
class node_firebase_hosting toneNeutral
```

## Components

### Next.js App

- [App layout](https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/layout.tsx): Next.js layout · Shared document and layout boundary. · `src/app/layout.tsx`
- [Compiler screen](https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/page.tsx): Next.js page · Owns the top-level interactive workflow. · `src/app/page.tsx`
- [Global styles](https://github.com/devasudant/volume-project/blob/Version-2.0/src/app/globals.css): CSS · `src/app/globals.css`
- [Tailwind config](https://github.com/devasudant/volume-project/blob/Version-2.0/tailwind.config.ts): styling config · `tailwind.config.ts`
- [Next runtime config](https://github.com/devasudant/volume-project/blob/Version-2.0/next.config.ts): build config · `next.config.ts`

### Content Compilation

- [Component toolbar](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-toolbar.tsx): compiler controls · Coordinates content compilation actions. · `src/components/component-toolbar.tsx`
- [Content interfaces](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-interfaces/chapter-interface.tsx): React form compilers · Chapter, heading, paragraph, poem, image, footer, and Tamil page forms serialize user input. · `src/components/component-interfaces/chapter-interface.tsx`
- [Table interface](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/component-interfaces/table-interface.tsx): React form compiler · `src/components/component-interfaces/table-interface.tsx`
- [Table compiler](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/table-compiler.tsx): content compiler · Compiles table content into JSON-oriented output. · `src/components/table-compiler.tsx`
- [Tamil page compiler](https://github.com/devasudant/volume-project/blob/Version-2.0/src/components/tamil-page-number-compiler.tsx): content compiler · Generates Tamil book page-number JSON. · `src/components/tamil-page-number-compiler.tsx`
- **Serialized snippets**: client-side JSON output · Content is transformed in-browser with no visible persistence backend.

### UI Support

- **UI primitives**: component library · Dialogs, inputs, selects, tabs, tables, toast, and responsive building blocks.
- [Toast state](https://github.com/devasudant/volume-project/blob/Version-2.0/src/hooks/use-toast.ts): React hook · `src/hooks/use-toast.ts`
- [Mobile state](https://github.com/devasudant/volume-project/blob/Version-2.0/src/hooks/use-mobile.tsx): React hook · `src/hooks/use-mobile.tsx`
- [Shared utilities](https://github.com/devasudant/volume-project/blob/Version-2.0/src/lib/utils.ts): utility module · `src/lib/utils.ts`

### AI Integration

Scaffolded Genkit area outside the visible compiler flow.

- [Genkit setup](https://github.com/devasudant/volume-project/blob/Version-2.0/src/ai/genkit.ts): AI integration · `src/ai/genkit.ts`
- [Genkit dev entry](https://github.com/devasudant/volume-project/blob/Version-2.0/src/ai/dev.ts): AI development entry · `src/ai/dev.ts`

### Other components

- [Firebase App Hosting](https://github.com/devasudant/volume-project/blob/Version-2.0/apphosting.yaml): deployment platform · `apphosting.yaml`

## Connections

- App layout → Compiler screen: renders
- App layout → Global styles: loads
- Global styles → Tailwind config: uses
- Compiler screen → Component toolbar: composes
- Compiler screen → Content interfaces: hosts
- Compiler screen → Table interface: hosts
- Compiler screen → Tamil page compiler: hosts
- Component toolbar → Content interfaces: selects
- Component toolbar → Table interface: selects
- Content interfaces → Serialized snippets: serializes
- Table interface → Table compiler: provides input
- Table compiler → Serialized snippets: compiles
- Tamil page compiler → Serialized snippets: generates
- Compiler screen → UI primitives: uses
- UI primitives → Toast state: uses
- UI primitives → Mobile state: uses
- Compiler screen → Shared utilities: uses
- Genkit dev entry → Genkit setup: initializes
- Next runtime config → App layout: configures runtime
- Firebase App Hosting → Next runtime config: deploys
