# ankitdimri4/portfolio architecture

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

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

## Overview

This is a public full-stack personal portfolio: visitors browse the engineer’s profile, work, skills, certificates and contact options, with live GitHub and LeetCode statistics and a contact form. The React app assembles the page; its About and Contact sections use the API client, while the backend handles contact persistence and email notification. The README also describes private features absent from this public tree, so they are not mapped. Some API routing and client transport details are unsampled; those links are omitted or marked unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/ankitdimri4/portfolio/blob/main/client/src/App.jsx) (Portfolio app), [`backend/controllers/portfolioController.js`](https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/portfolioController.js) (Portfolio controller), [`client/src/sections/About/About.jsx`](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/About/About.jsx) (About and stats), [`client/src/sections/Contact/Contact.jsx`](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Contact/Contact.jsx) (Contact form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Portfolio experience"]
  node_app["Portfolio app<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[Nav.jsx]"]
  node_hero["Hero<br/>[Hero.jsx]"]
  node_about["About and stats<br/>[About.jsx]"]
  node_work["Selected work<br/>[Work.jsx]"]
  node_journey["Career journey<br/>[Journey.jsx]"]
  node_stack["Technology stack<br/>[Stack.jsx]"]
  node_certificates["Certificates<br/>[Certificates.jsx]"]
  node_contact["Contact form<br/>[Contact.jsx]"]
  node_footer["Footer and map<br/>[Footer.jsx]"]
  node_activity["Site activity<br/>[SiteActivity.jsx]"]
end

subgraph group_data["Profile content"]
  node_profile["Profile data<br/>[profile.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_backend_app["API application<br/>[app.js]"]
  node_github["GitHub stats"]
  node_leetcode["LeetCode stats"]
  node_portfolio_controller["Portfolio controller"]
  node_contact_validation["Contact validation<br/>[contact.js]"]
end

subgraph group_infra["Persistence and email"]
  node_database_pool["PostgreSQL pool<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
  node_mailer["Email sender<br/>[mailer.js]"]
  node_email_service["Email service"]
end

node_visitor(("Site visitor"))
node_github_service["GitHub"]
node_leetcode_service["LeetCode"]

node_visitor -->|"visits"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_about
node_app -->|"renders"| node_work
node_app -->|"renders"| node_journey
node_app -->|"renders"| node_stack
node_app -->|"renders"| node_certificates
node_app -->|"renders"| node_contact
node_app -->|"renders"| node_footer
node_about -->|"requests stats"| node_api_client
node_about -->|"reads profile"| node_profile
node_contact -->|"posts message"| node_api_client
node_contact -->|"reads contact details"| node_profile
node_activity -->|"fetches activity"| node_github_service
node_backend_app -.->|"routes requests"| node_portfolio_controller
node_api_client -.->|"calls API"| node_backend_app
node_github -->|"fetches stats"| node_github_service
node_leetcode -->|"fetches stats"| node_leetcode_service
node_portfolio_controller -->|"validates message"| node_contact_validation
node_portfolio_controller -->|"saves contact"| node_database_pool
node_portfolio_controller -->|"sends notice"| node_mailer
node_database_pool -->|"queries"| node_postgres
node_mailer -.->|"sends email"| node_email_service

click node_app "https://github.com/ankitdimri4/portfolio/blob/main/client/src/App.jsx"
click node_navigation "https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/Nav/Nav.jsx"
click node_hero "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Hero/Hero.jsx"
click node_about "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/About/About.jsx"
click node_work "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Work/Work.jsx"
click node_journey "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Journey/Journey.jsx"
click node_stack "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Stack/Stack.jsx"
click node_certificates "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Certificates/Certificates.jsx"
click node_contact "https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Contact/Contact.jsx"
click node_footer "https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/Footer/Footer.jsx"
click node_activity "https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/SiteActivity/SiteActivity.jsx"
click node_profile "https://github.com/ankitdimri4/portfolio/blob/main/client/src/data/profile.js"
click node_api_client "https://github.com/ankitdimri4/portfolio/blob/main/client/src/lib/api.js"
click node_backend_app "https://github.com/ankitdimri4/portfolio/blob/main/backend/app.js"
click node_github "https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/githubController.js"
click node_leetcode "https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/leetcodeController.js"
click node_portfolio_controller "https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/portfolioController.js"
click node_contact_validation "https://github.com/ankitdimri4/portfolio/blob/main/backend/lib/contact.js"
click node_database_pool "https://github.com/ankitdimri4/portfolio/blob/main/backend/config/db.js"
click node_mailer "https://github.com/ankitdimri4/portfolio/blob/main/backend/lib/mailer.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_navigation,node_hero,node_about,node_work,node_journey,node_stack,node_certificates,node_contact,node_footer,node_activity toneBlue
class node_profile,node_api_client toneAmber
class node_backend_app,node_github,node_leetcode,node_portfolio_controller,node_contact_validation toneMint
class node_database_pool,node_postgres,node_mailer,node_email_service toneRose
class node_visitor,node_github_service,node_leetcode_service toneIndigo
```

## Components

### Portfolio experience

- [Portfolio app](https://github.com/ankitdimri4/portfolio/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Navigation](https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/Nav/Nav.jsx): `client/src/components/Nav/Nav.jsx`
- [Hero](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Hero/Hero.jsx): `client/src/sections/Hero/Hero.jsx`
- [About and stats](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/About/About.jsx): `client/src/sections/About/About.jsx`
- [Selected work](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Work/Work.jsx): `client/src/sections/Work/Work.jsx`
- [Career journey](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Journey/Journey.jsx): `client/src/sections/Journey/Journey.jsx`
- [Technology stack](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Stack/Stack.jsx): `client/src/sections/Stack/Stack.jsx`
- [Certificates](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Certificates/Certificates.jsx): `client/src/sections/Certificates/Certificates.jsx`
- [Contact form](https://github.com/ankitdimri4/portfolio/blob/main/client/src/sections/Contact/Contact.jsx): `client/src/sections/Contact/Contact.jsx`
- [Footer and map](https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/Footer/Footer.jsx): `client/src/components/Footer/Footer.jsx`
- [Site activity](https://github.com/ankitdimri4/portfolio/blob/main/client/src/components/SiteActivity/SiteActivity.jsx): `client/src/components/SiteActivity/SiteActivity.jsx`

### Profile content

- [Profile data](https://github.com/ankitdimri4/portfolio/blob/main/client/src/data/profile.js): `client/src/data/profile.js`
- [API client](https://github.com/ankitdimri4/portfolio/blob/main/client/src/lib/api.js): `client/src/lib/api.js`

### Backend API

- [API application](https://github.com/ankitdimri4/portfolio/blob/main/backend/app.js): `backend/app.js`
- [GitHub stats](https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/githubController.js): `backend/controllers/githubController.js`
- [LeetCode stats](https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/leetcodeController.js): `backend/controllers/leetcodeController.js`
- [Portfolio controller](https://github.com/ankitdimri4/portfolio/blob/main/backend/controllers/portfolioController.js): `backend/controllers/portfolioController.js`
- [Contact validation](https://github.com/ankitdimri4/portfolio/blob/main/backend/lib/contact.js): `backend/lib/contact.js`

### Persistence and email

- [PostgreSQL pool](https://github.com/ankitdimri4/portfolio/blob/main/backend/config/db.js): `backend/config/db.js`
- **PostgreSQL**
- [Email sender](https://github.com/ankitdimri4/portfolio/blob/main/backend/lib/mailer.js): `backend/lib/mailer.js`
- **Email service**

### Other components

- **Site visitor**
- **GitHub**
- **LeetCode**

## Connections

- Site visitor → Portfolio app: visits
- Portfolio app → Navigation: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Hero: renders (evidence: `client/src/App.jsx`)
- Portfolio app → About and stats: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Selected work: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Career journey: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Technology stack: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Certificates: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Contact form: renders (evidence: `client/src/App.jsx`)
- Portfolio app → Footer and map: renders (evidence: `client/src/App.jsx`)
- About and stats → API client: requests stats (evidence: `client/src/sections/About/About.jsx`)
- About and stats → Profile data: reads profile (evidence: `client/src/sections/About/About.jsx`)
- Contact form → API client: posts message (evidence: `client/src/sections/Contact/Contact.jsx`)
- Contact form → Profile data: reads contact details (evidence: `client/src/sections/Contact/Contact.jsx`)
- Site activity → GitHub: fetches activity (evidence: `client/src/components/SiteActivity/SiteActivity.jsx`)
- API application → Portfolio controller: routes requests
- API client → API application: calls API
- GitHub stats → GitHub: fetches stats (evidence: `README.md`)
- LeetCode stats → LeetCode: fetches stats (evidence: `README.md`)
- Portfolio controller → Contact validation: validates message (evidence: `backend/controllers/portfolioController.js`)
- Portfolio controller → PostgreSQL pool: saves contact (evidence: `backend/controllers/portfolioController.js`)
- Portfolio controller → Email sender: sends notice (evidence: `backend/controllers/portfolioController.js`)
- PostgreSQL pool → PostgreSQL: queries (evidence: `backend/config/db.js`)
- Email sender → Email service: sends email
