# dev-aryansingh/portfolio-website architecture

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

- Interactive diagram: https://gitdiagram.com/dev-aryansingh/portfolio-website
- Repository: https://github.com/dev-aryansingh/portfolio-website

## Overview

1. **Repository shape**
   - This is a small full-stack portfolio site with a single-page frontend and a lightweight Node.js/Express backend.
   - The repo is intentionally flat: `index.html`, `styles.css`, and `script.js` for the client; `server.js` for the server; `package.json`/`package-lock.json` for Node dependencies.

2. **Frontend presentation layer**
   - `index.html` is the main document and likely contains the entire portfolio UI: hero/about/project/contact sections, navigation, and the contact form.
   - `styles.css` provides the visual design, including the responsive layout and the “cyber-themed” look described in the README.

3. **Client-side behavior**
   - `script.js` handles interactivity in the browser.
   - Based on the README, this includes smooth scrolling, project card interactions, and real-time form validation before submission.

4. **Contact form as the key integration boundary**
   - The most important data flow is the contact form.
   - Browser input is validated on the client, then sent to the backend API, which forwards the message for email delivery.

5. **Backend service**
   - `server.js` is the only backend source file, so the server is likely a compact Express app rather than a multi-module API.
   - Its main role is to accept contact form submissions and coordinate email sending.

6. **Email delivery subsystem**
   - The README explicitly says the site uses Node.js + Nodemailer.
   - That makes email sending the primary server-side external integration, with Gmail/App Password authentication mentioned as the delivery method.

7. **Security and configuration boundary**
   - Sensitive credentials are expected to live in environment variables, not in source control.
   - `.gitignore` is part of that boundary, protecting `.env` and other local-only artifacts from being committed.

8. **Static asset delivery**
   - The site appears to be mostly static content with dynamic contact handling.
   - The server may also serve the frontend files and any local assets referenced by the page, keeping deployment simple.

9. **Technology stack roles**
   - HTML/CSS/vanilla JavaScript handle all user-facing presentation and interaction.
   - Node.js + Express handle HTTP requests and backend routing.
   - Nodemailer bridges the backend to the external email provider.

10. **Runtime and deployment model**
   - This is a Node-based app, so the server runs in a Node runtime rather than a browser-only or framework-heavy environment.
   - The architecture is minimal: one server process, one browser client, and one external email service.

11. **Important architecture boundary for a diagram**
   - The clearest boundary is: **User Browser → Static Portfolio UI → Contact Form API → Nodemailer → Email Provider**.
   - Everything else is supporting structure around that flow.

12. **What is not present**
   - There is no evidence of a database, authentication system, CMS, or multi-service backend.
   - The architecture is therefore simple and state-light, with no persistent application data layer in the repo.

Main entry points: [`server.js`](https://github.com/dev-aryansingh/portfolio-website/blob/main/server.js) (Express App), [`README.md`](https://github.com/dev-aryansingh/portfolio-website/blob/main/README.md) (README), [`index.html`](https://github.com/dev-aryansingh/portfolio-website/blob/main/index.html) (Portfolio UI), [`script.js`](https://github.com/dev-aryansingh/portfolio-website/blob/main/script.js) (UI Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_index_html["Portfolio UI<br/>html shell<br/>[index.html]"]
  node_styles_css["Visual Design<br/>css theme<br/>[styles.css]"]
  node_script_js["UI Logic<br/>client script<br/>[script.js]"]
end

subgraph group_server["Server"]
  node_server_js["Express App<br/>backend entry<br/>[server.js]"]
  node_contact_api["Contact API<br/>route"]
  node_mailer["Nodemailer<br/>email bridge"]
end

subgraph group_support["Support"]
  node_package_json["Node Config<br/>npm manifest<br/>[package.json]"]
  node_package_lock["Lockfile<br/>[package-lock.json]"]
  node_gitignore["Ignore Rules<br/>repo config<br/>[.gitignore]"]
  node_readme["README<br/>project docs<br/>[README.md]"]
end

node_browser(("Browser<br/>runtime"))
node_email_provider[("Email Service<br/>external smtp")]

node_browser -->|"loads"| node_index_html
node_browser -->|"applies"| node_styles_css
node_browser -->|"runs"| node_script_js
node_index_html -->|"uses"| node_script_js
node_script_js -->|"submits"| node_contact_api
node_contact_api -->|"implements"| node_server_js
node_server_js -->|"calls"| node_mailer
node_mailer -->|"delivers"| node_email_provider
node_server_js -->|"depends on"| node_package_json
node_package_json -->|"pins"| node_package_lock
node_gitignore -.->|"protects"| node_server_js
node_readme -.->|"describes"| node_index_html
node_readme -.->|"describes"| node_server_js
node_readme -.->|"describes"| node_mailer

click node_index_html "https://github.com/dev-aryansingh/portfolio-website/blob/main/index.html"
click node_styles_css "https://github.com/dev-aryansingh/portfolio-website/blob/main/styles.css"
click node_script_js "https://github.com/dev-aryansingh/portfolio-website/blob/main/script.js"
click node_server_js "https://github.com/dev-aryansingh/portfolio-website/blob/main/server.js"
click node_package_json "https://github.com/dev-aryansingh/portfolio-website/blob/main/package.json"
click node_package_lock "https://github.com/dev-aryansingh/portfolio-website/blob/main/package-lock.json"
click node_gitignore "https://github.com/dev-aryansingh/portfolio-website/blob/main/.gitignore"
click node_readme "https://github.com/dev-aryansingh/portfolio-website/blob/main/README.md"

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_index_html,node_styles_css,node_script_js toneBlue
class node_server_js,node_contact_api,node_mailer toneAmber
class node_package_json,node_package_lock,node_gitignore,node_readme toneMint
class node_browser,node_email_provider toneNeutral
```

## Components

### Client

Browser-side portfolio UI and interactions

- [Portfolio UI](https://github.com/dev-aryansingh/portfolio-website/blob/main/index.html): html shell · Main single-page document with portfolio sections and contact form · `index.html`
- [Visual Design](https://github.com/dev-aryansingh/portfolio-website/blob/main/styles.css): css theme · Responsive styling and cyber-themed presentation · `styles.css`
- [UI Logic](https://github.com/dev-aryansingh/portfolio-website/blob/main/script.js): client script · Smooth scrolling, card interactions, and form validation · `script.js`

### Server

Node.js contact API and email delivery

- [Express App](https://github.com/dev-aryansingh/portfolio-website/blob/main/server.js): backend entry · HTTP server that accepts contact submissions · `server.js`
- **Contact API**: route · Backend boundary for form submission and validation handling
- **Nodemailer**: email bridge · Sends messages through the configured mail provider

### Support

Project metadata and local configuration

- [Node Config](https://github.com/dev-aryansingh/portfolio-website/blob/main/package.json): npm manifest · Declares runtime scripts and dependencies · `package.json`
- [Lockfile](https://github.com/dev-aryansingh/portfolio-website/blob/main/package-lock.json): npm lockfile · Pins dependency versions for Node installs · `package-lock.json`
- [Ignore Rules](https://github.com/dev-aryansingh/portfolio-website/blob/main/.gitignore): repo config · Excludes local-only files such as environment secrets · `.gitignore`
- [README](https://github.com/dev-aryansingh/portfolio-website/blob/main/README.md): project docs · Describes the stack, setup, and contact flow · `README.md`

### Other components

- **Browser**: runtime · End user viewing and using the portfolio
- **Email Service**: external smtp · External mailbox delivery target such as Gmail SMTP

## Connections

- Browser → Portfolio UI: loads · User opens the portfolio page
- Browser → Visual Design: applies · Browser renders the site styling
- Browser → UI Logic: runs · Browser executes client-side interaction logic
- Portfolio UI → UI Logic: uses · The page wires up client behavior
- UI Logic → Contact API: submits · Validated form data is sent to the backend
- Contact API → Express App: implements · The Express server hosts the contact handling logic
- Express App → Nodemailer: calls · Server delegates message delivery to Nodemailer
- Nodemailer → Email Service: delivers · Outbound email is sent through the external provider
- Express App → Node Config: depends on · Runtime dependencies and scripts are declared in npm metadata
- Node Config → Lockfile: pins · Lockfile captures resolved dependency versions
- Ignore Rules → Express App: protects · Local secrets and environment files stay out of source control
- README → Portfolio UI: describes · Documentation explains the portfolio frontend structure
- README → Express App: describes · Documentation explains the Node/Express backend
- README → Nodemailer: describes · Documentation explains the Nodemailer email flow
