# vishaltalreja01/portfolio architecture

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

## Overview

##### Main Components
- Data Layer: This includes the “src/data” directory with configuration files, internal data factories (e.g., create-link-factory, create-skill-factory), data transformation scripts (transform-data.ts, transformers.ts), and section-specific data files for education, experience, portfolio, skills, testimonials, and favorites.
- Web Frontend: Found in “src/web”, it contains multiple components and sections that render the online resume. There’s a clear separation of layout, reusable components (e.g., description.astro, sidebar, theme-toggle), and section-specific pages.
- PDF Generation Module: The “src/pdf” directory contains specialized components and sections for generating a print/PDF version of the resume. It includes its own versions of components such as photo, description, section headings, and section-specific templates.
- Assets and Static Files: The “src/assets” and “public” folders hold images, fonts, and other media needed by both the web and PDF renderings.
- Build and Utility Scripts: Scripts like “scripts/generate-favicons.ts” and “scripts/generate-pdf.ts” support automation tasks (favicons generation and PDF generation) and are integral parts of the build process.
- Configuration and CI/CD: Files such as “astro.config.ts”, “tailwind.config.cjs”, and various GitHub workflows (in the “.github” directory) indicate CI/CD integration and build configurations.

##### Relationships and Data Flow
- Data Input: The user supplies resume content through TypeScript files located in “src/data”. This data is structured and transformed via helper functions and transformers.
- Data Flow to Presentation: Transformed data flows into two parallel presentation layers:
- The Web Frontend (in “src/web”), which renders the responsive online resume.
- The PDF Generation module (in “src/pdf”), which produces the offline, printable version.
- Assets Integration: Both rendering layers consume assets from “src/assets” and “public”, ensuring image optimization and branding consistency.
- Automation and Build Pipeline: Scripts in the “scripts” directory, along with the GitHub workflows, drive tasks like PDF generation, favicon creation, and overall build orchestration.

##### Architectural Patterns & Design Principles
- Separation of Concerns: There is a clear division between the data (content and configuration), the rendering logic for the web interface (src/web), and the PDF rendering (src/pdf).
- Reuse of Components: Many UI components are reused or adapted between the web and PDF views, adhering to DRY principles.
- Automation and CI/CD: The project uses GitHub workflows and custom scripts to automate repetitive tasks like PDF and favicon generation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Technologies Note
    Tech["Technologies: Astro, TailwindCSS, TypeScript, Iconify"]:::tech

    %% Data Layer Subgraph
    subgraph "Data Layer"
        direction TB
        DataLayer["Data Layer (src/data)"]:::core
        DataInternals["Internals (_internals)"]:::core
        DataConfig["Config (config.ts)"]:::core
        DataSections["Sections (sections)"]:::core
    end

    %% Web Frontend Subgraph
    subgraph "Web Frontend"
        direction TB
        WebFrontend["Web Frontend (src/web)"]:::presentation
        WebComponents["Components (components)"]:::presentation
        WebSections["Sections (sections)"]:::presentation
    end

    %% PDF Generation Module Subgraph
    subgraph "PDF Generation Module"
        direction TB
        PDFModule["PDF Generation (src/pdf)"]:::presentation
        PDFComponents["Components (components)"]:::presentation
        PDFSections["Sections (sections)"]:::presentation
    end

    %% Assets and Static Files Subgraph
    subgraph "Assets and Static Files"
        direction TB
        Assets["Assets (src/assets)"]:::assets
        StaticFiles["Static Files (public)"]:::assets
    end

    %% Build and Utility Scripts Subgraph
    subgraph "Build and Utility Scripts"
        direction TB
        BuildScripts["Build & Utility Scripts (scripts)"]:::utility
        Favicons["Generate Favicons (generate-favicons.ts)"]:::utility
        PDFScript["Generate PDF (generate-pdf.ts)"]:::utility
    end

    %% Configuration and CI/CD Subgraph
    subgraph "Configuration and CI/CD"
        direction TB
        AstroConfig["Astro Config (astro.config.ts)"]:::config
        TailwindConfig["Tailwind Config (tailwind.config.cjs)"]:::config
        GitHub["CI/CD (.github)"]:::config
    end

    %% Data Layer internal flow connections
    DataLayer --> DataInternals
    DataLayer --> DataConfig
    DataLayer --> DataSections

    %% Web Frontend internal flow connections
    WebFrontend --> WebComponents
    WebFrontend --> WebSections

    %% PDF Generation internal flow connections
    PDFModule --> PDFComponents
    PDFModule --> PDFSections

    %% Data Flow from Data Layer to Presentation Layers
    DataLayer -->|"data"| WebFrontend
    DataLayer -->|"data"| PDFModule

    %% Assets feeding into Presentation Layers
    Assets -->|"assets"| WebFrontend
    Assets -->|"assets"| PDFModule
    StaticFiles -->|"static"| WebFrontend
    StaticFiles -->|"static"| PDFModule

    %% Build and Utility Scripts automate components
    BuildScripts -->|"automation"| DataLayer
    BuildScripts -->|"automation"| WebFrontend
    BuildScripts -->|"automation"| PDFModule
    BuildScripts -->|"automation"| Assets
    BuildScripts --> Favicons
    BuildScripts --> PDFScript

    %% Configuration feeds the Build Process
    AstroConfig --> BuildScripts
    TailwindConfig --> BuildScripts
    GitHub --> BuildScripts

    %% Technologies influence core components
    Tech --> DataLayer
    Tech --> WebFrontend
    Tech --> PDFModule

    %% Click Events
    click DataLayer "https://github.com/vishaltalreja01/portfolio/tree/main/src/data"
    click DataInternals "https://github.com/vishaltalreja01/portfolio/tree/main/src/data/_internals"
    click DataConfig "https://github.com/vishaltalreja01/portfolio/blob/main/src/data/config.ts"
    click DataSections "https://github.com/vishaltalreja01/portfolio/tree/main/src/data/sections"
    click WebFrontend "https://github.com/vishaltalreja01/portfolio/tree/main/src/web"
    click WebComponents "https://github.com/vishaltalreja01/portfolio/tree/main/src/web/components"
    click WebSections "https://github.com/vishaltalreja01/portfolio/tree/main/src/web/sections"
    click PDFModule "https://github.com/vishaltalreja01/portfolio/tree/main/src/pdf"
    click PDFComponents "https://github.com/vishaltalreja01/portfolio/tree/main/src/pdf/components"
    click PDFSections "https://github.com/vishaltalreja01/portfolio/tree/main/src/pdf/sections"
    click Assets "https://github.com/vishaltalreja01/portfolio/tree/main/src/assets"
    click StaticFiles "https://github.com/vishaltalreja01/portfolio/tree/main/public"
    click BuildScripts "https://github.com/vishaltalreja01/portfolio/tree/main/scripts"
    click Favicons "https://github.com/vishaltalreja01/portfolio/blob/main/scripts/generate-favicons.ts"
    click PDFScript "https://github.com/vishaltalreja01/portfolio/blob/main/scripts/generate-pdf.ts"
    click AstroConfig "https://github.com/vishaltalreja01/portfolio/blob/main/astro.config.ts"
    click TailwindConfig "https://github.com/vishaltalreja01/portfolio/blob/main/tailwind.config.cjs"
    click GitHub "https://github.com/vishaltalreja01/portfolio/blob/main/.github"

    %% Styles
    classDef core fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef presentation fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef assets fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
    classDef utility fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef config fill:#abebc6,stroke:#1e8449,stroke-width:2px;
    classDef tech fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
```
