# charingan/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Angular (v19).
- Its purpose is to serve as a personal portfolio website, with sections like Home, About, Skills, Projects, Art, and Contact.

##### File structure
Top-level files and folders:
- angular.json, tsconfig*.json, package.json – Angular build and TypeScript configuration
- src/ – application source code
– src/app/ – all Angular components and routing
– src/index.html, main.ts – application entry point and bootstrap
– src/styles.scss – global styles
- public/ – static assets (CV.pdf)
- README.md – Angular CLI instructions

Inside src/app/:
- app.config.ts – global configuration constants
- app.routes.ts – route definitions for the Angular Router
- app.component.* – the root component (shell)
- feature folders (about, art, contact, footer, header, home, project, skills) – each contains one component

##### README for additional insights
- No backend or external API is mentioned – this is a static, client-only site.
- Standard Angular CLI commands are used for serve, build, test.

##### Main components
a. User / Browser – the end user interacts through a web browser.
b. Static Web Server (e.g., Netlify, Firebase Hosting, GitHub Pages) – serves the compiled files from dist/.
c. Angular Application – runs in the browser and consists of:
- Bootstrap (main.ts → AppModule)
- AppComponent (shell)
- Router (app.routes.ts)
- Feature Components (AboutComponent, HomeComponent, etc.)
- Shared Components (HeaderComponent, FooterComponent)
- Global styles and assets (styles.scss, public/)
d. Build Pipeline – Angular CLI & Webpack that produces dist/ artifacts

##### Relationships and interactions
- The user makes HTTP requests to the static web server, which serves index.html and bundled JS/CSS.
- The browser loads the Angular runtime, bootstraps AppModule in main.ts.
- AppComponent initializes and the Angular Router picks a feature component based on the URL.
- Feature components may read from app.config.ts for any constants (e.g., profile data), load static assets from public/.

##### Architectural patterns & design principles
- Component-based architecture (each UI section is an isolated component)
- Separation of concerns:
- Routing logic in app.routes.ts
- Configuration in app.config.ts
- Presentation in .html/.scss files
- Single Responsibility: each Angular component has its own folder and resources.

##### Technologies/frameworks/libraries
- Angular framework (modules, components, router)
- TypeScript
- SCSS for styling
- Angular CLI (build, serve, test)

##### Elements
- Clear labels: “User”, “Browser”, “Static Host”, “Angular Runtime”, “AppModule”, “Feature Components”, “Assets”
- User → Browser (interaction)
- Browser → Static Host (HTTP GET /)
- Static Host → Browser (index.html + bundles)
- Bundles → Angular Runtime → AppModule → Components
- Rectangles for components/modules
- Parallelogram for config files

##### Final advice
- Don’t over-complicate: this is a single‐tier front-end app.
1. Presentation (Browser + UI components)
2. Application (Angular modules & router)
3. Deployment (Static host & build pipeline)
- Every folder and file category as a component or asset block so nothing is missed.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User"]:::frontend
        Browser["Browser"]:::frontend
    end

    %% Deployment Layer
    subgraph "Deployment Layer"
        direction TB
        CLI["Angular CLI & Build Configuration"]:::infra
        BuildPipeline["Build Pipeline (Webpack)"]:::infra
        dist["dist/ (Compiled Artifacts)"]:::infra
        StaticHost["Static Web Server"]:::infra
        CV["CV.pdf"]:::asset
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        Assets["Static Assets (public/)"]:::asset
        IndexHTML["index.html"]:::code
        Styles["Global Styles (styles.scss)"]:::code
        Runtime["Angular Runtime"]:::code
        mainTs["Bootstrap (main.ts)"]:::code
        AppModule["AppModule"]:::code
        AppComponent["AppComponent"]:::code
        Router["Router (app.routes.ts)"]:::config
        Config["Global Config (app.config.ts)"]:::config

        subgraph "Feature Components"
            direction TB
            Home["HomeComponent"]:::code
            About["AboutComponent"]:::code
            Skills["SkillsComponent"]:::code
            Projects["ProjectsComponent"]:::code
            Art["ArtComponent"]:::code
            Contact["ContactComponent"]:::code
            Header["HeaderComponent"]:::code
            Footer["FooterComponent"]:::code
        end
    end

    %% Connections
    User -->|"interacts with"| Browser
    Browser -->|"HTTP GET /"| StaticHost
    StaticHost -->|"serves index.html + bundles"| Browser

    CLI -->|builds| BuildPipeline
    BuildPipeline -->|outputs| dist
    dist -->|deployed to| StaticHost

    Browser -->|"loads"| IndexHTML
    Browser -->|"loads"| dist

    IndexHTML -->|"bootstraps"| Runtime
    Runtime -->|"executes"| mainTs
    mainTs -->|"imports"| AppModule
    AppModule -->|"initializes"| AppComponent
    AppComponent -->|"loads"| Router
    Router -->|"routes to"| Home
    Router -->|"routes to"| About
    Router -->|"routes to"| Skills
    Router -->|"routes to"| Projects
    Router -->|"routes to"| Art
    Router -->|"routes to"| Contact

    AppModule -->|"provides"| Config
    AppModule -->|"declares"| Header
    AppModule -->|"declares"| Footer
    AppModule -->|"declares"| Home
    AppModule -->|"declares"| About
    AppModule -->|"declares"| Skills
    AppModule -->|"declares"| Projects
    AppModule -->|"declares"| Art
    AppModule -->|"declares"| Contact

    AppComponent -->|"uses"| Header
    AppComponent -->|"uses"| Footer
    AllAssets["Assets & Styles"] --> Assets
    AllAssets --> Styles
    AllAssets --> CV

    AppComponent -->|"renders"| AllAssets

    %% Click Events
    click mainTs "https://github.com/charingan/portfolio/blob/master/src/main.ts"
    click AppModule "https://github.com/charingan/portfolio/blob/master/src/app/app.component.ts"
    click Router "https://github.com/charingan/portfolio/blob/master/src/app/app.routes.ts"
    click Config "https://github.com/charingan/portfolio/blob/master/src/app/app.config.ts"
    click Home "https://github.com/charingan/portfolio/blob/master/src/app/home/home.component.ts"
    click About "https://github.com/charingan/portfolio/blob/master/src/app/about/about.component.ts"
    click Skills "https://github.com/charingan/portfolio/blob/master/src/app/skills/skills.component.ts"
    click Projects "https://github.com/charingan/portfolio/blob/master/src/app/project/project.component.ts"
    click Art "https://github.com/charingan/portfolio/blob/master/src/app/art/art.component.ts"
    click Contact "https://github.com/charingan/portfolio/blob/master/src/app/contact/contact.component.ts"
    click Header "https://github.com/charingan/portfolio/blob/master/src/app/header/header.component.ts"
    click Footer "https://github.com/charingan/portfolio/blob/master/src/app/footer/footer.component.ts"
    click Styles "https://github.com/charingan/portfolio/blob/master/src/styles.scss"
    click CV "https://github.com/charingan/portfolio/blob/master/public/cv/CV.pdf"
    click IndexHTML "https://github.com/charingan/portfolio/blob/master/src/index.html"
    click CLI "https://github.com/charingan/portfolio/blob/master/angular.json"

    %% Styles
    classDef frontend fill:#FDE068,stroke:#333,stroke-width:1px
    classDef infra fill:#6BA3E5,stroke:#333,stroke-width:1px
    classDef code fill:#68C3A3,stroke:#333,stroke-width:1px
    classDef config fill:#C47ED6,stroke:#333,stroke-width:1px
    classDef asset fill:#EB6B6B,stroke:#333,stroke-width:1px
```
