# dylankainth/dylankainthcom architecture

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

- Interactive diagram: https://gitdiagram.com/dylankainth/dylankainthcom
- Repository: https://github.com/dylankainth/dylankainthcom

## Overview

##### Main Components
- Nuxt.js Application Core – This is the central part where the Nuxt configuration (nuxt.config.js) ties the entire project together.
- Pages – Represented by the “pages” directory, each .vue file (like index.vue, contact.vue, project/_id.vue, etc.) automatically maps to a route using Vue Router. These are the views that the user interacts with.
- Layouts – Located in the “layouts” directory (default.vue, blank.vue, error.vue); these define the overall page structure and can be shared among several pages.
- Components – Found in the “components” directory (for example, ProjectCard.vue and Navbar.vue). They provide reusable UI elements and are injected into pages and layouts.
- Store – The Vuex store (store/index.js) that manages the application state.
- Assets – Contains static design assets like CSS files, fonts, and images which are used by pages and components.
- Plugins – Includes JavaScript plugins (e.g., fontawesome.js, gtag.js) for adding extra functionality to the Vue app.
- Static Content – The “static” directory holds files that are served as-is (e.g., PDFs and videos).

##### Relationships and Interactions
- The User’s Browser sends HTTP requests to the Nuxt.js Application hosted on a server.
- Nuxt.js uses auto-generated routing (from “pages”) to determine which Vue component to display based on the URL.
- Each page is rendered with a specified layout (from “layouts”) and enhanced by injecting reusable Vue components (from “components”).
- The application state is centrally managed by the Vuex store (from “store”) which can be accessed across components.
- Assets (CSS, fonts, images) and static files (PDFs, video) are loaded into the views as needed.

##### Architectural Patterns and Design Principles
- The project leverages the modular architecture of Nuxt.js, splitting responsibilities among pages, layouts, components, and plugins.
- It follows the Component-Based UI design using Vue.js, promoting reusability and separation of concerns.
- The routing is automatically handled by the framework, making the “pages” structure central to navigation.
- Vuex store integration encapsulates state management, ensuring unidirectional data flow.
- Clear separation of concerns is maintained by organizing assets, static files, and configurations separately.

##### Relevant Technologies and Frameworks
- Nuxt.js: The application framework providing SSR (Server-Side Rendering) and auto routing.
- Vue.js: The underlying library for building the UI components.
- Vuex: For state management in the application.
- Standard tooling files such as package.json, .editorconfig, etc., provide configuration and build scripts.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    user("User's Browser"):::browser
    core("Nuxt.js Application Core"):::core

    %% Subgraph: Pages
    subgraph "Pages"
        direction TB
        pHome("Home (pages/index.vue)"):::pages
        pContact("Contact (pages/contact.vue)"):::pages
        pProject("Project (pages/project/_id.vue)"):::pages
    end

    %% Subgraph: Layouts
    subgraph "Layouts"
        direction TB
        lDefault("Default Layout (layouts/default.vue)"):::layouts
        lBlank("Blank Layout (layouts/blank.vue)"):::layouts
        lError("Error Layout (layouts/error.vue)"):::layouts
    end

    %% Subgraph: Components
    subgraph "Components"
        direction TB
        compProjectCard("ProjectCard (components/ProjectCard.vue)"):::components
        compNavbar("Navbar (components/Utils/Navbar.vue)"):::components
    end

    store("Vuex Store (store/index.js)"):::store
    assets("Assets (assets: css, fonts, images)"):::assets
    plugins("Plugins (FontAwesome,gtag)"):::plugins
    staticContent("Static Content (static: PDF,webm)"):::staticContent

    %% Connections
    user -->|"sendsHTTPrequest"| core
    plugins -->|"injectsBeforeLoad"| core
    core -->|"autoGeneratesRoute"| pHome
    core -->|"autoGeneratesRoute"| pContact
    core -->|"autoGeneratesRoute"| pProject

    pHome -->|"wrappedWith"| lDefault
    pContact -->|"wrappedWith"| lDefault
    pProject -->|"wrappedWith"| lDefault

    lDefault -->|"includes"| compNavbar
    lDefault -->|"includes"| compProjectCard

    pProject -->|"includes"| compProjectCard
    pContact -->|"includes"| compNavbar

    store -->|"providesState"| compProjectCard
    store -->|"providesState"| compNavbar

    assets -->|"styles"| pHome
    assets -->|"styles"| pContact
    assets -->|"styles"| pProject

    staticContent -->|"servedAsIs"| pHome
    staticContent -->|"servedAsIs"| pContact
    staticContent -->|"servedAsIs"| pProject

    %% Click Events
    click core "https://github.com/dylankainth/dylankainthcom/blob/master/nuxt.config.js"
    click pHome "https://github.com/dylankainth/dylankainthcom/blob/master/pages/index.vue"
    click pContact "https://github.com/dylankainth/dylankainthcom/blob/master/pages/contact.vue"
    click pProject "https://github.com/dylankainth/dylankainthcom/blob/master/pages/project/_id.vue"
    click lDefault "https://github.com/dylankainth/dylankainthcom/blob/master/layouts/default.vue"
    click lBlank "https://github.com/dylankainth/dylankainthcom/blob/master/layouts/blank.vue"
    click lError "https://github.com/dylankainth/dylankainthcom/blob/master/layouts/error.vue"
    click compProjectCard "https://github.com/dylankainth/dylankainthcom/blob/master/components/ProjectCard.vue"
    click compNavbar "https://github.com/dylankainth/dylankainthcom/blob/master/components/Utils/Navbar.vue"
    click store "https://github.com/dylankainth/dylankainthcom/blob/master/store/index.js"
    click assets "https://github.com/dylankainth/dylankainthcom/tree/master/assets"
    click plugins "https://github.com/dylankainth/dylankainthcom/tree/master/plugins"
    click staticContent "https://github.com/dylankainth/dylankainthcom/tree/master/static"

    %% Styles
    classDef browser fill:#ffe0b2,stroke:#bf360c,stroke-width:2px;
    classDef core fill:#ffcc80,stroke:#e65100,stroke-width:2px;
    classDef pages fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef layouts fill:#b3e5fc,stroke:#01579b,stroke-width:2px;
    classDef components fill:#d1c4e9,stroke:#4a148c,stroke-width:2px;
    classDef store fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
    classDef assets fill:#f8bbd0,stroke:#880e4f,stroke-width:2px;
    classDef plugins fill:#d7ccc8,stroke:#3e2723,stroke-width:2px;
    classDef staticContent fill:#c5cae9,stroke:#283593,stroke-width:2px;
```
