How yukeshravi/yukeshportfolio works
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 Express application · head.ejs Shared shell partials · main.js Frontend interactions · home.ejs Home page
Components 16
Express server
- Express application · Owns routing, static delivery, APIs, and fallback handling.
server.js - Package scripts
package.json - Project collection
data/projects.js - Portfolio page routes · Serves home, about, projects, detail, and contact pages.
server.js - Projects JSON API
server.js - Contact submission API · Validation and future mail delivery boundary.
server.js - Not-found handling · Also handles invalid project identifiers.
views/404.ejs - Static asset delivery
server.js
EJS presentation
- Home page
views/home.ejs - Projects pages · Listing and case-study presentation.
views/projects.ejs - Project detail page
views/project-detail.ejs - Shared shell partials · Head, navigation, footer, and script inclusion.
views/partials/head.ejs - Contact page
views/contact.ejs
Browser assets
- Browser
- Stylesheet
public/css/style.css - Frontend interactions · Handles navigation, reveal effects, and contact form behavior.
public/js/main.js
Connections 22
- 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