# cattyman919/portfolio architecture

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

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

## Overview

##### Main Components
- User Browser: The client that accesses the website.
- Next.js Application: Your overall application logic which includes server-side rendering (and/or static site generation) as well as client-side interactivity.
- UI / Presentation Layer: This is represented by the “src/app” directory which includes layout files (layout.tsx, globals.css, loading.tsx, page.tsx) and subdirectories like “_sections” that hold various parts of the portfolio (home, experience, projects, skills, etc.).
- Reusable Components: Under “src/app/_sections/_components”, you have dedicated components for experience cards, project modals, skills, navbar elements, etc. This layer handles the UI logic for each specific section.
- Data and Types: Data is maintained in the “src/app/_sections/_data” folder and the corresponding TypeScript type definitions in “src/app/_sections/_types”. These modules are essential for ensuring consistency between the dynamic content and its representation.
- Public Assets: The “public” folder holds static resources including images (for experiences and skills) and any other public static files.
- Configuration and Utility Files: Files like next.config.ts, tailwind.config.ts, postcss.config.mjs, and package.json define environment configurations, dependencies, and build settings. Additionally, the “lib” directory (with file like apollo-client.ts) may provide utility functions or support integration with external APIs or libraries if needed (even if it isn’t heavily used in the core UI).

##### Interactions and Relationships
- Directional Data Flow: Start with the User Browser, which makes HTTP requests to the Next.js application.
- The Next.js server (or build process for static deployment) references the “src/app” folder to determine routing and rendering.
- Each page in “src/app” (like home, projects, skills) uses multiple components from the “_sections/_components” folder.
- These components pull in static data (from “_data”) and type definitions (from “_types”) to render dynamic content.
- Static assets from the “public” directory are served directly to the browser to support the visual presentation (images, CSS from build.css, etc.).

##### Architectural Patterns and Design Principles
- Component-Based Design: The project is clearly organized as a component-based React/Next.js application. By splitting the UI into reusable components (cards, modals, nav elements), the architecture supports modularity and maintainability.
- Separation of Concerns: Data, UI components, styles, and configurations are kept in separate directories, emphasizing clear separation of responsibilities.
- Next.js Routing and Layout: The “src/app” structure leverages Next.js routing conventions along with global layout files, enabling efficient navigation and potentially server-side rendering.

##### Technologies and Their Roles
- Next.js & React: Core framework and UI library to build interactive and SEO-friendly web pages.
- Tailwind CSS: Provides responsive design and utility classes, ensuring the UI is modern and consistent.
- TypeScript: Enhances code maintainability and correctness, which you see in various type definitions and config files like tsconfig.json.
- (Optional) Apollo Client: Although a single file is visible in “lib”, if used, it may be intended for data fetching via GraphQL, which can be marked as an integration point for external data or CMS.

## Diagram (Mermaid)

```mermaid
graph TD
    UB["User Browser"]:::client
    NS["Next.js Server"]:::server
    UI["UI / Presentation Layer"]:::ui
    SEC["Sections (_sections)"]:::section
    RC["Reusable Components (_components)"]:::component
    DT["Data (_data)"]:::data
    TDs["Type Definitions (_types)"]:::data
    PA["Public Assets"]:::asset
    CFG["Configurations"]:::config
    UT["Utility"]:::utility

    UB -->|"HTTP_Request"| NS
    NS -->|"renders"| UI
    UI -->|"routes"| SEC
    SEC -->|"composes"| RC
    RC -->|"fetches"| DT
    RC -->|"uses"| TDs
    NS -->|"serves"| PA
    NS -->|"configures"| CFG
    NS -->|"integrates"| UT

    click UI "https://github.com/cattyman919/portfolio/tree/main/src/app"
    click SEC "https://github.com/cattyman919/portfolio/tree/main/src/app/_sections"
    click RC "https://github.com/cattyman919/portfolio/tree/main/src/app/_sections/_components"
    click DT "https://github.com/cattyman919/portfolio/tree/main/src/app/_sections/_data"
    click TDs "https://github.com/cattyman919/portfolio/tree/main/src/app/_sections/_types"
    click PA "https://github.com/cattyman919/portfolio/tree/main/public"
    click CFG "https://github.com/cattyman919/portfolio/blob/main/next.config.ts"
    click UT "https://github.com/cattyman919/portfolio/blob/main/lib/apollo-client.ts"

    classDef client fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef server fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef ui fill:#D5F5E3,stroke:#1E8449,stroke-width:2px;
    classDef section fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef component fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef data fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
    classDef asset fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px;
    classDef config fill:#FDEDEC,stroke:#C0392B,stroke-width:2px;
    classDef utility fill:#E8F8F5,stroke:#1ABC9C,stroke-width:2px;
```
