Add project image carousel, HTTPS support, and deployment setup

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbertandClaude Sonnet 5.5 committed 2026-10-01 19:07:09 +01:00
1 parent 7d1d2feccb
commit 2e67bc1418
11 files changed
+197 -11

No files matched your search

+7
View File
@@ -16,3 +16,10 @@ GITHUB_TOKEN=
# Exact origin(s) allowed to call /api/* (your deployed domain). # Exact origin(s) allowed to call /api/* (your deployed domain).
ALLOWED_ORIGIN=https://mudabbir.co.uk ALLOWED_ORIGIN=https://mudabbir.co.uk
PORT=3001 PORT=3001
# Encryption in transit. Pick ONE:
# a) Terminate TLS in this server: paths to PEM files (e.g. Let's Encrypt).
# TLS_CERT=/etc/letsencrypt/live/example.com/fullchain.pem
# TLS_KEY=/etc/letsencrypt/live/example.com/privkey.pem
# b) Behind a TLS reverse proxy: redirect any plain-HTTP request to HTTPS.
# FORCE_HTTPS=true
+5
View File
@@ -14,3 +14,8 @@ public/CV/*
# Local env / editor cruft # Local env / editor cruft
*.local *.local
.DS_Store .DS_Store
# Local scratch
.claude/
.gh-*.json
scripts/diff-tracker.mjs
+20
View File
@@ -0,0 +1,20 @@
# Deploying
## Adding project images
1. Copy the files into `public/images/projects/`.
2. Add the filenames under the project's id in `src/project-images.json`.
Several filenames = carousel.
## First-time server setup
1. `git clone` the repo, then create `secrets/.env` from `.env.example`
(set `VITE_*` values, `GITHUB_TOKEN` (read-only PAT), `ALLOWED_ORIGIN`, and
either `TLS_CERT`/`TLS_KEY` or `FORCE_HTTPS=true` behind a TLS proxy).
2. Put your CV at `public/CV/` (gitignored, so copy it over manually).
3. `npm run deploy` — installs, builds, and starts the server (default port 3001).
## Updating
```
git pull && npm run setup && npm run build
```
then restart the process (systemd/pm2). The token lives only in `secrets/.env`
and is only ever used by `server/index.js`; the browser never sees it.
+4 -1
View File
@@ -6,7 +6,10 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview" "preview": "vite preview",
"setup": "npm ci && npm ci --prefix server",
"start": "node server/index.js",
"deploy": "npm run setup && npm run build && npm start"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/vite": "^4.3.3", "@tailwindcss/vite": "^4.3.3",
+6
View File
@@ -0,0 +1,6 @@
Drop project screenshots here, then list the filenames in src/project-images.json:
"mass": ["mass-1.png", "mass-2.png", "mass-3.png"]
One filename = a single picture. Two or more = a carousel (arrows, dots, keyboard
left/right). Leave the list empty to keep the default artwork.
+23 -2
View File
@@ -14,6 +14,9 @@ import express from "express";
import cors from "cors"; import cors from "cors";
import helmet from "helmet"; import helmet from "helmet";
import rateLimit from "express-rate-limit"; import rateLimit from "express-rate-limit";
import fs from "node:fs";
import http from "node:http";
import https from "node:https";
import path from "node:path"; import path from "node:path";
import { fileURLToPath } from "node:url"; import { fileURLToPath } from "node:url";
import dotenv from "dotenv"; import dotenv from "dotenv";
@@ -24,6 +27,13 @@ dotenv.config({ path: path.resolve(__dirname, "../secrets/.env") });
const TOKEN = process.env.GITHUB_TOKEN || ""; const TOKEN = process.env.GITHUB_TOKEN || "";
const ALLOWED_ORIGIN = process.env.ALLOWED_ORIGIN || "http://localhost:5173"; const ALLOWED_ORIGIN = process.env.ALLOWED_ORIGIN || "http://localhost:5173";
const PORT = Number(process.env.PORT) || 3001; const PORT = Number(process.env.PORT) || 3001;
// Encryption in transit. Either terminate TLS here (TLS_CERT + TLS_KEY paths to
// PEM files) or sit behind a TLS proxy and set FORCE_HTTPS=true so plain-HTTP
// requests are redirected. Either way the GitHub token stays server-side and
// the upstream call to api.github.com is always HTTPS.
const TLS_CERT = process.env.TLS_CERT || "";
const TLS_KEY = process.env.TLS_KEY || "";
const FORCE_HTTPS = process.env.FORCE_HTTPS === "true";
const WEEKS = 53; const WEEKS = 53;
const CACHE_TTL_MS = 10 * 60 * 1000; // one shared cache entry; this is a single-user site const CACHE_TTL_MS = 10 * 60 * 1000; // one shared cache entry; this is a single-user site
@@ -125,8 +135,14 @@ async function fetchContributions() {
const app = express(); const app = express();
app.set("trust proxy", 1); // behind Nginx Proxy Manager, needed for correct rate-limit IPs app.set("trust proxy", 1); // behind Nginx Proxy Manager, needed for correct rate-limit IPs
if (FORCE_HTTPS) {
app.use((req, res, next) =>
req.secure ? next() : res.redirect(308, `https://${req.headers.host}${req.originalUrl}`)
);
}
app.use( app.use(
helmet({ helmet({
hsts: { maxAge: 63072000, includeSubDomains: true, preload: true },
contentSecurityPolicy: { contentSecurityPolicy: {
directives: { directives: {
defaultSrc: ["'self'"], defaultSrc: ["'self'"],
@@ -165,7 +181,12 @@ const distPath = path.resolve(__dirname, "../dist");
app.use(express.static(distPath)); app.use(express.static(distPath));
app.get(/^(?!\/api).*/, (req, res) => res.sendFile(path.join(distPath, "index.html"))); app.get(/^(?!\/api).*/, (req, res) => res.sendFile(path.join(distPath, "index.html")));
app.listen(PORT, () => { const server =
console.log(`portfolio server listening on :${PORT}`); TLS_CERT && TLS_KEY
? https.createServer({ cert: fs.readFileSync(TLS_CERT), key: fs.readFileSync(TLS_KEY) }, app)
: http.createServer(app);
server.listen(PORT, () => {
console.log(`portfolio server listening on :${PORT} (${TLS_CERT && TLS_KEY ? "HTTPS" : "HTTP"})`);
if (!TOKEN) console.warn("GITHUB_TOKEN not set, /api/contributions will return 501"); if (!TOKEN) console.warn("GITHUB_TOKEN not set, /api/contributions will return 501");
}); });
+39
View File
@@ -0,0 +1,39 @@
import { useState } from "react";
// Single image renders as a plain picture; several render as a carousel with
// arrows, dots, and scroll-snap swiping.
export default function ImageCarousel({ images }) {
const [i, setI] = useState(0);
if (images.length === 1) return <img className="pm-image" src={images[0]} alt="" />;
const go = (n) => setI((n + images.length) % images.length);
return (
<div
className="pm-carousel"
role="group"
aria-roledescription="carousel"
onKeyDown={(e) => {
if (e.key === "ArrowLeft") go(i - 1);
if (e.key === "ArrowRight") go(i + 1);
}}
>
<div className="pm-carousel-track" style={{ transform: `translateX(-${i * 100}%)` }}>
{images.map((src, n) => (
<img key={src} className="pm-image" src={src} alt="" aria-hidden={n !== i} />
))}
</div>
<button className="pm-arrow pm-arrow--prev" onClick={() => go(i - 1)} aria-label="Previous image">‹</button>
<button className="pm-arrow pm-arrow--next" onClick={() => go(i + 1)} aria-label="Next image">›</button>
<div className="pm-dots">
{images.map((src, n) => (
<button
key={src}
className={`pm-dot${n === i ? " pm-dot--on" : ""}`}
onClick={() => setI(n)}
aria-label={`Image ${n + 1} of ${images.length}`}
aria-current={n === i}
/>
))}
</div>
</div>
);
}
+10 -1
View File
@@ -1,6 +1,15 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import { projects } from "../content.js"; import { projects } from "../content.js";
import ImageCarousel from "./ImageCarousel.jsx";
import projectImages from "../project-images.json";
// Images listed in src/project-images.json (files live in public/images/projects/);
// falls back to the project's default artwork.
function imagesFor(p) {
const list = (projectImages[p.id] || []).map((f) => `/images/projects/${f}`);
return list.length ? list : [p.image];
}
function Tag({ children, variant }) { function Tag({ children, variant }) {
return <span className={`tag${variant ? ` tag--${variant}` : ""}`}>{children}</span>; return <span className={`tag${variant ? ` tag--${variant}` : ""}`}>{children}</span>;
@@ -124,7 +133,7 @@ export default function Projects() {
<button className="pm-close" ref={closeRef} onClick={close}> <button className="pm-close" ref={closeRef} onClick={close}>
Close × Close ×
</button> </button>
<img className="pm-image" src={selected.image} alt="" /> <ImageCarousel key={selected.id} images={imagesFor(selected)} />
<div className="pm-body"> <div className="pm-body">
<div className="pm-head"> <div className="pm-head">
<h3 id="pm-title">{selected.title}</h3> <h3 id="pm-title">{selected.title}</h3>
+15 -7
View File
@@ -35,7 +35,7 @@ export const profile = {
about: [ about: [
"I'm a recent graduate software engineer based in London. I studied Computer Science at first-class level, and spent my degree building real systems: a media aggregation & sorting system for my final-year project, mobile apps with React Native, and coursework that pushed me to think like an engineer, not just a coder.", "I'm a recent graduate software engineer based in London. I studied Computer Science at first-class level, and spent my degree building real systems: a media aggregation & sorting system for my final-year project, mobile apps with React Native, and coursework that pushed me to think like an engineer, not just a coder.",
"Outside of work I run a home lab: a Proxmox host carrying a stack of self-hosted services, three cloud VPS instances, and a growing interest in running local AI models on my own hardware. If it can be self-hosted, I've probably tried to.", "Outside of my studies, I run a home lab: a Proxmox host carrying a stack of self-hosted services, three cloud VPS instances, and a growing interest in running local AI models on my own hardware. If it can be self-hosted, I've probably tried to.",
], ],
}; };
@@ -115,6 +115,7 @@ export const interests = [
// the long-form write-up for the expanded view; `image` is its art. // the long-form write-up for the expanded view; `image` is its art.
export const projects = [ export const projects = [
{ {
id: "mass",
title: "MASS: Media Aggregation & Sorting System", title: "MASS: Media Aggregation & Sorting System",
year: "2026", year: "2026",
role: "Final-year project · Solo", role: "Final-year project · Solo",
@@ -134,6 +135,7 @@ export const projects = [
highlight: true, highlight: true,
}, },
{ {
id: "radar",
title: "Hardware Tinkering: 240 GHz Doppler Radar", title: "Hardware Tinkering: 240 GHz Doppler Radar",
role: "Hardware project · ESP32", role: "Hardware project · ESP32",
description: description:
@@ -150,6 +152,7 @@ export const projects = [
stack: ["ESP32", "Arduino"], stack: ["ESP32", "Arduino"],
}, },
{ {
id: "qr-hunt",
title: "QR Code Treasure Hunt", title: "QR Code Treasure Hunt",
year: "2024", year: "2024",
role: "Group project · Year 2 final coursework", role: "Group project · Year 2 final coursework",
@@ -167,6 +170,7 @@ export const projects = [
repo: `https://github.com/${GITHUB_USER}/Treasure-Hunt-App`, repo: `https://github.com/${GITHUB_USER}/Treasure-Hunt-App`,
}, },
{ {
id: "crudl",
title: "CRUDL: React Native Demo", title: "CRUDL: React Native Demo",
year: "2024", year: "2024",
role: "University project", role: "University project",
@@ -184,6 +188,7 @@ export const projects = [
repo: `https://github.com/${GITHUB_USER}/Project-MAD-crudler`, repo: `https://github.com/${GITHUB_USER}/Project-MAD-crudler`,
}, },
{ {
id: "routines",
title: "Routines App", title: "Routines App",
year: "2024", year: "2024",
role: "Personal project · Android", role: "Personal project · Android",
@@ -201,6 +206,7 @@ export const projects = [
repo: `https://github.com/${GITHUB_USER}/Kotlin-TB2P1`, repo: `https://github.com/${GITHUB_USER}/Kotlin-TB2P1`,
}, },
{ {
id: "geo-hunt",
title: "Location-Based Treasure Hunt App", title: "Location-Based Treasure Hunt App",
year: "2024", year: "2024",
role: "University project · Mobile Development", role: "University project · Mobile Development",
@@ -218,6 +224,7 @@ export const projects = [
repo: `https://github.com/${GITHUB_USER}/MAD-Treasure-Hunt`, repo: `https://github.com/${GITHUB_USER}/MAD-Treasure-Hunt`,
}, },
{ {
id: "ai-bot",
title: "AI Discord Bot", title: "AI Discord Bot",
year: "2025", year: "2025",
role: "Personal project · Self-hosted", role: "Personal project · Self-hosted",
@@ -235,6 +242,7 @@ export const projects = [
tags: ["Private-Repo"], tags: ["Private-Repo"],
}, },
{ {
id: "cv-builder",
title: "CV Builder", title: "CV Builder",
year: "2024/2025", year: "2024/2025",
role: "Personal project · Desktop", role: "Personal project · Desktop",
@@ -354,7 +362,7 @@ export const skills = {
export const homelab = [ export const homelab = [
{ name: "Proxmox", detail: "Single-node hypervisor running the whole stack" }, { name: "Proxmox", detail: "Single-node hypervisor running the whole stack" },
{ name: "Jellyfin + own media server", detail: "Self-hosted streaming (media server WIP)" }, { name: "Own Media Server", detail: "Self-hosted streaming (WIP)" },
{ name: "SearXNG", detail: "Private metasearch engine" }, { name: "SearXNG", detail: "Private metasearch engine" },
{ name: "Dockhand", detail: "Container management UI" }, { name: "Dockhand", detail: "Container management UI" },
{ name: "Nginx", detail: "Reverse proxy for the house network" }, { name: "Nginx", detail: "Reverse proxy for the house network" },
@@ -373,20 +381,20 @@ export const homelab = [
export const localAI = { export const localAI = {
heading: "Local AI, on my own hardware", heading: "Local AI, on my own hardware",
body: [ body: [
"I run self-hosted language models on hardware I own, currently a custom flavour of Qwen 3.8 27B served through LM Studio and OpenWebUI, as a way to learn how LLMs actually work under the hood: inference, context, and serving.", "I run my own self-hosted language models on my own hardware. Currently running a custom flavour of a quantised Qwen 3.8 27B Model served through BeeLLama over to my OpenWebUI instance running on my HomeLab, as a way to learn on how to deploy and utilise LLMs in the modern day world and also help me study how they work in a more fundamental sense, when it comes down to their inference, context management and serving it.",
"It's not just theory: my Discord bot pairs a Cloud Gemma 4 31B-IT model for text chat and voice with a local Gemma 4 E4B QAT fallback.", "It's not just Local Models I utilise, I make use of a mix of both Local and Cloud hosted models in my own applications such as an AI Model Powered Discord Chat Bot, a discord bot capable of interacting with users both in Text format and also in Voice Calls, with the goal of acting like a regular human user. This pushes me towards building and writing code that works with both small and larger models which would react to certain prompts differently.",
], ],
}; };
// Self-assessed working proficiency, not a byte share: weighted by how many // Self-assessed working proficiency, not a byte share: weighted by how many
// projects were built in each language and current fluency, not raw lines. // projects were built in each language and current fluency, not raw lines.
// Java leads; C++/Go mid-band; Python eased down (fewer recent projects); // Java leads; C++ ahead of Python; Go mid-band;
// JS/CSS raised on project count; TypeScript low, known via JavaScript only. // JS/CSS raised on project count; TypeScript low, known via JavaScript only.
export const languageStats = [ export const languageStats = [
{ name: "Java", pct: 56 }, { name: "Java", pct: 56 },
{ name: "JavaScript", pct: 48 }, { name: "JavaScript", pct: 48 },
{ name: "Python", pct: 28 }, { name: "C++", pct: 28 },
{ name: "C++", pct: 22 }, { name: "Python", pct: 22 },
{ name: "Go", pct: 18 }, { name: "Go", pct: 18 },
{ name: "CSS", pct: 16 }, { name: "CSS", pct: 16 },
{ name: "TypeScript", pct: 14 }, { name: "TypeScript", pct: 14 },
+57
View File
@@ -1407,3 +1407,60 @@ html.has-custom-cursor * {
animation: none; animation: none;
} }
} }
/* Project image carousel */
.pm-carousel {
position: relative;
overflow: hidden;
border-bottom: 1px solid var(--hairline);
}
.pm-carousel-track {
display: flex;
transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.pm-carousel-track .pm-image {
flex: 0 0 100%;
border-bottom: 0;
}
.pm-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 38px;
height: 38px;
border-radius: 999px;
border: 1px solid var(--hairline-strong);
background: var(--surface);
color: var(--ink);
font-size: 22px;
line-height: 1;
cursor: pointer;
}
.pm-arrow--prev { left: 12px; }
.pm-arrow--next { right: 12px; }
.pm-dots {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
display: flex;
justify-content: center;
gap: 8px;
}
.pm-dot {
width: 9px;
height: 9px;
padding: 0;
border-radius: 999px;
border: 1px solid var(--surface);
background: rgba(19, 17, 24, 0.45);
cursor: pointer;
}
.pm-dot--on { background: var(--accent); }
.pm-arrow:focus-visible, .pm-dot:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.pm-carousel-track { transition: none; }
}
+11
View File
@@ -0,0 +1,11 @@
{
"_help": "Drop image files into public/images/projects/ then list their filenames under the project id. One image = static picture; several = a swipeable carousel. Projects not listed (or with an empty list) fall back to their default artwork.",
"mass": [],
"radar": [],
"qr-hunt": [],
"crudl": [],
"routines": [],
"geo-hunt": [],
"ai-bot": [],
"cv-builder": []
}