# samirshaikh2425/my-portfolio-project architecture

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

- Interactive diagram: https://gitdiagram.com/samirshaikh2425/my-portfolio-project
- Repository: https://github.com/samirshaikh2425/my-portfolio-project

## Overview

This Flask portfolio serves a public page, accepts and stores contact submissions, and provides an authenticated admin workflow for reviewing and clearing sessions. The sampled app.py shows the route logic, validation, database queries, and template rendering. The README describes MySQL and frontend styling; template and stylesheet contents were not sampled, so their internal behavior and asset wiring are not inferred.

Main entry points: [`app.py`](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py) (Admin login), [`templates/index.html`](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/index.html) (Portfolio page), [`static/style.css`](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/static/style.css) (Page styling), [`templates/admin_login.html`](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/admin_login.html) (Admin templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public portfolio"]
  node_home["Portfolio page<br/>[index.html]"]
  node_stylesheet["Page styling<br/>[style.css]"]
end

subgraph group_contact["Contact handling"]
  node_contact_route["Contact submission<br/>[app.py]"]
  node_db_helper["MySQL connection<br/>[app.py]"]
  node_messages_db[("Contact messages")]
end

subgraph group_admin["Admin management"]
  node_admin_login["Admin login<br/>[app.py]"]
  node_session_guard["Session guard<br/>[app.py]"]
  node_dashboard["Message dashboard<br/>[app.py]"]
  node_admin_template["Admin templates<br/>[admin_login.html]"]
  node_dashboard_template["Dashboard template"]
  node_logout["Admin logout<br/>[app.py]"]
end

node_visitor(("Visitor"))
node_admin_user(("Admin user"))

node_visitor -->|"requests page"| node_home
node_visitor -->|"submits form"| node_contact_route
node_contact_route -->|"opens connection"| node_db_helper
node_db_helper -->|"connects to"| node_messages_db
node_contact_route -->|"inserts message"| node_messages_db
node_admin_user -->|"requests login"| node_admin_login
node_admin_login -->|"renders login"| node_admin_template
node_admin_login -->|"sets session"| node_session_guard
node_admin_login -->|"redirects to"| node_dashboard
node_session_guard -->|"guards access"| node_dashboard
node_dashboard -->|"opens connection"| node_db_helper
node_dashboard -->|"reads messages"| node_messages_db
node_dashboard -->|"renders messages"| node_dashboard_template
node_session_guard -->|"guards access"| node_logout
node_logout -->|"redirects to"| node_admin_login
node_home -->|"styled by"| node_stylesheet

click node_home "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/index.html"
click node_contact_route "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_db_helper "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_admin_login "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_session_guard "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_dashboard "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_admin_template "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/admin_login.html"
click node_dashboard_template "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/admin_dashboard.html"
click node_logout "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py"
click node_stylesheet "https://github.com/samirshaikh2425/my-portfolio-project/blob/main/static/style.css"

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_home,node_stylesheet,node_admin_user toneBlue
class node_contact_route,node_db_helper,node_messages_db toneAmber
class node_admin_login,node_session_guard,node_dashboard,node_admin_template,node_dashboard_template,node_logout toneMint
class node_visitor toneIndigo
```

## Components

### Public portfolio

- [Portfolio page](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/index.html): `templates/index.html`
- [Page styling](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/static/style.css): `static/style.css`

### Contact handling

- [Contact submission](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`
- [MySQL connection](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`
- **Contact messages**

### Admin management

- [Admin login](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`
- [Session guard](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`
- [Message dashboard](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`
- [Admin templates](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/admin_login.html): `templates/admin_login.html`
- [Dashboard template](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/templates/admin_dashboard.html): `templates/admin_dashboard.html`
- [Admin logout](https://github.com/samirshaikh2425/my-portfolio-project/blob/main/app.py): `app.py`

### Other components

- **Visitor**
- **Admin user**

## Connections

- Visitor → Portfolio page: requests page
- Visitor → Contact submission: submits form (evidence: `app.py`)
- Contact submission → MySQL connection: opens connection (evidence: `app.py`)
- MySQL connection → Contact messages: connects to (evidence: `app.py`)
- Contact submission → Contact messages: inserts message (evidence: `app.py`)
- Admin user → Admin login: requests login (evidence: `app.py`)
- Admin login → Admin templates: renders login (evidence: `app.py`)
- Admin login → Session guard: sets session (evidence: `app.py`)
- Admin login → Message dashboard: redirects to (evidence: `app.py`)
- Session guard → Message dashboard: guards access (evidence: `app.py`)
- Message dashboard → MySQL connection: opens connection (evidence: `app.py`)
- Message dashboard → Contact messages: reads messages (evidence: `app.py`)
- Message dashboard → Dashboard template: renders messages (evidence: `app.py`)
- Session guard → Admin logout: guards access (evidence: `app.py`)
- Admin logout → Admin login: redirects to (evidence: `app.py`)
- Portfolio page → Page styling: styled by (evidence: `README.md`)
