# alihaidar2/portfolio architecture

> Architecture diagram of the GitHub repository alihaidar2/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/alihaidar2/portfolio
- Repository: https://github.com/alihaidar2/portfolio

## Overview

##### Project Type and Purpose
- This is a full-stack (or “all-in-one”) Next.js web application that leverages the new app routing system. It serves dynamic pages, static assets, and incorporates various UI components including elements for a dashboard, carousel, ETL pipeline visualization, contact page, and various project pages.
- The README and the file tree indicate a modern React-based single-page/multi-page application with server-side rendering features native to Next.js. There’s also evidence of CI/CD integration (GitHub workflows pointing to an Azure Static Web Apps deployment).

##### Analyzing the File Structure
- Top-Level Files and Directories:
- The “app” directory contains all of your front-end routing and page components. This includes layout (app/layout.tsx), the homepage (app/page.tsx), and specific sub-pages such as “contact” (app/contact/page.tsx) and “projects” (app/projects/page.tsx).
- The “app/components” directory includes reusable UI components such as BalajiCarousel.tsx, DashboardProjects.tsx, ETLPipeline.tsx, MigrationProjects.tsx, Navbar.tsx, and Footer.tsx. These components are the building blocks for your pages.
- The “public” directory holds static assets like PDFs and images.
- Config and build-related files (next.config.ts, tsconfig.json, package.json, .github/workflows, etc.) indicate how the project is configured, built, and deployed.
- Architectural Implications:
- The file-based routing of Next.js is central to the design.
- Separation of UI components (in the components folder) from route-specific pages suggests a modular, component-driven architecture.
- It includes deployment pipelines through GitHub workflows and Azure integration.

- Main Components to Include:
- Browser/Client: Representing the user’s web browser accessing the application.
- Next.js Server/Application Layer:
- UI Components: A module that includes the collection of components (Navbar, Footer, BalajiCarousel, ETLPipeline, DashboardProjects, MigrationProjects) used across the pages.
- Global Layout & Styling: Represent files like app/layout.tsx and app/globals.css, emphasizing common layout and style management.
- Static Assets: Represent the “public” directory holding assets (PDFs, images) that are served directly.
- Continuous Deployment / CI-CD Pipeline: Illustrate the GitHub workflows (found under .github/workflows) and how they trigger deployment on platforms like Azure Static Web Apps.

- Relationships and Interactions:
- That the Pages layer routes requests to the correct component modules.
- Interactions where static assets (from "public") are rendered on various pages.
- Deployment pipeline: Code pushed to GitHub → GitHub Actions workflow → Deployment to Azure Static Web Apps.

- Architectural Patterns or Design Principles:
- Component-Based Architecture: Each UI piece is “decoupled” as a component, allowing for reuse and maintainability.
- File-Based Routing: Emphasize how the directory structure directly maps to the URL path structure.
- Separation of Concerns: Different directories for views (pages), reusable UI components, static assets, and configuration, making scalability and maintenance easier.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Browser/Client"]:::client

    subgraph "Next.js Application"
        direction TB
        subgraph "Global Layout & Styling"
            L1["Layout (app/layout.tsx)"]:::layout
            L2["Global Styling (app/globals.css)"]:::layout
        end
        subgraph "Pages & Components"
            direction TB
            subgraph "Pages & Routing"
                direction TB
                HP["Homepage (app/page.tsx)"]:::page
                CP["Contact Page (app/contact/page.tsx)"]:::page
                PP["Projects Page (app/projects/page.tsx)"]:::page
                BP["Balaji Project Page (app/projects/balaji/page.tsx)"]:::page
            end
            C["UI Components (app/components)"]:::component
        end
    end

    S["Static Assets (public)"]:::static
    D["Deployment Pipeline (GitHub Actions)"]:::deploy
    Azu["Azure Static Web Apps"]:::azure

    %% Relationships
    A -->|"HTTP_Request"| L1
    L1 -->|"appliesLayoutTo"| HP
    L1 -->|"includes"| C
    HP -->|"uses"| C
    CP -->|"uses"| C
    PP -->|"uses"| C
    BP -->|"uses"| C
    HP -->|"renders"| S
    CP -->|"renders"| S
    PP -->|"renders"| S
    BP -->|"renders"| S
    L1 -->|"codePushTriggers"| D
    D -->|"deploysTo"| Azu

    %% Click Events
    click HP "https://github.com/alihaidar2/portfolio/blob/master/app/page.tsx"
    click CP "https://github.com/alihaidar2/portfolio/blob/master/app/contact/page.tsx"
    click PP "https://github.com/alihaidar2/portfolio/blob/master/app/projects/page.tsx"
    click BP "https://github.com/alihaidar2/portfolio/blob/master/app/projects/balaji/page.tsx"
    click C "https://github.com/alihaidar2/portfolio/tree/master/app/components"
    click L1 "https://github.com/alihaidar2/portfolio/blob/master/app/layout.tsx"
    click L2 "https://github.com/alihaidar2/portfolio/blob/master/app/globals.css"
    click S "https://github.com/alihaidar2/portfolio/tree/master/public"
    click D "https://github.com/alihaidar2/portfolio/tree/master/.github/workflows"

    %% Styles
    classDef client fill:#cce5ff,stroke:#000,stroke-width:2px;
    classDef layout fill:#d4edda,stroke:#000,stroke-width:2px;
    classDef page fill:#fff3cd,stroke:#000,stroke-width:2px;
    classDef component fill:#e2e3e5,stroke:#000,stroke-width:2px;
    classDef static fill:#f0e68c,stroke:#000,stroke-width:2px;
    classDef deploy fill:#ffd1dc,stroke:#000,stroke-width:2px;
    classDef azure fill:#d1e7dd,stroke:#000,stroke-width:2px;
```
