# adrianhajdin/portfolio_website architecture

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

- Interactive diagram: https://gitdiagram.com/adrianhajdin/portfolio_website
- Repository: https://github.com/adrianhajdin/portfolio_website

## Overview

##### Project type and purpose
- This is a client-side heavy personal portfolio website built with React and Next.js. Its primary purpose is to serve as a developer’s resume/business card, showcasing accomplishments, projects, timeline, technologies, etc., as a statically generated or server-rendered site.

##### File structure
- Top-level files: .babelrc, package.json, next.js config files, README.md
- public/: static assets (images, favicon, etc.)
- src/pages/: Next.js page and API route definitions
- index.js (home page)
- _app.js / _document.js (app‐wide wrappers, custom server document)
- api/hello.js (example serverless API endpoint)
- src/components/: reusable React UI components (Hero, Header, Footer, Projects, Timeline, etc.)
- src/layout/: layout component wrapping pages
- src/styles/ & src/themes/: global styles, theme definitions, styled-component configurations
- src/constants/: shared constants used across components
- package.json & lock: dependencies (React, Next.js, styled-components, etc.)

##### README for additional insights
- It confirms use of React + Next.js, NPM scripts for build/start
- Mentions the project is a tutorial to create a personal portfolio
- No external database or microservice; just a demo API route

##### Main components and interactions
a. Components
- User’s Browser (client)
- Next.js Application (hosted on Vercel, Netlify, or custom Node.js server)
- Static Asset Store / CDN (serving public/ and .next/static/)
- React Components Library (Header, Hero, Projects, Timeline, Footer, etc.)
- Layout & Theming Layer (global styles, themes, Layout.js)
- API Layer (Next.js serverless function at /api/hello)
- Build Process (Webpack/Babel via Next.js → SSG/SSR artifacts)
b. Relationships & interactions
- Browser → Next.js Server: HTTP GET / → responds with SSR or cached static HTML + JS bundle
- Browser → CDN: fetch CSS, JS, images from public/ and .next/static/
- React Components composed inside Layout to render the page
- Browser → API Endpoint (/api/hello) for dynamic data calls (optional demo)
- Build Process pulls src/pages & src/components → outputs static assets + serverless functions
c. Architectural patterns & design principles
- Component-based UI (atomic React components, styled via styled-components or CSS-in-JS)
- Page-level routing (file-based routing via Next.js)
- Hybrid static + server-side rendering (SSG at build, SSR/per-request for dynamic pages)
- Theming / centralized styles (GlobalComponents, theme.js)
d. Key technologies/frameworks/libraries
- Next.js (routing, SSR/SSG, API routes)
- React
- styled-components or CSS-in-JS for styling
- Node.js (server/runtime for API)
- Webpack/Babel (build toolchain)

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["User Browser"]
    Build["Build Pipeline<br/>(Next.js, Webpack/Babel)"]:::build
    subgraph "Hosting Platform (e.g., Vercel)"
        CDN["CDN / Static Asset Store"]:::cdn
        subgraph "Next.js Server"
            subgraph "Pages"
                HomePage["index.js"]:::backend
                AppWrapper["_app.js"]:::backend
                Document["_document.js"]:::backend
            end
            subgraph "API Routes"
                Hello["hello.js"]:::backend
            end
            subgraph "Layout & Theming"
                LayoutComp["Layout.js"]:::frontend
                LayoutStyles["LayoutStyles.js"]:::frontend
                GlobalStyles["globals.js"]:::frontend
                GlobalComponents["GlobalComponents/"]:::frontend
                ThemeDefs["theme.js"]:::frontend
            end
            subgraph "React Components Library"
                Acomplishments["Acomplishments.js"]:::frontend
                BackgroundAnimation["BackgroundAnimation.js"]:::frontend
                Header["Header.js"]:::frontend
                Hero["Hero.js"]:::frontend
                NavDropDown["NavDropDown.js"]:::frontend
                Projects["Projects.js"]:::frontend
                Technologies["Technologies.js"]:::frontend
                Timeline["TimeLine.js"]:::frontend
                Footer["Footer.js"]:::frontend
            end
        end
    end

    Browser -->|"GET /"| HomePage
    Browser -->|"GET Static Assets"| CDN
    Browser -->|"/api/hello"| Hello
    Build -->|Build SSG/SSR Artifacts| CDN
    Build -->|Deploy Pages & API| HomePage
    Build -->|Deploy Pages & API| Hello

    classDef frontend fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1
    classDef backend fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20
    classDef cdn fill:#FFE0B2,stroke:#E65100,color:#E65100
    classDef build fill:#E1BEE7,stroke:#4A148C,color:#4A148C

    click CDN "https://github.com/adrianhajdin/portfolio_website/tree/main/public/"
    click HomePage "https://github.com/adrianhajdin/portfolio_website/blob/main/src/pages/index.js"
    click AppWrapper "https://github.com/adrianhajdin/portfolio_website/blob/main/src/pages/_app.js"
    click Document "https://github.com/adrianhajdin/portfolio_website/blob/main/src/pages/_document.js"
    click Hello "https://github.com/adrianhajdin/portfolio_website/blob/main/src/pages/api/hello.js"
    click Acomplishments "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Acomplishments/Acomplishments.js"
    click BackgroundAnimation "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/BackgrooundAnimation/BackgroundAnimation.js"
    click Header "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Header/Header.js"
    click Hero "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Hero/Hero.js"
    click NavDropDown "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/NavDropDown/NavDropDown.js"
    click Projects "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Projects/Projects.js"
    click Technologies "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Technologies/Technologies.js"
    click Timeline "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/TimeLine/TimeLine.js"
    click Footer "https://github.com/adrianhajdin/portfolio_website/blob/main/src/components/Footer/Footer.js"
    click LayoutComp "https://github.com/adrianhajdin/portfolio_website/blob/main/src/layout/Layout.js"
    click LayoutStyles "https://github.com/adrianhajdin/portfolio_website/blob/main/src/layout/LayoutStyles.js"
    click GlobalStyles "https://github.com/adrianhajdin/portfolio_website/blob/main/src/styles/globals.js"
    click GlobalComponents "https://github.com/adrianhajdin/portfolio_website/tree/main/src/styles/GlobalComponents/"
    click ThemeDefs "https://github.com/adrianhajdin/portfolio_website/blob/main/src/styles/theme.js"
    click Build "https://github.com/adrianhajdin/portfolio_website/blob/main/package.json"
```
