# khalidoukoujane/b-app architecture

> Architecture diagram of the GitHub repository khalidoukoujane/b-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khalidoukoujane/b-app
- Repository: https://github.com/khalidoukoujane/b-app

## Overview

##### Project type and purpose
- This is a Next.js-based modern blog application (“B-App”) that uses static files (Markdown) and server-side rendering (or static generation) to deliver a performant, responsive blog.
- Purpose: Render a clean blog UI, pull in content from the `posts/` directory, apply Tailwind CSS + Heroicons, and present pages at runtime or build time.

##### File structure
- Top level:
- app/ – Next.js App Router folder with dynamic routes (`[slug]`), global CSS, layout and page entry points.
- components/ – Reusable UI pieces: `Navbar`, `Footer`, and `Post`.
- lib/posts.js – Helper module to load and parse Markdown from `posts/`.
- posts/ – Source Markdown files for each blog entry.
- public/ – Static assets (images, favicons, etc.).
- config files (next.config.mjs, postcss.config.mjs, eslint.config.mjs, jsconfig.json).
- Patterns:
- App-router driven pages, dynamic routing via `[slug]` directories.
- CSS pipeline using Tailwind CSS and PostCSS.
- Markdown-to-HTML conversion via a custom `lib/posts.js` helper.

##### README for additional insights
- Tech stack: Next.js 15, Tailwind CSS v4, Heroicons, custom fonts.
- Features: Responsive design (desktop, tablet, mobile), fast performance, social integration.
- Build & run instructions, how to add posts and update social links.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Content Layer
    subgraph "Content Layer"
        MD["Markdown Files"]:::content
    end

    %% Markdown Processor
    subgraph "Markdown Processor"
        Processor["lib/posts.js"]:::processor
    end

    %% Framework & Runtime
    subgraph "Framework & Runtime"
        Next["Next.js App Router (app/)"]:::framework
        Layout["app/layout.js"]:::framework
        HomePage["app/page.jsx"]:::framework
        PostPage["app/[slug]/page.jsx"]:::framework
    end

    %% React UI Components
    subgraph "React Components"
        Navbar["Navbar"]:::ui
        Footer["Footer"]:::ui
        PostComp["Post Component"]:::ui
    end

    %% Styles & CSS Pipeline
    subgraph "Styles & CSS Pipeline"
        GlobalsCSS["app/globals.css"]:::styles
        PostCSS["postcss.config.mjs"]:::styles
    end

    %% Public Assets
    subgraph "Public Assets"
        Public["public/"]:::assets
    end

    %% Browser Client
    Browser["Browser"]:::browser

    %% Data & Build Flow
    MD -->|"reads files"| Processor
    Processor -->|"provides props"| Next

    %% Next.js Rendering Flow
    Next -->|"renders layout"| Layout
    Next -->|"renders home page"| HomePage
    Next -->|"renders post page"| PostPage

    %% Components Usage
    HomePage --> Navbar
    HomePage --> Footer
    HomePage --> PostComp
    PostPage --> Navbar
    PostPage --> Footer
    PostPage --> PostComp

    %% Styles Pipeline
    GlobalsCSS -->|"CSS input"| Next
    PostCSS -->|"PostCSS build"| Next

    %% Public Assets Served
    Public --> Browser

    %% HTTP Flow
    Browser -->|"HTTP request"| Next
    Next -->|"serves HTML/CSS/JS"| Browser

    %% Click Events
    click Next "https://github.com/khalidoukoujane/b-app/tree/main/app/"
    click Layout "https://github.com/khalidoukoujane/b-app/blob/main/app/layout.js"
    click HomePage "https://github.com/khalidoukoujane/b-app/blob/main/app/page.jsx"
    click PostPage "https://github.com/khalidoukoujane/b-app/blob/main/app/[slug]/page.jsx"
    click GlobalsCSS "https://github.com/khalidoukoujane/b-app/blob/main/app/globals.css"
    click PostCSS "https://github.com/khalidoukoujane/b-app/blob/main/postcss.config.mjs"
    click MD "https://github.com/khalidoukoujane/b-app/tree/main/posts/"
    click Processor "https://github.com/khalidoukoujane/b-app/blob/main/lib/posts.js"
    click Navbar "https://github.com/khalidoukoujane/b-app/blob/main/components/Navbar/Navbar.jsx"
    click Footer "https://github.com/khalidoukoujane/b-app/blob/main/components/Footer/Footer.jsx"
    click PostComp "https://github.com/khalidoukoujane/b-app/blob/main/components/Post/Post.jsx"
    click Public "https://github.com/khalidoukoujane/b-app/tree/main/public/"

    %% Styles
    classDef content fill:#fff8b3,stroke:#cccc00,color:#333
    classDef processor fill:#b3e5ff,stroke:#009ee0,color:#333
    classDef framework fill:#d4edda,stroke:#28a745,color:#333
    classDef ui fill:#f8d7da,stroke:#dc3545,color:#333
    classDef styles fill:#d1ecf1,stroke:#17a2b8,color:#333
    classDef assets fill:#fef2e6,stroke:#fd7e14,color:#333
    classDef browser fill:#e2e3e5,stroke:#6c757d,color:#333
```
