# gnasamx/portfolio architecture

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

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

## Overview

##### Main Components

A. Client-Side Components
- Pages/Routes Layer (app directory structure)
- Component Layer (shared components)
- Theme System (theme-provider + styles)
- Analytics Integration

B. Server-Side Components
- Next.js Server Runtime
- API Routes Layer
- File-based Routing System
- Static Asset Handling

C. Build/Development Infrastructure
- TypeScript Compilation
- Tailwind CSS Processing
- ESLint Configuration

- Next.js Application                               |

- Client Layer                  Server Layer                    Build System

- [Components]                 [API Routes]                    [Configuration]
- Theme Provider            - /api/hello                    - TypeScript
- Analytics                 - Static Assets                 - Tailwind CSS
- Pages                     - Server Components             - ESLint

- [Routing Layer]             [Next.js Runtime]              [Build Process]

##### Important Relationships

A. Client-Server Interaction
- How the app directory structure maps to routes
- API route connections
- Demonstrate static asset serving

B. Build Process Flow
- TypeScript compilation pipeline
- CSS/Tailwind processing
- Static optimization

##### Implementation Details

- File-based routing structure (/app directory)
- API routes implementation (/api directory)
- Static file serving (public directory)
- Style management (Tailwind + custom CSS)
- TypeScript integration
- Development tooling

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph NextApp["Next.js Application"]
        direction TB
        
        subgraph ClientLayer["Client Layer"]
            direction TB
            Pages["Pages/Routes"]:::client
            Components["Component Layer"]:::client
            ThemeSystem["Theme System"]:::client
            Analytics["Analytics Integration"]:::client
        end

        subgraph ServerLayer["Server Layer"]
            direction TB
            NextRuntime["Next.js Server Runtime"]:::server
            APIRoutes["API Routes Layer"]:::server
            StaticAssets["Static Asset Handling"]:::server
            ServerComponents["Server Components"]:::server
        end

        subgraph BuildSystem["Build/Development Infrastructure"]
            direction TB
            TypeScript["TypeScript Compilation"]:::build
            TailwindCSS["Tailwind CSS Processing"]:::build
            ESLint["ESLint Configuration"]:::build
            NextConfig["Next.js Configuration"]:::build
        end

        %% Relationships
        Pages --> NextRuntime
        Components --> Pages
        ThemeSystem --> Components
        Analytics --> Components
        APIRoutes --> NextRuntime
        StaticAssets --> NextRuntime
        ServerComponents --> NextRuntime

        %% Build System Relationships
        TypeScript --> NextRuntime
        TailwindCSS --> ThemeSystem
        ESLint --> NextRuntime
        NextConfig --> NextRuntime
    end

    %% Click Events
    click Pages "https://github.com/gnasamx/portfolio/tree/main/app"
    click Components "https://github.com/gnasamx/portfolio/tree/main/components"
    click ThemeSystem "https://github.com/gnasamx/portfolio/blob/main/styles/theme.css"
    click Analytics "https://github.com/gnasamx/portfolio/blob/main/components/analytics.tsx"
    click APIRoutes "https://github.com/gnasamx/portfolio/tree/main/app/api"
    click StaticAssets "https://github.com/gnasamx/portfolio/tree/main/public"
    click TypeScript "https://github.com/gnasamx/portfolio/blob/main/tsconfig.json"
    click TailwindCSS "https://github.com/gnasamx/portfolio/blob/main/tailwind.config.js"
    click ESLint "https://github.com/gnasamx/portfolio/blob/main/.eslintrc.json"
    click NextConfig "https://github.com/gnasamx/portfolio/blob/main/next.config.js"

    %% Styles
    classDef client fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef build fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        direction TB
        Client["Client Components"]:::client
        Server["Server Components"]:::server
        Build["Build Components"]:::build
    end
```
