# rim0o8/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/rim0o8/portfolio
- Repository: https://github.com/rim0o8/portfolio

## Overview

##### Main Components
- Next.js Application Layer: Represent the core application based on the Next.js framework. This includes pages, layouts, and the app directory in src/app (e.g., page.tsx, layout.tsx, providers.tsx) that form the backbone of the application.
- UI Component Layer: Illustrate the various React components housed in src/components and the subdirectory src/components/ui. These components (like Header, Footer, Hero, and specific UI widgets) make up the user interface.
- Styling and Utility Libraries: Include the utilities (src/lib/utils.ts) and tailwind CSS integration (tailwind.config.ts, src/lib/tailwindcss) as supporting layers for styling and helper functions.
- Storybook Integration: Represent Storybook (in the .storybook directory and src/stories) which supports UI development and component visualization.
- Deployment/Containerization: Include Dockerfile, .dockerignore, and GitHub workflows (in .github/workflows) to indicate the CI/CD/deployment pipelines.
- Frontend Build Artifacts: Although most source code is in src, note that the frontend directory contains the build output (.next folder with cache and configuration files) indicating runtime artifacts of the compiled Next.js application.
- Public/Static Assets: The public directory contains static files (like images, fonts, etc.) that are served to the client.

##### Relationships and Interactions
- Integration between Components: Show the connection between components in the app directory (like page.tsx and layout.tsx) and UI components that are imported from src/components.
- Storybook and Development: Indicate that the storybook environment uses the same components for isolated development/testing.
- Deployment Pipelines: Illustrate how the GitHub workflows and Docker configuration integrate with the build process to deploy the Next.js application (possibly on Vercel or another hosting platform).

##### Architectural Patterns & Technologies
- Component-Driven Development: Emphasize how Storybook supports design and testing of UI components in isolation.
- Modern JavaScript/TypeScript Stack: Note the usage of TypeScript (tsconfig files), Tailwind for styling, and Next.js’ file-based routing system.
- Containerization & CI/CD: Dockerfile and GitHub workflows highlight a micro-deployment pattern.
- Internationalization: The presence of src/i18n indicates language configuration and multi-language support.

##### Specific Elements
- A separate node for the Next.js application layer, showing sub-components like the app directory (pages, layout, providers) and the components modularized under src/components.
- A node for Storybook (originating from .storybook and src/stories) and indicate its relationship to the UI components.

- Don’t overcomplicate—start by breaking the system into as many clear, standalone components as possible.
- Node is properly labeled with descriptive names.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User("User"):::external

    subgraph "Next.js Application Layer"
        nxt("Next.js Frontend"):::app
    end

    subgraph "API Endpoints"
        api("API Routes"):::api
    end

    subgraph "UI Components"
        core("Core Components"):::ui
        uiWidgets("UI Widgets"):::ui
    end

    subgraph "Styling & Utilities"
        tailwind("Tailwind Config"):::styling
        tailwindlib("TailwindCSS Library"):::styling
        utils("Utility Functions"):::styling
    end

    subgraph "Storybook Integration"
        storybookConfig("Storybook Config"):::storybook
        storybookStories("Component Stories"):::storybook
    end

    subgraph "Deployment Pipeline"
        docker("Docker Setup"):::deployment
        workflows("GitHub Workflows"):::deployment
    end

    artifacts("Frontend Build Artifacts"):::artifact
    publicAssets("Public Assets"):::static
    i18n("Internationalization"):::i18n

    User -->|"sends request"| nxt
    nxt -->|"calls API"| api
    nxt -->|"renders"| core
    nxt -->|"renders"| uiWidgets
    nxt -->|"uses"| tailwind
    nxt -->|"uses"| tailwindlib
    nxt -->|"uses"| utils
    nxt -->|"integrates"| i18n
    core -->|"testedIn"| storybookStories
    uiWidgets -->|"testedIn"| storybookStories
    docker -->|"deploysTo"| nxt
    workflows -->|"CI/CDBuild"| nxt
    nxt -->|"produces"| artifacts
    nxt -->|"serves"| publicAssets

    storybookConfig -->|"configures"| storybookStories
    core ---|"linkedWith"| storybookConfig
    uiWidgets ---|"linkedWith"| storybookConfig

    click nxt "https://github.com/rim0o8/portfolio/tree/main/src/app"
    click api "https://github.com/rim0o8/portfolio/blob/main/src/app/api/contact/route.ts"
    click core "https://github.com/rim0o8/portfolio/tree/main/src/components"
    click uiWidgets "https://github.com/rim0o8/portfolio/tree/main/src/components/ui"
    click tailwind "https://github.com/rim0o8/portfolio/blob/main/tailwind.config.ts"
    click tailwindlib "https://github.com/rim0o8/portfolio/tree/main/src/lib/tailwindcss"
    click utils "https://github.com/rim0o8/portfolio/blob/main/src/lib/utils.ts"
    click storybookConfig "https://github.com/rim0o8/portfolio/blob/main/.storybook"
    click storybookStories "https://github.com/rim0o8/portfolio/tree/main/src/stories"
    click docker "https://github.com/rim0o8/portfolio/tree/main/Dockerfile"
    click workflows "https://github.com/rim0o8/portfolio/tree/main/.github/workflows"
    click artifacts "https://github.com/rim0o8/portfolio/blob/main/frontend/.next"
    click publicAssets "https://github.com/rim0o8/portfolio/tree/main/public"
    click i18n "https://github.com/rim0o8/portfolio/tree/main/src/i18n"

    classDef external fill:#f9d5e5,stroke:#c44d58,stroke-width:2px;
    classDef app fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef api fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef ui fill:#d6eaf8,stroke:#3498db,stroke-width:2px;
    classDef styling fill:#fbe7c6,stroke:#e67e22,stroke-width:2px;
    classDef storybook fill:#fad7a0,stroke:#e59866,stroke-width:2px;
    classDef deployment fill:#e8daef,stroke:#8e44ad,stroke-width:2px;
    classDef artifact fill:#d6eaf8,stroke:#2980b9,stroke-width:2px;
    classDef static fill:#ccebc5,stroke:#2c7bb6,stroke-width:2px;
    classDef i18n fill:#f7cac9,stroke:#955251,stroke-width:2px;
```
