# ronvik4/portfolio architecture

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

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

## Overview

This repository is a personal portfolio site with a contact-form backend. Visitors browse the portfolio and submit a message; the browser-side form handler calls the backend, which validates the submission, records an in-memory notification, sends email, and emits a Socket.IO event. The backend also exposes notification retrieval and read-state endpoints. The main JavaScript excerpt confirms navigation and interactive UI behavior, but its omitted form and admin-view sections limit detail about their wiring. Additional portfolio sections are documented in the README.

Main entry points: [`server.js`](https://github.com/ronvik4/portfolio/blob/main/server.js) (HTTP API), [`index.html`](https://github.com/ronvik4/portfolio/blob/main/index.html) (Portfolio content), [`css/style.css`](https://github.com/ronvik4/portfolio/blob/main/css/style.css) (Responsive styling), [`js/main.js`](https://github.com/ronvik4/portfolio/blob/main/js/main.js) (Page interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio Site"]
  node_page["Portfolio content<br/>[index.html]"]
  node_style["Responsive styling<br/>[style.css]"]
  node_interactions["Page interactions<br/>[main.js]"]
  node_contact["Contact form<br/>[index.html]"]
end

subgraph group_backend["Contact Backend"]
  node_api["HTTP API<br/>[server.js]"]
  node_validation["Submission validation<br/>[server.js]"]
  node_email["Email delivery<br/>[server.js]"]
end

subgraph group_notify["Notifications"]
  node_notification_store[("Notification memory<br/>[server.js]")]
  node_notification_api["Notification endpoints<br/>[server.js]"]
  node_socket["Live notifications<br/>[server.js]"]
end

node_visitor(("Visitor"))
node_mail_service(("Gmail service"))
node_admin(("Admin client"))

node_visitor -->|"views"| node_page
node_page -->|"styled by"| node_style
node_page -.->|"loads interactions"| node_interactions
node_visitor -->|"submits message"| node_contact
node_contact -.->|"posts submission"| node_api
node_api -->|"validates"| node_validation
node_api -->|"records notification"| node_notification_store
node_api -->|"sends email"| node_email
node_email -->|"delivers through"| node_mail_service
node_api -->|"emits event"| node_socket
node_notification_api -->|"reads and updates"| node_notification_store
node_admin -.->|"requests notifications"| node_notification_api
node_socket -.->|"pushes updates"| node_admin
node_socket -->|"sends current items"| node_notification_store

click node_page "https://github.com/ronvik4/portfolio/blob/main/index.html"
click node_style "https://github.com/ronvik4/portfolio/blob/main/css/style.css"
click node_interactions "https://github.com/ronvik4/portfolio/blob/main/js/main.js"
click node_contact "https://github.com/ronvik4/portfolio/blob/main/index.html"
click node_api "https://github.com/ronvik4/portfolio/blob/main/server.js"
click node_validation "https://github.com/ronvik4/portfolio/blob/main/server.js"
click node_email "https://github.com/ronvik4/portfolio/blob/main/server.js"
click node_notification_store "https://github.com/ronvik4/portfolio/blob/main/server.js"
click node_notification_api "https://github.com/ronvik4/portfolio/blob/main/server.js"
click node_socket "https://github.com/ronvik4/portfolio/blob/main/server.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_page,node_style,node_interactions,node_contact,node_admin toneBlue
class node_api,node_validation,node_email toneAmber
class node_notification_store,node_notification_api,node_socket toneMint
class node_visitor,node_mail_service toneIndigo
```

## Components

### Portfolio Site

- [Portfolio content](https://github.com/ronvik4/portfolio/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/ronvik4/portfolio/blob/main/css/style.css): `css/style.css`
- [Page interactions](https://github.com/ronvik4/portfolio/blob/main/js/main.js): `js/main.js`
- [Contact form](https://github.com/ronvik4/portfolio/blob/main/index.html): `index.html`

### Contact Backend

- [HTTP API](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`
- [Submission validation](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`
- [Email delivery](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`

### Notifications

- [Notification memory](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`
- [Notification endpoints](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`
- [Live notifications](https://github.com/ronvik4/portfolio/blob/main/server.js): `server.js`

### Other components

- **Visitor**
- **Gmail service**
- **Admin client**

## Connections

- Visitor → Portfolio content: views (evidence: `README.md`)
- Portfolio content → Responsive styling: styled by (evidence: `README.md`)
- Portfolio content → Page interactions: loads interactions
- Visitor → Contact form: submits message (evidence: `README.md`)
- Contact form → HTTP API: posts submission
- HTTP API → Submission validation: validates (evidence: `server.js`)
- HTTP API → Notification memory: records notification (evidence: `server.js`)
- HTTP API → Email delivery: sends email (evidence: `server.js`)
- Email delivery → Gmail service: delivers through (evidence: `server.js`)
- HTTP API → Live notifications: emits event (evidence: `server.js`)
- Notification endpoints → Notification memory: reads and updates (evidence: `server.js`)
- Admin client → Notification endpoints: requests notifications (evidence: `README.md`)
- Live notifications → Admin client: pushes updates (evidence: `README.md`)
- Live notifications → Notification memory: sends current items (evidence: `server.js`)
