# carloscarmarcus/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built with Create React App.
- It appears to be a personal or marketing site (with Home, About pages, a ContactForm, and a downloadable CV), fully client‐side, internationalized, and styled via SCSS.

##### File structure
- Top-level “public/” holds static assets (index.html, manifest, robots.txt, images).
- “src/” contains the React entrypoint (index.js), overall App component (App.js), subfolders:
- assets/ (cv.pdf)
- components/ (Header, Footer, Hero, ContactForm, Layout)
- pages/ (Home.js, About.js)
- i18n/ (internationalization setup + JSON locale files)
- styles/ (SCSS organized by base, components, layout, pages)
- No backend folder or server code—this is a pure frontend.

##### README
- Confirms CRA bootstrap, standard npm scripts (`start`, `build`, `test`), and deployment is just a static build.

a. Main components
- User’s Browser
- Static Web Host / CDN (serves build assets: index.html, JS bundles, CSS, locale JSON, cv.pdf, images)
- React SPA runtime
– Router (App.js + React Router)
– Page components (Home, About)
– Reusable UI components (Header, Footer, Hero, ContactForm, ProjectCard, etc.)
– i18next/i18n module + locale JSON files
– SCSS styles compiled into CSS
- External services (optional)—e.g., an email service or serverless function invoked by ContactForm
- Package/build toolchain (Webpack/Babel, npm scripts)

b. Relationships and interactions
- Browser → HTTP GET → Static Host → serves index.html + assets → Browser
- index.html bootstraps React App bundle (main.js, vendor.js, CSS)
- React Router in App.js maps URLs to page components
- Page components render UI components, which:
– Load localized text from JSON via the i18n library
– Fetch/show static assets (cv.pdf, images)
– On form submission, ContactForm → POST → External email service / serverless endpoint
- npm run build pipeline: source files → Webpack/Babel → optimized build folder

c. Architectural patterns / design principles
- SPA with client‐side routing (React Router)
- Component‐based architecture (atomic/reusable components in src/components)
- CSS modularization via SCSS partials (base, layout, components, pages)
- Internationalization pattern (i18n directory + JSON files)
- Static hosting / CDN deployment

d. Key technologies / frameworks
- React
- React Router (implied)
- i18next (for localization)
- SCSS (Sass)
- Webpack / Babel (via CRA)
- npm / yarn scripts
- Optional: serverless/email API

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser and Hosting
    Browser["User's Browser"]:::client
    CDN["Static Host / CDN"]:::static

    Browser -->|HTTP GET index.html + assets| CDN
    CDN -->|Serves bundles| Browser

    %% Build & Deployment
    subgraph "Build Pipeline"
        direction TB
        Source["src/ (JSX, SCSS, i18n, assets)"]:::pipeline
        Webpack["Webpack / Babel"]:::pipeline
        BuildFolder["build/ (optimized assets)"]:::pipeline
    end
    Source -->|npm run build| Webpack --> BuildFolder --> CDN

    click Source "https://github.com/carloscarmarcus/portfolio/tree/master/src/"
    
    %% Static Public Assets
    subgraph "Public Folder"  
        direction TB
        PublicHTML["public/index.html"]:::static
        Manifest["public/manifest.json"]:::static
        Robots["public/robots.txt"]:::static
        Images["public/images/*"]:::static
    end
    click PublicHTML "https://github.com/carloscarmarcus/portfolio/blob/master/public/index.html"
    click Manifest "https://github.com/carloscarmarcus/portfolio/blob/master/public/manifest.json"
    click Robots "https://github.com/carloscarmarcus/portfolio/blob/master/public/robots.txt"
    click Images "https://github.com/carloscarmarcus/portfolio/tree/master/public/images/"

    CDN --> PublicHTML
    CDN --> Manifest
    CDN --> Robots
    CDN --> Images

    %% SPA Runtime in Browser
    subgraph "React SPA Runtime"  
        direction TB
        Entry["src/index.js"]:::client
        AppRouter["src/App.js (Router)"]:::client
        Entry --> AppRouter
    end
    click Entry "https://github.com/carloscarmarcus/portfolio/blob/master/src/index.js"
    click AppRouter "https://github.com/carloscarmarcus/portfolio/blob/master/src/App.js"

    Browser -->|Runs bundle| Entry

    %% Pages Layer
    subgraph "Pages"  
        direction TB
        Home["Home Page"]:::client
        About["About Page"]:::client
    end
    click Home "https://github.com/carloscarmarcus/portfolio/blob/master/src/pages/Home.js"
    click About "https://github.com/carloscarmarcus/portfolio/blob/master/src/pages/About.js"
    AppRouter -->|"Route '/'"| Home
    AppRouter -->|"Route '/about'"| About

    %% Components Layer
    subgraph "UI Components"
        direction TB
        Header["Header"]:::client
        Footer["Footer"]:::client
        Hero["Hero Section"]:::client
        ContactForm["Contact Form"]:::client
        Layout["Layout Wrapper"]:::client
    end
    click Header "https://github.com/carloscarmarcus/portfolio/blob/master/src/components/Header.js"
    click Footer "https://github.com/carloscarmarcus/portfolio/blob/master/src/components/Footer.js"
    click Hero "https://github.com/carloscarmarcus/portfolio/blob/master/src/components/Hero.jsx"
    click ContactForm "https://github.com/carloscarmarcus/portfolio/blob/master/src/components/ContactForm.js"
    click Layout "https://github.com/carloscarmarcus/portfolio/blob/master/src/components/Layout.js"

    Home --> Header --> Layout
    About --> Header
    Home --> Hero
    Home --> ContactForm -->|"POST"| ExternalService
    About --> Footer

    %% i18n Subsystem
    subgraph "Internationalization (i18n)"  
        direction TB
        I18nSetup["i18n Setup"]:::client
        subgraph "Locale JSON Files"
            direction TB
            ENCommon["en/common.json"]:::data
            ENAbout["en/about.json"]:::data
            ENHero["en/hero.json"]:::data
            ENHome["en/home.json"]:::data
            SVCommon["sv/common.json"]:::data
            SVAbout["sv/about.json"]:::data
            SVHero["sv/hero.json"]:::data
            SVHome["sv/home.json"]:::data
        end
    end
    click I18nSetup "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/i18n.js"
    click ENCommon "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/en/common.json"
    click ENAbout "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/en/about.json"
    click ENHero "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/en/hero.json"
    click ENHome "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/en/home.json"
    click SVCommon "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/sv/common.json"
    click SVAbout "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/sv/about.json"
    click SVHero "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/sv/hero.json"
    click SVHome "https://github.com/carloscarmarcus/portfolio/blob/master/src/i18n/locales/sv/home.json"

    AppRouter --> I18nSetup
    I18nSetup --> ENCommon
    I18nSetup --> ENAbout
    I18nSetup --> ENHero
    I18nSetup --> ENHome
    I18nSetup --> SVCommon
    I18nSetup --> SVAbout
    I18nSetup --> SVHero
    I18nSetup --> SVHome

    %% Assets & Styles
    subgraph "Assets & Styles"
        direction TB
        PDF["cv.pdf"]:::data
        SCSSMain["src/styles/main.scss"]:::client
        subgraph "SCSS Partials"
            direction TB
            Base["_base.scss / _mixins.scss / _variables.scss"]:::client
            ComponentsSCSS["_button.scss / _contact-form.scss / _project-card.scss"]:::client
            LayoutSCSS["_header.scss / _footer.scss / _hero.scss"]:::client
            PagesSCSS["_home.scss / _about.scss / _contact.scss"]:::client
        end
    end
    click PDF "https://github.com/carloscarmarcus/portfolio/blob/master/src/assets/cv.pdf"
    click SCSSMain "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/main.scss"
    click Base "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/base/_base.scss"
    click Base "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/base/_mixins.scss"
    click Base "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/base/_variables.scss"
    click ComponentsSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/components/_button.scss"
    click ComponentsSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/components/_contact-form.scss"
    click ComponentsSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/components/_project-card.scss"
    click LayoutSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/layout/_header.scss"
    click LayoutSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/layout/_footer.scss"
    click LayoutSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/layout/_hero.scss"
    click PagesSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/pages/_home.scss"
    click PagesSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/pages/_about.scss"
    click PagesSCSS "https://github.com/carloscarmarcus/portfolio/blob/master/src/styles/pages/_contact.scss"

    Hero --> PDF
    AppRouter --> SCSSMain
    SCSSMain --> Base
    SCSSMain --> ComponentsSCSS
    SCSSMain --> LayoutSCSS
    SCSSMain --> PagesSCSS

    %% External Service
    ExternalService["External Email Service / Serverless"]:::external

    classDef client fill:#D0E8FF,stroke:#0066CC,color:#003366
    classDef data fill:#DFF2BF,stroke:#4F8A10,color:#4F8A10
    classDef static fill:#FFE8A1,stroke:#CC6600,color:#663300
    classDef pipeline fill:#F3D6FF,stroke:#9933CC,color:#660066
    classDef external fill:#E0E0E0,stroke:#666666,color:#333333
```
