# ahmedaziz703/ahmed-portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built with Create React App, React, TypeScript, and Styled Components.
- Its purpose is to serve as a personal portfolio website showcasing skills, projects, and contact details.

##### File structure
- public/
– index.html: the SPA shell and root `
` where React mounts.
– sitemap.xml and public/Images: static assets for SEO and images.
- src/
– index.tsx: entry point that renders `<App />`.
– App.tsx: the root React component that stitches together Header, Hero, Main, About, Project, Contact, Footer.
– @types/: type declarations (e.g. image.d.ts).
– assets/: PDF resumes and other media.
– components/: each subfolder is a distinct UI module with its own .tsx and styles.ts.
– styles/global.ts: global styled‐component definitions and theme.
- Configuration & build
– package.json / package-lock.json: dependencies and scripts (`yarn start`, `yarn build`).
– tsconfig.json: TypeScript compiler settings.

##### Key insights from README
- No backend or API layers; entirely frontend.
- Uses React + TypeScript + Styled Components.
- SPA hosted on a static‐file server or CDN.

a. Main components:
1) Browser / Client (User)
2) Static Hosting / CDN
3) React SPA (bundled JavaScript + CSS + index.html)
4) Component hierarchy:
- App
→ Header
→ Hero
→ Main
→ About
→ Project
→ Contact (with Form)
→ Footer
- Global Styles
- Assets (PDF, images)
b. Relationships and data flow:
- User requests index.html from CDN → Browser loads JS/CSS bundle → index.tsx mounts `<App />`.
- App composes child components; each imports styled‐components from styles.ts.
- Components may read static assets or type declarations.
c. Architectural patterns & principles:
- Component‐based UI with clear separation of concerns (presentation vs. layout).
- Theming and global styles via Styled Components.
- Type safety through TypeScript and custom `.d.ts` for assets.
d. Key technologies/libraries:
- React for UI
- TypeScript for typing
- Styled Components for CSS‐in‐JS
- CRA build pipeline (Webpack under the hood)
- Yarn / npm scripts

##### Detailed element checklist
- Entry point: index.html & index.tsx → mount point.
- Build pipeline: CRA/webpack → bundle.js, bundle.css.
- Component hierarchy: map out each folder under src/components.
- Styling: global.ts + each styles.ts file.
- Type definitions: annotate that @types/image.d.ts enables static import of images.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Runtime Layer
    Browser["Browser / Client"]:::runtime
    CDN["Static Hosting / CDN"]:::infra

    %% Build Pipeline
    Build["CRA / Webpack Build"]:::process

    %% React SPA Bundle
    Bundle["Static Bundle<br/>(index.html, bundle.js, bundle.css)"]:::assets

    %% React SPA Subgraph
    subgraph "React SPA" 
        direction TB
        ReactEntry["index.tsx"]:::code
        AppRoot["App.tsx"]:::code
        GlobalStyles["global.ts"]:::code
        TypeDecl["@types/image.d.ts"]:::code
        Assets["Assets (PDF, Images)"]:::assets

        subgraph "Components" 
            direction TB
            subgraph "Layout Components"
                HeaderComp["Header"]:::code
                HeroComp["Hero"]:::code
                MainComp["Main"]:::code
                FooterComp["Footer"]:::code
            end
            subgraph "Section Components"
                AboutComp["About"]:::code
                ProjectComp["Project"]:::code
                ContactComp["Contact"]:::code
                subgraph "Form Module"
                    FormComp["Form"]:::code
                end
            end
        end
    end

    %% Data Flow
    Browser -->|"HTTP GET index.html"| CDN
    CDN -->|"Serves bundle"| Browser
    Browser -->|"Loads JS/CSS bundle"| Bundle
    Bundle -->|"Executes"| ReactEntry
    ReactEntry -->|"mounts"| AppRoot
    AppRoot -->|"applies"| GlobalStyles
    AppRoot -->|"uses"| TypeDecl
    AppRoot -->|"imports"| Assets
    AppRoot -->|"renders children"| HeaderComp
    AppRoot --> HeaderComp --> HeroComp --> MainComp --> AboutComp --> ProjectComp --> ContactComp --> FooterComp
    ContactComp -->|"contains"| FormComp

    %% Click Events
    click Browser "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/public/index.html"
    click ReactEntry "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/index.tsx"
    click AppRoot "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/App.tsx"
    click HeaderComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Header/Header.tsx"
    click HeroComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Hero/Hero.tsx"
    click MainComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Main/Main.tsx"
    click AboutComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/About/About.tsx"
    click ProjectComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Project/Project.tsx"
    click ContactComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Contact/Contact.tsx"
    click FormComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Form/Form.tsx"
    click GlobalStyles "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/styles/global.ts"
    click TypeDecl "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/@types/image.d.ts"
    click Assets "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/assets/Ahmed_Alregas_Resume.pdf"
    click Assets "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/assets/Ahmed_Alregas_Singh_Resume.pdf"
    click FooterComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Footer/Footer.tsx"
    click HeaderComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Header/styles.ts"
    click HeroComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Hero/styles.ts"
    click MainComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Main/styles.ts"
    click AboutComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/About/styles.ts"
    click ProjectComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Project/styles.ts"
    click ContactComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Contact/styles.ts"
    click FormComp "https://github.com/ahmedaziz703/ahmed-portfolio/blob/main/src/components/Form/styles.ts"

    %% Styles
    classDef runtime fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef infra fill:#c2f0c2,stroke:#000,stroke-width:1px
    classDef process fill:#FFE5B4,stroke:#000,stroke-width:1px
    classDef assets fill:#A9A9A9,stroke:#000,stroke-width:1px
    classDef code fill:#FFD580,stroke:#000,stroke-width:1px
```
