# hazem897/potfolio architecture

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

- Interactive diagram: https://gitdiagram.com/hazem897/potfolio
- Repository: https://github.com/hazem897/potfolio

## Overview

This is a multilingual React portfolio and CV for presenting professional experience, skills, certifications, education, and BI projects. Visitors browse the portfolio and project videos, contact the owner, and generate session analytics; the owner can use an admin dashboard to review and export analytics. The graph follows the documented app composition and indexed module references. Some backend and dashboard request details were not excerpted, so those connections are omitted or marked unverified.

Main entry points: [`src/App.jsx`](https://github.com/hazem897/potfolio/blob/main/src/App.jsx) (App composition), [`src/components/AdminDashboard.jsx`](https://github.com/hazem897/potfolio/blob/main/src/components/AdminDashboard.jsx) (Admin dashboard), [`api/track.js`](https://github.com/hazem897/potfolio/blob/main/api/track.js) (Tracking endpoint), [`api/admin/export.js`](https://github.com/hazem897/potfolio/blob/main/api/admin/export.js) (Analytics export endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio experience"]
  node_app["App composition<br/>[App.jsx]"]
  node_language["Language context"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_hero["Introduction<br/>[Hero.jsx]"]
  node_about["About section<br/>[About.jsx]"]
  node_experience["Experience section<br/>[Experience.jsx]"]
  node_projects["Project gallery<br/>[Projects.jsx]"]
  node_projectmodal["Project details modal<br/>[ProjectModal.jsx]"]
  node_videoplayer["Video player"]
  node_skills["Skills section<br/>[Skills.jsx]"]
  node_certifications["Certifications section<br/>[Certifications.jsx]"]
  node_education["Education section<br/>[Education.jsx]"]
  node_contact["Contact form<br/>[Contact.jsx]"]
end

subgraph group_content["Portfolio content"]
  node_projectdata["Project details<br/>[projects.jsx]"]
end

subgraph group_analytics["Visitor analytics"]
  node_tracker["Visitor tracking hook"]
  node_trackapi["Tracking endpoint<br/>[track.js]"]
  node_botdetect["Bot detection<br/>[botDetector.js]"]
  node_supabaseclient["Supabase client<br/>[supabase.js]"]
  node_supabase[("Visits database")]
  node_mailer["Visit notifications<br/>[mailer.js]"]
end

subgraph group_admin["Admin analytics"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_loginapi["Admin login endpoint<br/>[login.js]"]
  node_statsapi["Analytics stats endpoint<br/>[stats.js]"]
  node_exportapi["Analytics export endpoint<br/>[export.js]"]
  node_auth["Admin authentication<br/>[auth.js]"]
end

node_visitor(("Portfolio visitor"))
node_owner(("Portfolio owner"))
node_emailservice["Email services"]

node_visitor -->|"opens"| node_app
node_app -->|"provides context"| node_language
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_about
node_app -->|"renders"| node_experience
node_app -->|"renders"| node_projects
node_app -->|"renders"| node_skills
node_app -->|"renders"| node_certifications
node_app -->|"renders"| node_education
node_app -->|"renders"| node_contact
node_app -->|"renders"| node_projectmodal
node_app -->|"activates"| node_tracker
node_projects -->|"reads"| node_projectdata
node_projectmodal -->|"renders"| node_videoplayer
node_language -.-> node_projectdata
node_tracker -->|"sends tracking data"| node_trackapi
node_trackapi -->|"checks bots"| node_botdetect
node_trackapi -->|"records sessions"| node_supabaseclient
node_supabaseclient -->|"reads and writes"| node_supabase
node_trackapi -->|"dispatches notices"| node_mailer
node_mailer -->|"sends notifications"| node_emailservice
node_app -->|"renders"| node_adminui
node_owner -.->|"opens dashboard"| node_adminui
node_adminui -.->|"requests login"| node_loginapi
node_adminui -.->|"requests statistics"| node_statsapi
node_adminui -.->|"requests export"| node_exportapi
node_loginapi -->|"validates credentials"| node_auth
node_statsapi -->|"checks access"| node_auth
node_statsapi -->|"fetches visits"| node_supabaseclient
node_exportapi -->|"checks access"| node_auth
node_exportapi -->|"fetches visits"| node_supabaseclient
node_exportapi -->|"uses notifications"| node_mailer

click node_app "https://github.com/hazem897/potfolio/blob/main/src/App.jsx"
click node_language "https://github.com/hazem897/potfolio/blob/main/src/context/LanguageContext.jsx"
click node_navbar "https://github.com/hazem897/potfolio/blob/main/src/components/Navbar.jsx"
click node_hero "https://github.com/hazem897/potfolio/blob/main/src/components/Hero.jsx"
click node_about "https://github.com/hazem897/potfolio/blob/main/src/components/About.jsx"
click node_experience "https://github.com/hazem897/potfolio/blob/main/src/components/Experience.jsx"
click node_projects "https://github.com/hazem897/potfolio/blob/main/src/components/Projects.jsx"
click node_projectdata "https://github.com/hazem897/potfolio/blob/main/src/data/projects.jsx"
click node_projectmodal "https://github.com/hazem897/potfolio/blob/main/src/components/ProjectModal.jsx"
click node_videoplayer "https://github.com/hazem897/potfolio/blob/main/src/components/CustomVideoPlayer.jsx"
click node_skills "https://github.com/hazem897/potfolio/blob/main/src/components/Skills.jsx"
click node_certifications "https://github.com/hazem897/potfolio/blob/main/src/components/Certifications.jsx"
click node_education "https://github.com/hazem897/potfolio/blob/main/src/components/Education.jsx"
click node_contact "https://github.com/hazem897/potfolio/blob/main/src/components/Contact.jsx"
click node_tracker "https://github.com/hazem897/potfolio/blob/main/src/hooks/useVisitorTracker.js"
click node_trackapi "https://github.com/hazem897/potfolio/blob/main/api/track.js"
click node_botdetect "https://github.com/hazem897/potfolio/blob/main/api/_lib/botDetector.js"
click node_supabaseclient "https://github.com/hazem897/potfolio/blob/main/api/_lib/supabase.js"
click node_mailer "https://github.com/hazem897/potfolio/blob/main/api/_lib/mailer.js"
click node_adminui "https://github.com/hazem897/potfolio/blob/main/src/components/AdminDashboard.jsx"
click node_loginapi "https://github.com/hazem897/potfolio/blob/main/api/admin/login.js"
click node_statsapi "https://github.com/hazem897/potfolio/blob/main/api/admin/stats.js"
click node_exportapi "https://github.com/hazem897/potfolio/blob/main/api/admin/export.js"
click node_auth "https://github.com/hazem897/potfolio/blob/main/api/_lib/auth.js"

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_app,node_language,node_navbar,node_hero,node_about,node_experience,node_projects,node_projectmodal,node_videoplayer,node_skills,node_certifications,node_education,node_contact toneBlue
class node_projectdata toneAmber
class node_tracker,node_trackapi,node_botdetect,node_supabaseclient,node_supabase,node_mailer toneMint
class node_adminui,node_loginapi,node_statsapi,node_exportapi,node_auth toneRose
class node_visitor,node_owner,node_emailservice toneIndigo
```

## Components

### Portfolio experience

- [App composition](https://github.com/hazem897/potfolio/blob/main/src/App.jsx): `src/App.jsx`
- [Language context](https://github.com/hazem897/potfolio/blob/main/src/context/LanguageContext.jsx): `src/context/LanguageContext.jsx`
- [Navigation](https://github.com/hazem897/potfolio/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Introduction](https://github.com/hazem897/potfolio/blob/main/src/components/Hero.jsx): `src/components/Hero.jsx`
- [About section](https://github.com/hazem897/potfolio/blob/main/src/components/About.jsx): `src/components/About.jsx`
- [Experience section](https://github.com/hazem897/potfolio/blob/main/src/components/Experience.jsx): `src/components/Experience.jsx`
- [Project gallery](https://github.com/hazem897/potfolio/blob/main/src/components/Projects.jsx): `src/components/Projects.jsx`
- [Project details modal](https://github.com/hazem897/potfolio/blob/main/src/components/ProjectModal.jsx): `src/components/ProjectModal.jsx`
- [Video player](https://github.com/hazem897/potfolio/blob/main/src/components/CustomVideoPlayer.jsx): `src/components/CustomVideoPlayer.jsx`
- [Skills section](https://github.com/hazem897/potfolio/blob/main/src/components/Skills.jsx): `src/components/Skills.jsx`
- [Certifications section](https://github.com/hazem897/potfolio/blob/main/src/components/Certifications.jsx): `src/components/Certifications.jsx`
- [Education section](https://github.com/hazem897/potfolio/blob/main/src/components/Education.jsx): `src/components/Education.jsx`
- [Contact form](https://github.com/hazem897/potfolio/blob/main/src/components/Contact.jsx): `src/components/Contact.jsx`

### Portfolio content

- [Project details](https://github.com/hazem897/potfolio/blob/main/src/data/projects.jsx): `src/data/projects.jsx`

### Visitor analytics

- [Visitor tracking hook](https://github.com/hazem897/potfolio/blob/main/src/hooks/useVisitorTracker.js): `src/hooks/useVisitorTracker.js`
- [Tracking endpoint](https://github.com/hazem897/potfolio/blob/main/api/track.js): `api/track.js`
- [Bot detection](https://github.com/hazem897/potfolio/blob/main/api/_lib/botDetector.js): `api/_lib/botDetector.js`
- [Supabase client](https://github.com/hazem897/potfolio/blob/main/api/_lib/supabase.js): `api/_lib/supabase.js`
- **Visits database**
- [Visit notifications](https://github.com/hazem897/potfolio/blob/main/api/_lib/mailer.js): `api/_lib/mailer.js`

### Admin analytics

- [Admin dashboard](https://github.com/hazem897/potfolio/blob/main/src/components/AdminDashboard.jsx): `src/components/AdminDashboard.jsx`
- [Admin login endpoint](https://github.com/hazem897/potfolio/blob/main/api/admin/login.js): `api/admin/login.js`
- [Analytics stats endpoint](https://github.com/hazem897/potfolio/blob/main/api/admin/stats.js): `api/admin/stats.js`
- [Analytics export endpoint](https://github.com/hazem897/potfolio/blob/main/api/admin/export.js): `api/admin/export.js`
- [Admin authentication](https://github.com/hazem897/potfolio/blob/main/api/_lib/auth.js): `api/_lib/auth.js`

### Other components

- **Portfolio visitor**
- **Portfolio owner**
- **Email services**

## Connections

- Portfolio visitor → App composition: opens
- App composition → Language context: provides context (evidence: `src/App.jsx`)
- App composition → Navigation: renders (evidence: `src/App.jsx`)
- App composition → Introduction: renders (evidence: `src/App.jsx`)
- App composition → About section: renders (evidence: `src/App.jsx`)
- App composition → Experience section: renders (evidence: `src/App.jsx`)
- App composition → Project gallery: renders (evidence: `src/App.jsx`)
- App composition → Skills section: renders (evidence: `src/App.jsx`)
- App composition → Certifications section: renders (evidence: `src/App.jsx`)
- App composition → Education section: renders (evidence: `src/App.jsx`)
- App composition → Contact form: renders (evidence: `src/App.jsx`)
- App composition → Project details modal: renders (evidence: `src/App.jsx`)
- App composition → Visitor tracking hook: activates (evidence: `src/App.jsx`)
- Project gallery → Project details: reads (evidence: `src/components/Projects.jsx`)
- Project details modal → Video player: renders (evidence: `src/components/ProjectModal.jsx`)
- Language context → Project details
- Visitor tracking hook → Tracking endpoint: sends tracking data (evidence: `src/hooks/useVisitorTracker.js`)
- Tracking endpoint → Bot detection: checks bots (evidence: `api/track.js`)
- Tracking endpoint → Supabase client: records sessions (evidence: `api/track.js`)
- Supabase client → Visits database: reads and writes (evidence: `api/_lib/supabase.js`)
- Tracking endpoint → Visit notifications: dispatches notices (evidence: `api/track.js`)
- Visit notifications → Email services: sends notifications (evidence: `api/_lib/mailer.js`)
- App composition → Admin dashboard: renders (evidence: `src/App.jsx`)
- Portfolio owner → Admin dashboard: opens dashboard
- Admin dashboard → Admin login endpoint: requests login
- Admin dashboard → Analytics stats endpoint: requests statistics
- Admin dashboard → Analytics export endpoint: requests export
- Admin login endpoint → Admin authentication: validates credentials (evidence: `api/admin/login.js`)
- Analytics stats endpoint → Admin authentication: checks access (evidence: `api/admin/stats.js`)
- Analytics stats endpoint → Supabase client: fetches visits (evidence: `api/admin/stats.js`)
- Analytics export endpoint → Admin authentication: checks access (evidence: `api/admin/export.js`)
- Analytics export endpoint → Supabase client: fetches visits (evidence: `api/admin/export.js`)
- Analytics export endpoint → Visit notifications: uses notifications (evidence: `api/admin/export.js`)
