# kardinaljacob-cmd/ranobe_translation architecture

> Architecture diagram of the GitHub repository kardinaljacob-cmd/ranobe_translation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kardinaljacob-cmd/ranobe_translation
- Repository: https://github.com/kardinaljacob-cmd/ranobe_translation

## Overview

1. This repository is a Next.js App Router project. The architecture is centered on file-based routing under `app/`, with a small amount of local content stored in the repo under `content/`.

2. The main application boundary is the web frontend. There is no separate backend service, database, or API layer visible in the tree; page data appears to come from the filesystem content rather than an external service.

3. Routing is hierarchical and content-shaped:
   - `app/page.tsx` is the site entry or landing page.
   - `app/[book]/page.tsx` represents a book-level index.
   - `app/[book]/[volume]/[chapter]/page.tsx` represents the deepest chapter reader view.
   This strongly suggests the URL structure mirrors the book → volume → chapter content model.

4. The `content/ranobe-1/tom-1/glava-1.md` file shows the content source is markdown organized by book/volume/chapter folders. That folder structure is likely the canonical source for rendered pages, and the app routes probably resolve params into files in `content/`.

5. `app/ClientChapterView.tsx` is the only clearly named client component in the tree. That implies a server/client split where the chapter page may fetch or assemble content on the server, then hand interactive reading behavior to a client-side viewer component.

6. `app/layout.tsx` and `app/globals.css` define the shared shell and global presentation layer. `layout.tsx` is the top-level composition boundary for all routes, while `globals.css` provides the application-wide styling foundation.

7. `public/` is the static asset boundary for images, icons, and other browser-served files. Anything placed there bypasses the route/content model and is available directly to the frontend.

8. `next.config.ts`, `tsconfig.json`, `eslint.config.mjs`, and `postcss.config.mjs` show a standard Next.js toolchain with TypeScript, ESLint, and PostCSS. These are supporting infrastructure pieces rather than runtime subsystems, but they define how the app is built and validated.

9. The likely data flow is:
   filesystem markdown content → route resolution via dynamic segments → server-rendered page assembly → optional client chapter viewer → browser display.
   The important architectural boundary is between immutable content files and the rendered reader UI.

10. Because the content lives inside the repo, deployment is likely stateless and CDN-friendly. The application can be deployed as a standard Next.js site, with content packaged into the build rather than fetched from an external CMS.

11. For an architecture diagram, the key nodes are:
   - Browser
   - Next.js App Router frontend
   - Dynamic route handlers for book/volume/chapter
   - Local markdown content repository
   - Client-side chapter viewer
   - Static assets in `public/`

12. The most important design characteristic is that this is a content-driven reader app, not a conventional CRUD system. Navigation and rendering are organized around nested literary hierarchy, with the filesystem acting as the primary source of truth.

Main entry points: [`app`](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/app) (App Router), [`app/[book]/[volume]/[chapter]/page.tsx`](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/[volume]/[chapter]/page.tsx) (Chapter reader), [`content`](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content) (Markdown repo), [`app/[book]/page.tsx`](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/page.tsx) (Book index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_app_root["App Router<br/>nextjs app"]
  node_home_page["Landing page<br/>route page<br/>[page.tsx]"]
  node_book_page["Book index<br/>dynamic route<br/>[page.tsx]"]
  node_chapter_page["Chapter reader<br/>dynamic route<br/>[page.tsx]"]
  node_layout_shell["Shell<br/>app layout<br/>[layout.tsx]"]
  node_global_styles["Global styles<br/>stylesheet<br/>[globals.css]"]
  node_client_viewer["Chapter view<br/>client component"]
end

subgraph group_content["Content"]
  node_content_root[("Markdown repo<br/>content source")]
  node_ranobe_book[("Ranobe 1<br/>book content")]
  node_tom_volume[("Tom 1<br/>volume content")]
  node_glava_chapter["Chapter 1<br/>chapter markdown<br/>[glava-1.md]"]
end

subgraph group_tooling["Tooling"]
  node_next_config["Next config<br/>build config<br/>[next.config.ts]"]
  node_ts_config["TypeScript config<br/>compiler config<br/>[tsconfig.json]"]
  node_eslint_config["Lint config<br/>[eslint.config.mjs]"]
  node_postcss_config["PostCSS config<br/>style config<br/>[postcss.config.mjs]"]
end

node_browser(("Browser<br/>client"))
node_public_assets[("Public assets<br/>static assets")]

node_browser -->|"requests UI"| node_app_root
node_app_root -->|"wraps"| node_layout_shell
node_layout_shell -->|"applies"| node_global_styles
node_app_root -->|"routes to"| node_home_page
node_app_root -->|"routes to"| node_book_page
node_app_root -->|"routes to"| node_chapter_page
node_chapter_page -->|"hydrates"| node_client_viewer
node_book_page -->|"reads metadata"| node_content_root
node_chapter_page -->|"loads markdown"| node_content_root
node_content_root -->|"contains"| node_ranobe_book
node_ranobe_book -->|"contains"| node_tom_volume
node_tom_volume -->|"contains"| node_glava_chapter
node_app_root -->|"serves"| node_public_assets
node_app_root -->|"built with"| node_next_config
node_app_root -->|"typed by"| node_ts_config
node_app_root -->|"validated by"| node_eslint_config
node_app_root -->|"styled by"| node_postcss_config

click node_app_root "https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/app"
click node_home_page "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/page.tsx"
click node_book_page "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/page.tsx"
click node_chapter_page "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/[volume]/[chapter]/page.tsx"
click node_layout_shell "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/layout.tsx"
click node_global_styles "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/globals.css"
click node_client_viewer "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/ClientChapterView.tsx"
click node_content_root "https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content"
click node_ranobe_book "https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content/ranobe-1"
click node_tom_volume "https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content/ranobe-1/tom-1"
click node_glava_chapter "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/content/ranobe-1/tom-1/glava-1.md"
click node_public_assets "https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/public"
click node_next_config "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/next.config.ts"
click node_ts_config "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/tsconfig.json"
click node_eslint_config "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/eslint.config.mjs"
click node_postcss_config "https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/postcss.config.mjs"

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_app_root,node_home_page,node_book_page,node_chapter_page,node_layout_shell,node_global_styles,node_client_viewer toneBlue
class node_content_root,node_ranobe_book,node_tom_volume,node_glava_chapter toneAmber
class node_next_config,node_ts_config,node_eslint_config,node_postcss_config toneMint
class node_browser,node_public_assets toneNeutral
```

## Components

### Runtime

Next.js app routes and UI rendering

- [App Router](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/app): nextjs app · Top-level route composition and page rendering · `app`
- [Landing page](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/page.tsx): route page · Site entry route · `app/page.tsx`
- [Book index](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/page.tsx): dynamic route · Book-level route driven by a dynamic segment · `app/[book]/page.tsx`
- [Chapter reader](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/[book]/[volume]/[chapter]/page.tsx): dynamic route · Deepest chapter route that renders chapter content · `app/[book]/[volume]/[chapter]/page.tsx`
- [Shell](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/layout.tsx): app layout · Shared root layout for all routes · `app/layout.tsx`
- [Global styles](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/globals.css): stylesheet · Application-wide CSS foundation · `app/globals.css`
- [Chapter view](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/app/ClientChapterView.tsx): client component · Client-side chapter interaction and display behavior · `app/ClientChapterView.tsx`

### Content

Filesystem-authored markdown source for readers

- [Markdown repo](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content): content source · Local filesystem content organized by literary hierarchy · `content`
- [Ranobe 1](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content/ranobe-1): book content · Book-level content folder · `content/ranobe-1`
- [Tom 1](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/content/ranobe-1/tom-1): volume content · Volume-level content folder · `content/ranobe-1/tom-1`
- [Chapter 1](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/content/ranobe-1/tom-1/glava-1.md): chapter markdown · Representative chapter source file · `content/ranobe-1/tom-1/glava-1.md`

### Tooling

Build, lint, and compiler configuration

- [Next config](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/next.config.ts): build config · Framework configuration · `next.config.ts`
- [TypeScript config](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/tsconfig.json): compiler config · TypeScript project configuration · `tsconfig.json`
- [Lint config](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/eslint.config.mjs): lint config · ESLint rules and validation setup · `eslint.config.mjs`
- [PostCSS config](https://github.com/kardinaljacob-cmd/ranobe_translation/blob/main/postcss.config.mjs): style config · CSS processing pipeline configuration · `postcss.config.mjs`

### Other components

- **Browser**: client · User-facing reader and navigation surface
- [Public assets](https://github.com/kardinaljacob-cmd/ranobe_translation/tree/main/public): static assets · Browser-served files outside the route/content model · `public`

## Connections

- Browser → App Router: requests UI · The browser enters the Next.js frontend
- App Router → Shell: wraps · Root layout composes the application shell
- Shell → Global styles: applies · Shared styling is loaded at the root
- App Router → Landing page: routes to · Landing page is the site entry
- App Router → Book index: routes to · Dynamic book index route
- App Router → Chapter reader: routes to · Deep reader route for a chapter
- Chapter reader → Chapter view: hydrates · Server-rendered chapter view can hand off interaction to the client component
- Book index → Markdown repo: reads metadata · Book pages are shaped by filesystem content
- Chapter reader → Markdown repo: loads markdown · Chapter route resolves params into local content
- Markdown repo → Ranobe 1: contains · Repository content is organized by book
- Ranobe 1 → Tom 1: contains · Book folder contains volumes
- Tom 1 → Chapter 1: contains · Volume folder contains chapter markdown
- App Router → Public assets: serves · Static files are exposed directly to the browser
- App Router → Next config: built with · Framework behavior is configured at build time
- App Router → TypeScript config: typed by · TypeScript governs the app codebase
- App Router → Lint config: validated by · Linting supports code quality
- App Router → PostCSS config: styled by · PostCSS supports the styling pipeline
