# ahmedkhaleel2004/mlh-portfolio architecture

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

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

## Overview

1. This repository is a small Flask-based portfolio site. The application layer lives under `app/` and is rendered server-side with Jinja templates, rather than using a separate frontend app or API-first design.

2. The core runtime is Python/Flask, with dependencies pinned in `requirements.txt`. `app/__init__.py` is the app entry point and likely wires route handlers to page templates.

3. The user-facing pages are template-driven and organized by content section: `index.html`, `timeline.html`, `work_experiences.html`, `education.html`, `hobbies.html`, and `map.html`. The architecture is page-centric, with each portfolio topic mapped to its own route/template pair.

4. Static assets are separated cleanly under `app/static/`, including `styles/main.css` and image assets in `app/static/img`. This creates the usual Flask boundary between dynamic HTML rendering and static presentation/media delivery.

5. The README indicates the app uses Jinja to render repeated portfolio entries such as multiple jobs, education items, and hobbies. That suggests the data flow is: Python data structures in the Flask app feed template loops, which generate the HTML sections dynamically.

6. The navigation/menu is also dynamic per the README, implying shared layout logic across pages rather than duplicated hardcoded links. Architecturally, this means the templates likely share a common navigation pattern and page-specific content blocks.

7. Tests are split by concern in `tests/test_app.py` and `tests/test_db.py`. Even without a visible database service in the tree, the presence of `test_db.py` implies a persistence or data-layer boundary that is tested separately from route behavior.

8. Deployment is containerized. `Dockerfile`, `docker-compose.yml`, and `docker-compose.prod.yml` define distinct local and production execution paths, which means the app can run standalone in development but is also packaged for repeatable deployment.

9. The `user_conf.d/myportfolio.conf` file suggests a server-side reverse-proxy or web-server configuration layer in production, likely used to route requests to the Flask app container or process. This is the main infrastructure boundary outside the app itself.

10. CI/CD is handled through GitHub Actions in `.github/workflows/test.yml` and `.github/workflows/deploy.yml`. The repo therefore has an automated quality gate and a deployment pipeline, with `redeploy-site.sh` serving as an operational helper for pushing updates.

11. The `app/curl-test.sh` and `run_test.sh` scripts indicate lightweight local validation and smoke-testing support. These sit beside the main app code and help verify the HTTP surface from outside the Flask process.

12. In architecture-diagram terms, the system is simple: browser/client request -> Flask app -> Jinja template rendering -> static assets/images/CSS -> response. Around that core are separate testing, containerization, and deployment layers that do not change the app logic but control how it is verified and hosted.

Main entry points: [`app/__init__.py`](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/__init__.py) (Flask app), [`app/static/styles/main.css`](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/static/styles/main.css) (Main CSS), [`app/templates/work_experiences.html`](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/work_experiences.html) (Work), [`Dockerfile`](https://github.com/ahmedkhaleel2004/mlh-portfolio/tree/main/Dockerfile) (Dockerfile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_app["Application"]
  node_node_app_init["Flask app<br/>entrypoint<br/>[__init__.py]"]
  node_node_templates_index["Home page<br/>template<br/>[index.html]"]
  node_node_templates_timeline["Timeline<br/>template<br/>[timeline.html]"]
  node_node_templates_work["Work<br/>template"]
  node_node_templates_education["Education<br/>template<br/>[education.html]"]
  node_node_templates_hobbies["Hobbies<br/>template<br/>[hobbies.html]"]
  node_node_templates_map["Map<br/>template<br/>[map.html]"]
  node_node_static_css["Main CSS<br/>stylesheet<br/>[main.css]"]
  node_node_static_img[("Images<br/>assets")]
end

subgraph group_grp_ops["Operations"]
  node_node_dockerfile["Dockerfile<br/>container build"]
  node_node_compose_dev["Compose dev<br/>orchestration<br/>[docker-compose.yml]"]
  node_node_compose_prod["Compose prod<br/>orchestration"]
  node_node_nginx_conf["Web config<br/>reverse proxy config<br/>[myportfolio.conf]"]
  node_node_redeploy["Redeploy<br/>ops script<br/>[redeploy-site.sh]"]
end

subgraph group_grp_ci["Quality & CI"]
  node_node_test_app["App tests<br/>pytest<br/>[test_app.py]"]
  node_node_test_db["Data tests<br/>pytest<br/>[test_db.py]"]
  node_node_workflow_test["CI test<br/>github actions<br/>[test.yml]"]
  node_node_workflow_deploy["CI deploy<br/>github actions<br/>[deploy.yml]"]
  node_node_run_test["Smoke test<br/>script<br/>[run_test.sh]"]
  node_node_curl_test["HTTP check<br/>script<br/>[curl-test.sh]"]
end

subgraph group_grp_docs["Project Docs"]
  node_node_requirements["Dependencies<br/>python deps<br/>[requirements.txt]"]
  node_node_readme["README<br/>guide<br/>[README.md]"]
end

node_node_app_init -->|"renders"| node_node_templates_index
node_node_app_init -->|"renders"| node_node_templates_timeline
node_node_app_init -->|"renders"| node_node_templates_work
node_node_app_init -->|"renders"| node_node_templates_education
node_node_app_init -->|"renders"| node_node_templates_hobbies
node_node_app_init -->|"renders"| node_node_templates_map
node_node_app_init -->|"serves"| node_node_static_css
node_node_app_init -->|"serves"| node_node_static_img
node_node_templates_index -->|"uses"| node_node_static_css
node_node_templates_timeline -->|"uses"| node_node_static_css
node_node_templates_work -->|"uses"| node_node_static_css
node_node_templates_education -->|"uses"| node_node_static_css
node_node_templates_hobbies -->|"uses"| node_node_static_css
node_node_templates_map -->|"uses"| node_node_static_css
node_node_templates_work -->|"uses"| node_node_static_img
node_node_templates_education -->|"uses"| node_node_static_img
node_node_templates_hobbies -->|"uses"| node_node_static_img
node_node_requirements -.->|"depends on"| node_node_app_init
node_node_readme -.->|"describes"| node_node_app_init
node_node_readme -.->|"describes"| node_node_templates_work
node_node_test_app -.->|"verifies"| node_node_app_init
node_node_test_db -.->|"verifies"| node_node_app_init
node_node_workflow_test -.->|"runs"| node_node_test_app
node_node_workflow_test -.->|"runs"| node_node_test_db
node_node_workflow_deploy -.->|"packages"| node_node_dockerfile
node_node_dockerfile -->|"contains"| node_node_app_init
node_node_compose_dev -.->|"builds"| node_node_dockerfile
node_node_compose_prod -.->|"builds"| node_node_dockerfile
node_node_nginx_conf -.->|"routes to"| node_node_compose_prod
node_node_redeploy -.->|"supports"| node_node_workflow_deploy
node_node_run_test -.->|"smokes"| node_node_test_app
node_node_curl_test -.->|"hits"| node_node_app_init

click node_node_app_init "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/__init__.py"
click node_node_templates_index "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/index.html"
click node_node_templates_timeline "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/timeline.html"
click node_node_templates_work "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/work_experiences.html"
click node_node_templates_education "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/education.html"
click node_node_templates_hobbies "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/hobbies.html"
click node_node_templates_map "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/map.html"
click node_node_static_css "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/static/styles/main.css"
click node_node_static_img "https://github.com/ahmedkhaleel2004/mlh-portfolio/tree/main/app/static/img"
click node_node_requirements "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/requirements.txt"
click node_node_readme "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/README.md"
click node_node_test_app "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/tests/test_app.py"
click node_node_test_db "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/tests/test_db.py"
click node_node_workflow_test "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/.github/workflows/test.yml"
click node_node_workflow_deploy "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/.github/workflows/deploy.yml"
click node_node_dockerfile "https://github.com/ahmedkhaleel2004/mlh-portfolio/tree/main/Dockerfile"
click node_node_compose_dev "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/docker-compose.yml"
click node_node_compose_prod "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/docker-compose.prod.yml"
click node_node_nginx_conf "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/user_conf.d/myportfolio.conf"
click node_node_redeploy "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/redeploy-site.sh"
click node_node_run_test "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/run_test.sh"
click node_node_curl_test "https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/curl-test.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_app_init,node_node_templates_index,node_node_templates_timeline,node_node_templates_work,node_node_templates_education,node_node_templates_hobbies,node_node_templates_map,node_node_static_css,node_node_static_img toneBlue
class node_node_dockerfile,node_node_compose_dev,node_node_compose_prod,node_node_nginx_conf,node_node_redeploy toneAmber
class node_node_test_app,node_node_test_db,node_node_workflow_test,node_node_workflow_deploy,node_node_run_test,node_node_curl_test toneMint
class node_node_requirements,node_node_readme toneRose
```

## Components

### Application

Flask runtime, page handlers, templates, and assets.

- [Flask app](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/__init__.py): entrypoint · Application entrypoint that wires routes and rendering. · `app/__init__.py`
- [Home page](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/index.html): template · Main landing page template. · `app/templates/index.html`
- [Timeline](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/timeline.html): template · Chronological portfolio page template. · `app/templates/timeline.html`
- [Work](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/work_experiences.html): template · Work experience section template. · `app/templates/work_experiences.html`
- [Education](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/education.html): template · Education section template. · `app/templates/education.html`
- [Hobbies](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/hobbies.html): template · Hobbies section template. · `app/templates/hobbies.html`
- [Map](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/templates/map.html): template · Location or map page template. · `app/templates/map.html`
- [Main CSS](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/static/styles/main.css): stylesheet · Global styling for the rendered pages. · `app/static/styles/main.css`
- [Images](https://github.com/ahmedkhaleel2004/mlh-portfolio/tree/main/app/static/img): assets · Static image/media assets used by templates. · `app/static/img`

### Operations

Containerization, web-server config, and deployment helpers.

- [Dockerfile](https://github.com/ahmedkhaleel2004/mlh-portfolio/tree/main/Dockerfile): container build · Container image definition for the app. · `Dockerfile`
- [Compose dev](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/docker-compose.yml): orchestration · Local development container setup. · `docker-compose.yml`
- [Compose prod](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/docker-compose.prod.yml): orchestration · Production container setup. · `docker-compose.prod.yml`
- [Web config](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/user_conf.d/myportfolio.conf): reverse proxy config · Server-side routing and hosting configuration. · `user_conf.d/myportfolio.conf`
- [Redeploy](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/redeploy-site.sh): ops script · Helper script for updating the live site. · `redeploy-site.sh`

### Quality & CI

Tests and automated workflow checks.

- [App tests](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/tests/test_app.py): pytest · Route and response behavior tests. · `tests/test_app.py`
- [Data tests](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/tests/test_db.py): pytest · Persistence or data-layer tests. · `tests/test_db.py`
- [CI test](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/.github/workflows/test.yml): github actions · Automated test workflow. · `.github/workflows/test.yml`
- [CI deploy](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/.github/workflows/deploy.yml): github actions · Automated deployment workflow. · `.github/workflows/deploy.yml`
- [Smoke test](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/run_test.sh): script · Local validation script for the app. · `run_test.sh`
- [HTTP check](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/app/curl-test.sh): script · Curl-based external request validation. · `app/curl-test.sh`

### Project Docs

Repository guidance and dependency definitions.

- [Dependencies](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/requirements.txt): python deps · Pinned Python/Flask dependencies. · `requirements.txt`
- [README](https://github.com/ahmedkhaleel2004/mlh-portfolio/blob/main/README.md): guide · Repository usage and architecture notes. · `README.md`

## Connections

- Flask app → Home page: renders · Main landing page output.
- Flask app → Timeline: renders · Timeline page output.
- Flask app → Work: renders · Work experience page output.
- Flask app → Education: renders · Education page output.
- Flask app → Hobbies: renders · Hobbies page output.
- Flask app → Map: renders · Map page output.
- Flask app → Main CSS: serves · Shared styling for all pages.
- Flask app → Images: serves · Static images referenced by templates.
- Home page → Main CSS: uses · Page styling boundary.
- Timeline → Main CSS: uses · Page styling boundary.
- Work → Main CSS: uses · Page styling boundary.
- Education → Main CSS: uses · Page styling boundary.
- Hobbies → Main CSS: uses · Page styling boundary.
- Map → Main CSS: uses · Page styling boundary.
- Work → Images: uses · Template media references.
- Education → Images: uses · Template media references.
- Hobbies → Images: uses · Template media references.
- Dependencies → Flask app: depends on · Flask runtime and Python packages.
- README → Flask app: describes · Explains the application structure.
- README → Work: describes · Notes repeated portfolio entries rendered by Jinja.
- App tests → Flask app: verifies · Checks route and response behavior.
- Data tests → Flask app: verifies · Covers data-layer behavior around the app.
- CI test → App tests: runs · CI test workflow.
- CI test → Data tests: runs · CI test workflow.
- CI deploy → Dockerfile: packages · Deployment builds and ships the app container.
- Dockerfile → Flask app: contains · Containerized Flask runtime.
- Compose dev → Dockerfile: builds · Local development execution path.
- Compose prod → Dockerfile: builds · Production execution path.
- Web config → Compose prod: routes to · Reverse-proxy boundary for production hosting.
- Redeploy → CI deploy: supports · Operational helper for pushing updates.
- Smoke test → App tests: smokes · Local validation helper.
- HTTP check → Flask app: hits · External HTTP smoke test.
