# cuyakonwu/mlh-portfolio architecture

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

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

## Overview

##### Main System Components

a) Web Application Layer:
- Flask Application Server (Core)
- Jinja2 Template Engine
- Static Asset Handler

b) Data Layer:
- SQLite Database (mydatabase.db)

c) Infrastructure Layer:
- Docker Container Environment
- Nginx Reverse Proxy (indicated by user_conf.d)

##### Component Organization

**[Client Browser] → [Nginx Reverse Proxy] → [Flask Application]**
- ↙           ↘
- [Static Files]    [Templates]
- ↓
- [SQLite Database]

##### Specific Implementation Details

a) Flask Application Structure:
- Main app module (app/__init__.py)
- It to the template directory (app/templates)
- Link to static assets (app/static)
- CSS files
- JavaScript files
- Images

b) Infrastructure Components:
- Docker container environment (shown by Dockerfile and docker-compose files)
- Nginx configuration (user_conf.d)
- GitHub Actions workflow for CI/CD (.github/workflows)

##### Design Elements

Use these visual elements:
- Blue rectangles for application components
- Green rectangles for infrastructure components
- Yellow rectangles for data storage

- Client Layer  | →   | Infrastructure  |  →  |  Application   |
- (Browser)     |     | (Docker/Nginx)  |     |  Layer        |

- ↓

- Data Layer    |
- (SQLite)      |

##### Key Workflows

Main workflows with numbered sequences:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph Infrastructure
        Docker["Docker Container"]:::infra
        Nginx["Nginx Reverse Proxy"]:::infra
        CICD["GitHub Actions CI/CD"]:::infra
    end

    subgraph Application
        Flask["Flask Application Server"]:::app
        Templates["Jinja2 Templates"]:::app
        Static["Static Assets"]:::app
    end

    subgraph Data
        DB[(SQLite Database)]:::data
    end

    %% Client Layer Connections
    Browser -->|HTTP Requests| Nginx

    %% Infrastructure Layer Connections
    Nginx -->|Reverse Proxy| Flask
    Docker -->|Hosts| Flask
    CICD -->|Deploys| Docker

    %% Application Layer Connections
    Flask -->|Renders| Templates
    Flask -->|Serves| Static
    Flask -->|Queries| DB

    %% Static Assets Subcomponents
    subgraph Static Assets
        CSS["CSS Files"]:::static
        JS["JavaScript Files"]:::static
        Images["Image Files"]:::static
    end

    %% Template Files Subcomponents
    subgraph Template Files
        Base["base.html"]:::template
        Index["index.html"]:::template
        About["about.html"]:::template
        Experience["experience.html"]:::template
        Hobbies["hobbies.html"]:::template
        Map["map.html"]:::template
        Timeline["timeline.html"]:::template
    end

    %% Click Events
    click Flask "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/__init__.py"
    click Base "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/base.html"
    click Index "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/index.html"
    click About "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/about.html"
    click Experience "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/experience.html"
    click Hobbies "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/hobbies.html"
    click Map "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/map.html"
    click Timeline "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/app/templates/timeline.html"
    click CSS "https://github.com/cuyakonwu/MLH-Portfolio/tree/main/app/static/styles"
    click JS "https://github.com/cuyakonwu/MLH-Portfolio/tree/main/app/static/scripts"
    click Images "https://github.com/cuyakonwu/MLH-Portfolio/tree/main/app/static/img"
    click DB "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/mydatabase.db"
    click Docker "https://github.com/cuyakonwu/MLH-Portfolio/tree/main/Dockerfile"
    click Nginx "https://github.com/cuyakonwu/MLH-Portfolio/blob/main/user_conf.d/myportfolio.conf"
    click CICD "https://github.com/cuyakonwu/MLH-Portfolio/tree/main/.github/workflows"

    %% Styling
    classDef infra fill:#90EE90,stroke:#333,stroke-width:2px
    classDef app fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef data fill:#FFD700,stroke:#333,stroke-width:2px
    classDef static fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef template fill:#F0E68C,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Infrastructure Component"]:::infra
        L2["Application Component"]:::app
        L3["Data Storage"]:::data
        L4["Static Asset"]:::static
        L5["Template File"]:::template
    end
```
