How ahmedkhaleel2004/mlh-portfolio works
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: __init__.py Flask app · main.css Main CSS · work_experiences.html Work · Dockerfile Dockerfile
Components 22
Application
Flask runtime, page handlers, templates, and assets.
- Flask app · Application entrypoint that wires routes and rendering.
app/__init__.py - Home page · Main landing page template.
app/templates/index.html - Timeline · Chronological portfolio page template.
app/templates/timeline.html - Work · Work experience section template.
app/templates/work_experiences.html - Education · Education section template.
app/templates/education.html - Hobbies · Hobbies section template.
app/templates/hobbies.html - Map · Location or map page template.
app/templates/map.html - Main CSS · Global styling for the rendered pages.
app/static/styles/main.css - Images · Static image/media assets used by templates.
app/static/img
Operations
Containerization, web-server config, and deployment helpers.
- Dockerfile · Container image definition for the app.
Dockerfile - Compose dev · Local development container setup.
docker-compose.yml - Compose prod · Production container setup.
docker-compose.prod.yml - Web config · Server-side routing and hosting configuration.
user_conf.d/myportfolio.conf - Redeploy · Helper script for updating the live site.
redeploy-site.sh
Quality & CI
Tests and automated workflow checks.
- App tests · Route and response behavior tests.
tests/test_app.py - Data tests · Persistence or data-layer tests.
tests/test_db.py - CI test · Automated test workflow.
.github/workflows/test.yml - CI deploy · Automated deployment workflow.
.github/workflows/deploy.yml - Smoke test · Local validation script for the app.
run_test.sh - HTTP check · Curl-based external request validation.
app/curl-test.sh
Project Docs
Repository guidance and dependency definitions.
- Dependencies · Pinned Python/Flask dependencies.
requirements.txt - README · Repository usage and architecture notes.
README.md
Connections 32
- 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.