# locbh3010/portfolio architecture

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

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

## Overview

This project is a Next.js web application bootstrapped using create-next-app. It primarily serves as a frontend application with a well-organized structure for building a multi-page website (including pages like about, blogs, contact, projects, etc.), alongside a set of shared and core utilities that support custom components and configurations.

##### Main Project Components
- Next.js Frontend (app directory): This houses the page-level components (e.g., app/page.tsx, app/about/page.tsx), serving as the entry points for routing and rendering UI.
- Core Configuration & Services (src/core): Contains project configuration files, service utilities, and helper functions that drive business logic or set up application-wide settings.
- Shared Resources (src/shared): Includes a rich set of UI components (headers, footers, container, animations, etc.), assets (images, fonts, styles), layouts, hooks, and constant definitions used across the application.
- Features (src/features): Even though currently empty (.gitkeep), this directory is likely reserved for domain-specific modules, state management, or future business logic extensions.
- Styling & Global Configurations: Files such as globals.css (in src/styles) and various config files (e.g., tsconfig.json, next.config.ts, etc.) point to how styling and typescript configurations are managed.

##### Relationship & Interactions
- The Next.js “app” directory manages route-level components. Each page component imports and utilizes UI elements from the “src/shared/components” directory.
- Shared components like headers, footers, animations, and providers are composed in the page layouts (for example, DefaultLayout.tsx in src/shared/layouts) to ensure a consistent look and feel.
- Utility functions, constants, and configuration loaded from “src/core” and “src/shared/constants” support decisions and business logic across the application.
- Although there are no explicit external API calls shown in the file tree, the integration with external services and fonts (via next/font and Geist) should be annotated as part of external dependencies.

##### Architectural Patterns & Design Principles
- Component-Based Architecture: The project isolates UI features into reusable components grouped within the “shared” directory. This separation ensures ease of maintenance and reusability.
- Separation of Concerns: The file structure clearly segregates the UI (app routes, components) from configuration, business logic or utilities (core, shared/helpers), which simplifies scaling.
- Modular Design: The inclusion of directories like "features" (albeit empty) indicates a planned modular approach to further separate business domains or functionalities.

##### Relevant Technologies and Frameworks
- Next.js: Core framework managing routing, server-side rendering, and static site generation.
- React: Underlying library for composing UI components, as indicated by the .tsx files.
- Typescript: Type-safety is enforced across the project (as seen in tsconfig and .ts/.tsx files).
- Vercel/Next/font: Managed external dependency for font optimization (Geist font).

##### Elements
- Another for shared UI Components (src/shared/components, layouts, assets).
- A separate style for Core utilities (src/core) and configuration.
- Adding a placeholder for “features” as an extension point.
- From Next.js routes calling layout components.
- From layouts to individual shared components such as headers, footers, and containers.
- How styles and configuration files support the rest of the system.
- Clearly label every component’s role (e.g., “Routing Layer”, “UI Components”, “Utility/Configuration Layer”, “Styling & Global Configurations”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    R["Next.js Routing Layer"]:::routing
    S["Shared UI Components"]:::shared
    C["Core Config & Services"]:::core
    F["Domain-Specific Features"]:::features
    T["Styling & Global Configurations"]:::styling
    E["External Dependencies"]:::external

    %% Relationships
    R -->|"imports_layout"| S
    R -->|"calls_utilities"| C
    S -->|"uses_config"| C
    R -->|"applies_styles"| T
    T -->|"styles_UI"| S
    R -->|"extension_point"| F
    R -->|"integrates_with"| E

    %% Click Events
    click R "https://github.com/locbh3010/portfolio/tree/main/src/app"
    click C "https://github.com/locbh3010/portfolio/tree/main/src/core"
    click S "https://github.com/locbh3010/portfolio/tree/main/src/shared"
    click F "https://github.com/locbh3010/portfolio/tree/main/src/features"
    click T "https://github.com/locbh3010/portfolio/tree/main/src/styles"

    %% Styles
    classDef routing fill:#FCE38A,stroke:#B58900,stroke-width:2px;
    classDef core fill:#88B04B,stroke:#2A7F00,stroke-width:2px;
    classDef shared fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef features fill:#FFC0CB,stroke:#FF69B4,stroke-width:2px;
    classDef styling fill:#D3D3D3,stroke:#696969,stroke-width:2px;
    classDef external fill:#FFA500,stroke:#FF8C00,stroke-width:2px;
```
