# yukeshravi/yukeshportfolio architecture

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

- Interactive diagram: https://gitdiagram.com/yukeshravi/yukeshportfolio
- Repository: https://github.com/yukeshravi/yukeshportfolio

## Overview

#### Purpose and Runtime
This is a server-rendered portfolio site built on Node.js, Express, and EJS. The application starts from `server.js`, serves HTML portfolio pages and JSON endpoints, and runs locally on port 3000 per the README. Dependencies and start scripts are defined in `package.json`.

#### HTTP Routing and Page Delivery
`server.js` is the application boundary for Express routing, static asset delivery, view rendering, API responses, and fallback handling. It exposes:
- Portfolio pages: `/`, `/about`, `/projects`, `/projects/:id`, `/contact`
- APIs: `GET /api/projects` and `POST /api/contact`
- A 404 response for unmatched routes

Relevant paths: `server.js`, `views/404.ejs`, `package.json`.

#### Project Content Model
Project records are centralized as application-owned content in `data/projects.js`. Route handlers use this collection to populate the home featured-project area, all-projects listing, individual case-study pages, and the projects JSON API. The dynamic `/projects/:id` route is the key lookup boundary: an invalid project identifier should resolve through the app’s not-found behavior.

Relevant paths: `data/projects.js`, `server.js`, `views/project-detail.ejs`.

#### Server-rendered Presentation Layer
EJS templates define page-specific content while shared layout fragments provide common document shell/navigation and footer/script inclusion. Pages receive route-derived and content-model data from Express rather than fetching it as a required client-side rendering step.

Relevant paths: `views/home.ejs`, `views/projects.ejs`, `views/project-detail.ejs`, `views/partials/head.ejs`, `views/partials/footer.ejs`.

#### Contact Submission Boundary
The contact page presents a form, with browser behavior handled by the shared frontend script and submission received at `POST /api/contact`. The README indicates the email delivery implementation is intended to be customized in `server.js`; no external mail provider is identified. This endpoint is the primary write/input boundary and should own validation, error handling, and any future mail-service integration.

Relevant paths: `views/contact.ejs`, `public/js/main.js`, `server.js`.

#### Static Frontend Assets
Express exposes browser assets from `public/`. Styling is centralized in one stylesheet; client JavaScript implements interaction behavior including cursor, navigation, scroll reveal, and form handling. These assets enhance server-rendered pages and do not replace the Express/EJS rendering flow.

Relevant paths: `public/css/style.css`, `public/js/main.js`, `server.js`.

#### Primary Flow
A browser request reaches Express in `server.js`; static requests are served from `public/`, while page routes read project data as needed and render an EJS template. Shared partials wrap the page content, and the browser loads CSS and JavaScript through the footer/head structure. API consumers can retrieve the same project collection as JSON or submit contact data through the contact endpoint.

Main entry points: [`server.js`](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js) (Express application), [`views/partials/head.ejs`](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/partials/head.ejs) (Shared shell partials), [`public/js/main.js`](https://github.com/yukeshravi/yukeshportfolio/blob/main/public/js/main.js) (Frontend interactions), [`views/home.ejs`](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/home.ejs) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Express server"]
  node_express_app["Express application<br/>Node.js entrypoint<br/>[server.js]"]
  node_package["Package scripts<br/>Node.js manifest<br/>[package.json]"]
  node_project_data[("Project collection<br/>content model<br/>[projects.js]")]
  node_page_routes["Portfolio page routes<br/>route handlers<br/>[server.js]"]
  node_project_api["Projects JSON API<br/>GET endpoint<br/>[server.js]"]
  node_contact_api["Contact submission API<br/>POST endpoint<br/>[server.js]"]
  node_not_found["Not-found handling<br/>404 response<br/>[404.ejs]"]
  node_static_assets["Static asset delivery<br/>Express static middleware<br/>[server.js]"]
end

subgraph group_views["EJS presentation"]
  node_home_view["Home page<br/>EJS page<br/>[home.ejs]"]
  node_projects_view["Projects pages<br/>EJS pages<br/>[projects.ejs]"]
  node_project_detail_view["Project detail page<br/>EJS page<br/>[project-detail.ejs]"]
  node_shared_partials["Shared shell partials<br/>EJS partials<br/>[head.ejs]"]
  node_contact_view["Contact page<br/>EJS page<br/>[contact.ejs]"]
end

subgraph group_browser["Browser assets"]
  node_browser_client(("Browser<br/>client"))
  node_styles["Stylesheet<br/>CSS asset<br/>[style.css]"]
  node_frontend_script["Frontend interactions<br/>browser JavaScript<br/>[main.js]"]
end

node_package -->|"starts"| node_express_app
node_browser_client -->|"HTTP requests"| node_express_app
node_express_app -->|"dispatches pages"| node_page_routes
node_express_app -->|"GET /api/projects"| node_project_api
node_express_app -->|"POST /api/contact"| node_contact_api
node_express_app -->|"serves /public"| node_static_assets
node_express_app -->|"unmatched or invalid"| node_not_found
node_page_routes -->|"reads projects"| node_project_data
node_project_api -->|"serializes"| node_project_data
node_page_routes -->|"renders"| node_home_view
node_page_routes -->|"renders"| node_projects_view
node_page_routes -->|"renders by id"| node_project_detail_view
node_page_routes -->|"renders"| node_contact_view
node_home_view -->|"includes"| node_shared_partials
node_projects_view -->|"includes"| node_shared_partials
node_project_detail_view -->|"includes"| node_shared_partials
node_contact_view -->|"includes"| node_shared_partials
node_shared_partials -->|"loads"| node_styles
node_shared_partials -->|"loads"| node_frontend_script
node_static_assets -->|"delivers"| node_styles
node_static_assets -->|"delivers"| node_frontend_script
node_frontend_script -->|"submits form"| node_contact_api

click node_express_app "https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js"
click node_package "https://github.com/yukeshravi/yukeshportfolio/blob/main/package.json"
click node_project_data "https://github.com/yukeshravi/yukeshportfolio/blob/main/data/projects.js"
click node_page_routes "https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js"
click node_project_api "https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js"
click node_contact_api "https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js"
click node_not_found "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/404.ejs"
click node_home_view "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/home.ejs"
click node_projects_view "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/projects.ejs"
click node_project_detail_view "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/project-detail.ejs"
click node_shared_partials "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/partials/head.ejs"
click node_contact_view "https://github.com/yukeshravi/yukeshportfolio/blob/main/views/contact.ejs"
click node_styles "https://github.com/yukeshravi/yukeshportfolio/blob/main/public/css/style.css"
click node_frontend_script "https://github.com/yukeshravi/yukeshportfolio/blob/main/public/js/main.js"
click node_static_assets "https://github.com/yukeshravi/yukeshportfolio/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_express_app,node_package,node_project_data,node_page_routes,node_project_api,node_contact_api,node_not_found,node_static_assets toneBlue
class node_home_view,node_projects_view,node_project_detail_view,node_shared_partials,node_contact_view toneAmber
class node_browser_client,node_styles,node_frontend_script toneMint
```

## Components

### Express server

- [Express application](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js): Node.js entrypoint · Owns routing, static delivery, APIs, and fallback handling. · `server.js`
- [Package scripts](https://github.com/yukeshravi/yukeshportfolio/blob/main/package.json): Node.js manifest · `package.json`
- [Project collection](https://github.com/yukeshravi/yukeshportfolio/blob/main/data/projects.js): content model · `data/projects.js`
- [Portfolio page routes](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js): route handlers · Serves home, about, projects, detail, and contact pages. · `server.js`
- [Projects JSON API](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js): GET endpoint · `server.js`
- [Contact submission API](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js): POST endpoint · Validation and future mail delivery boundary. · `server.js`
- [Not-found handling](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/404.ejs): 404 response · Also handles invalid project identifiers. · `views/404.ejs`
- [Static asset delivery](https://github.com/yukeshravi/yukeshportfolio/blob/main/server.js): Express static middleware · `server.js`

### EJS presentation

- [Home page](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/home.ejs): EJS page · `views/home.ejs`
- [Projects pages](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/projects.ejs): EJS pages · Listing and case-study presentation. · `views/projects.ejs`
- [Project detail page](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/project-detail.ejs): EJS page · `views/project-detail.ejs`
- [Shared shell partials](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/partials/head.ejs): EJS partials · Head, navigation, footer, and script inclusion. · `views/partials/head.ejs`
- [Contact page](https://github.com/yukeshravi/yukeshportfolio/blob/main/views/contact.ejs): EJS page · `views/contact.ejs`

### Browser assets

- **Browser**: client
- [Stylesheet](https://github.com/yukeshravi/yukeshportfolio/blob/main/public/css/style.css): CSS asset · `public/css/style.css`
- [Frontend interactions](https://github.com/yukeshravi/yukeshportfolio/blob/main/public/js/main.js): browser JavaScript · Handles navigation, reveal effects, and contact form behavior. · `public/js/main.js`

## Connections

- Package scripts → Express application: starts
- Browser → Express application: HTTP requests
- Express application → Portfolio page routes: dispatches pages
- Express application → Projects JSON API: GET /api/projects
- Express application → Contact submission API: POST /api/contact
- Express application → Static asset delivery: serves /public
- Express application → Not-found handling: unmatched or invalid
- Portfolio page routes → Project collection: reads projects
- Projects JSON API → Project collection: serializes
- Portfolio page routes → Home page: renders
- Portfolio page routes → Projects pages: renders
- Portfolio page routes → Project detail page: renders by id
- Portfolio page routes → Contact page: renders
- Home page → Shared shell partials: includes
- Projects pages → Shared shell partials: includes
- Project detail page → Shared shell partials: includes
- Contact page → Shared shell partials: includes
- Shared shell partials → Stylesheet: loads
- Shared shell partials → Frontend interactions: loads
- Static asset delivery → Stylesheet: delivers
- Static asset delivery → Frontend interactions: delivers
- Frontend interactions → Contact submission API: submits form
