my-portfolio

G.M. Shahariyar Riyan — Portfolio

Personal portfolio of G.M. Shahariyar Riyan, a Java backend and full-stack engineer.

Concept: “The Request”. The site plays out as a single HTTP request travelling through the stack I build. The hero diagram shows the lifecycle (Client → Cloudflare → Spring Security → Controller → Service → JPA → Database). The scroll-progress rail traces the same request through each section (“hop”). The page ends at Contact with a 200 OK.

Signature pieces:


Quick start

npm install
cp .env.example .env.local   # add RESEND_API_KEY to enable the contact form
npm run dev                  # http://localhost:3000
Script What it does
npm run dev Dev server
npm run build Production build
npm start Serve the production build
npm run lint ESLint
npm run typecheck TypeScript, no emit
npm run format Prettier (with Tailwind class order)
npm run check lint + typecheck + build
npm run portrait Regenerate portrait, avatar, favicon/app icons and OG photo from public/images/riyan.jpg

Editing content

All copy lives in src/content/site.ts. It is typed, so a mistake shows up as a type error instead of a broken page. You should never need to touch a component to change text.

You want to change… Edit in site.ts
Name, title, value proposition, email, socials person
“Open to opportunities” (hero card + contact copy) availability.open (off until you confirm)
Hero portrait card text profileCard
Hero “request” band copy heroBand
SEO title / description / keywords seo
Hero diagram layers and their trace lines stackLayers, requestLine, responseLine
About text and the quick-facts panel about
DIU Notes “in production” section proof
Skill layers skillGroups
Projects (order = display order) projects
Experience and education timeline timeline
Engineering-approach cards principles
Section headings sectionCopy
Contact closing contact
CV page summary / additional resume

Swapping your photo

Originals stay untouched in assets/photo/, so the pipeline can always be re-run.

  1. Base matte (only when the photo changes): put the full-resolution photo at assets/photo/riyan-original.jpg, then generate the MODNet base matte:

    python3 -m venv .venv && .venv/bin/pip install numpy pillow onnxruntime
    # MODNet portrait-matting model, about 25 MB
    curl -L -o modnet.onnx https://huggingface.co/Xenova/modnet/resolve/main/onnx/model.onnx
    .venv/bin/python scripts/make-portrait.py --modnet modnet.onnx
    

    This caches assets/photo/riyan-modnet-alpha.png. Later re-runs only need numpy and pillow: .venv/bin/python scripts/make-portrait.py.

  2. Strand-level cut-out: scripts/make-portrait.py does the following:
    • builds a trimap with a widened hair band
    • solves closed-form matting inside it (Levin’s matting Laplacian with He’s fast operator and conjugate gradient, so individual hair strands get soft alpha)
    • recovers the true colour of every semi-transparent pixel: F = (C − (1−α)·B) / α, using the sampled backdrop. This is what removes the white fringe.
    • chokes the edge slightly in the hair and shoulder zone only (never the face), and removes stray islands and holes
    • bleeds colour into fully transparent pixels, so resizing and lossy encoders can’t pull white in

    It writes assets/photo/riyan-portrait-master.png and the proof in docs/portrait-check/:

    • composites over the hero backdrop, black, white and grey
    • 400% crops
    • before/after comparisons
    • halo-score.json, which must pass (≤ 0.03)
  3. Assets: run npm run portrait. It writes:
    • the hero portrait as AVIF (4:4:4) and WebP (alpha q100) at 600/1000px, plus a PNG fallback. These are served through <picture>, so no optimizer re-encodes the hair edge.
    • the 4:5 nav/footer badge
    • the favicon and app icons (32/48/64/180/192/512)
    • the Open Graph photo

    Every logo uses the full, uncropped photo.

Adding project screenshots

Drop images into public/images/projects/<slug>/, e.g. public/images/projects/diu-folio/01-dashboard.webp.

diu-notes/01-home.webp is a real capture of the public diunotes.com homepage. Replace it with curated screens whenever you like.

Adding metrics

Fill metrics: [{ label: "Registered students", value: "…" }] on a project, using real numbers only. Metrics appear in the case-study view only when the array is non-empty.

Skill ↔ project connections are derived, never hand-written. src/lib/skill-usage.ts links a skill to a project only when that project’s stack, highlights or approach text mentions it, or one of its synonyms (e.g. React.js ↔ React, RBAC ↔ role-based).

The CSE-Tech internship is a context node, linked by the same matching over its timeline points.

The same data powers:

To add a connection, describe the work in site.ts; to add a synonym, edit ALIASES.

Resume

public/cv.pdf is the CV every viewer shows. Replace it with your final CV at any time. It’s cached for a day and revalidated by ETag, so visitors don’t re-download it on every visit.

The viewer (ResumeViewer.tsx) is built on pdf.js:

Feature Details
Toolbar Previous/next, zoom, fit width/page, fullscreen, print, open in new tab, download (as G.M._Shahariyar_Riyan_CV.pdf)
Keyboard ←/→ for pages, +/− to zoom, 0 for fit width, F for fullscreen, Esc to exit or close
Desktop Thumbnail rail
Phones Pinch zoom, double-tap zoom, swipe between pages
“Updated” label Comes from the file’s Last-Modified header

It appears in three places:

/cv/print is the printable, brand-matching HTML CV generated from site.ts. To regenerate the PDF from it:

npm run build && npm start   # in one terminal
google-chrome --headless=new --no-pdf-header-footer --virtual-time-budget=5000 \
  --print-to-pdf=public/cv.pdf http://localhost:3000/cv/print

Background (“atmosphere”) and Calm mode

One fixed atmosphere sits behind every section, in three layers:

  1. A CSS gradient, which renders instantly.
  2. A pre-rendered still of the contour field (public/images/atmosphere/contours-{dark,light}.webp), drawn into a canvas after load. Canvases never become the LCP element.
  3. The live WebGL2 shader (shader.ts, AtmosphereGL.tsx), cross-faded in when the device can afford it.

The shader draws curl-noise topographic contours with a pointer light. Each section has its own look, and they cross-fade with scroll:

Section Look
Hero Flowing contours
About, In production, Stack, Work Ember glows (Stack also has a reactive constellation overlay; In production has travelling signal packets)
Journey Aurora
Approach Fog
Contact Horizon glow

Budget:

Who sees the still instead:

Regenerating the stills after changing the shader: render one frame of the top look at 1600×1000 for each theme (any WebGL2 page using VERT/FRAG works), then save it as WebP.

Performance

Contact form

Spam protection:

Bots that trip a trap get a fake success response, so they don’t retry.

Setup:

  1. Create an API key at resend.com and set RESEND_API_KEY.
  2. To deliver to any inbox, verify a domain in Resend and set CONTACT_FROM_EMAIL to an address on that domain.

Without a verified domain, the sandbox sender onboarding@resend.dev only delivers to the email on your Resend account.

Without a key, the form shows a friendly “email me directly” fallback (HTTP 503).

System status and live badge

The footer’s System status shows two things:

It shows no uptime figures.

Live status badge

GET /api/status checks https://diunotes.com server-side, with a 6-second timeout. The result is cached for 60 seconds ("use cache" + cacheLife), so there are no client CORS calls.

The badge only says what the check proved:

Deploying to Vercel

  1. Push this repository to GitHub.
  2. In Vercel, choose Add New → Project and import the repo. The framework is detected automatically.
  3. Under Settings → Environment Variables, add RESEND_API_KEY, and optionally CONTACT_TO_EMAIL, CONTACT_FROM_EMAIL and NEXT_PUBLIC_SITE_URL.
  4. Deploy.
  5. Optional: add a custom domain under Settings → Domains, then set NEXT_PUBLIC_SITE_URL=https://yourdomain and redeploy. Canonical URLs, the sitemap, robots and OG URLs all use it.

Without a custom domain, Vercel’s production URL is picked up automatically (VERCEL_PROJECT_PRODUCTION_URL).

Cloudflare Pages also works, via OpenNext (@opennextjs/cloudflare). Vercel is recommended because the API routes and "use cache" work there with zero configuration.


Architecture

src/
  content/site.ts          ← all content (edit this)
  app/                     ← routes: /, /cv, /cv/print, 404, api/{contact,status}, OG images, icons, sitemap, robots, manifest
  components/
    atmosphere/            ← per-section backgrounds (WebGL flow field, signals, constellation), shared canvas loop
    graph/                 ← ConnectionGraph (d3-force + canvas), GraphSection (Graph | Layers), MiniGraph, SkillSheet
    hero/                  ← StackDiagram, PortraitCard ("200 OK · profile"), contours, gyro parallax, CTAs
    sections/              ← About, Proof, Skills, Projects (+ detail sheet), Journey, Approach, Contact
    layout/                ← Nav, RequestTrace (progress rail), MobileDock, CommandPalette, Intro, Footer
    interaction/           ← Pressable, TiltCard, Spotlight, Reveal, SplitText, Scramble, Cursor, InteractionLayer
    providers/             ← smooth scroll (Lenis + GSAP ticker), UI state, MotionConfig
    ui/                    ← SectionHeader, Chip, SkillChip, BrandMark, ProjectMedia (device frames), ProjectCover
  lib/                     ← skill-usage derivation, project-media discovery, motion budget (Calm mode), theme store, hooks, contact validation
scripts/process-portrait.mjs ← photo → portrait, brand mark, icons, OG photo

Case-study transitions

Opening a case study uses the View Transitions API: the card’s media morphs into the panel’s media (case-media, see src/lib/view-transition.ts). Browsers without support, and reduced motion, fall back to the slide-in panel.

Interaction system

All interactions are built on Pointer Events. Capability is detected with (hover: hover) and (pointer: fine), never by sniffing the user agent.

Desktop (fine pointer) Phone / tablet (touch)
Cursor drives the request through the diagram Press-and-hold then drag to trace; tap a layer to inspect it
Magnetic custom cursor that morphs by context Native cursorless UI
Magnetic buttons Spring press + ripple + navigator.vibrate where supported
3D tilt and glare on hover Tilt follows the finger while pressed
Illustrations animate on hover The centred carousel card’s illustration plays
Case study opens as a side panel Case study opens as a bottom sheet with drag-to-dismiss
Graph: hover highlights, click pins, drag with inertia, ctrl+scroll zoom Graph: tap selects (details in a bottom sheet), pinch zoom, opt-in drag & pan
Portrait card: cursor parallax, tilt and glare Portrait card: tilt follows the finger; optional gyroscope (iOS permission flow)
Top nav with active section, ⌘K palette Thumb-zone dock with current hop, plus a bottom-sheet menu
Lenis inertial scroll, GSAP scrubbed parallax Native momentum scroll; optional gyroscope parallax (iOS permission flow)

Keyboard users get a skip link and visible focus everywhere. The diagram responds to ↑/↓/Home/End with a live-region announcement. The skill tabs follow the ARIA tabs pattern. Modals trap focus and close on Esc. ⌘K / Ctrl+K opens the command palette.

prefers-reduced-motion is honoured:

Performance notes