Rewrite contribution tracker on GitHub GraphQL; tidy copy and degree title

This commit is contained in:
bobbert committed 2026-09-17 15:23:26 +01:00
1 parent be354a60c9
commit e7fbf9598d
9 files changed
+180 -135

No files matched your search

+2
View File
@@ -6,3 +6,5 @@ VITE_EMAIL=you@example.com
VITE_GITHUB_USER=your-github-username
VITE_LINKEDIN=https://www.linkedin.com/in/your-profile
VITE_CV_URL=/CV/Bob-CV.pdf
# Optional — powers the contribution graph (public + private). Use a token with no scopes; it ships in the deployed bundle.
VITE_GITHUB_TOKEN=
+2 -2
View File
@@ -9,9 +9,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="Bob — graduate software engineer in London. BSc Computer Science with Honours, First Class. Projects, skills, and a homelab."
content="Bob, graduate software engineer in London. BSc Computer Science with Honours, First Class. Projects, skills, and a homelab."
/>
<title>Bob — Graduate Software Engineer</title>
<title>Bob, Graduate Software Engineer</title>
</head>
<body>
<div id="root"></div>
+1 -2
View File
@@ -8,8 +8,7 @@ export default function Contact() {
<p className="eyebrow eyebrow--light">Get in touch</p>
<h2 className="contact-title">Let's talk.</h2>
<p className="contact-lede">
I'm open to graduate and junior software engineering roles — or just a
good conversation about self-hosting.
I'm open to graduate and junior software engineering roles, or just a good conversation about self-hosting.
</p>
<div className="contact-actions">
<a className="btn btn-primary" href={`mailto:${profile.email}`}>
+1 -1
View File
@@ -11,7 +11,7 @@ export default function GitHubGrid() {
<div className="container">
<h2 className="section-title">On GitHub</h2>
<p className="section-lede">
A curated selection from my 38 repositories — 27 self-made and 11
A curated selection from my 38 repositories: 27 self-made and 11
fully agentic projects built with AI agents, to develop a feel for
system design and AI-assisted software development. The full list
lives on{" "}
+1 -1
View File
@@ -6,7 +6,7 @@ export default function Homelab() {
<div className="container">
<h2 className="section-title">Homelab &amp; side endeavours</h2>
<p className="section-lede">
Everything below runs on hardware I own — a single Proxmox node at home,
Everything below runs on hardware I own: a single Proxmox node at home,
three cloud VPS instances, and the services that live on top of them.
</p>
<ul className="homelab-grid">
+1 -1
View File
@@ -11,7 +11,7 @@ export default function Projects() {
<p className="eyebrow">Selected work</p>
<h2 className="section-title">Projects, in detail</h2>
<p className="section-lede">
A selection of projects that show how I work — from final-year
A selection of projects that show how I work, from final-year
systems to self-hosted experiments.
</p>
<div className="project-grid">
+141 -102
View File
@@ -1,14 +1,8 @@
import { useEffect, useState } from "react";
import { profile } from "../content.js";
const WEEKS = 13;
const MAX_PAGES = 5;
function startOfLocalDay(d) {
const x = new Date(d);
x.setHours(0, 0, 0, 0);
return x;
}
const WEEKS = 53; // trailing year, same span as GitHub's default graph
const MAX_LEVEL = 4;
const TOKEN = import.meta.env.VITE_GITHUB_TOKEN || "";
function addDays(d, n) {
const x = new Date(d);
@@ -22,51 +16,86 @@ function dayKey(d) {
).padStart(2, "0")}`;
}
function fmtDay(d) {
return d.toLocaleDateString("en-GB", { day: "numeric", month: "short" });
function fmtDay(iso) {
const [y, m, d] = iso.split("-").map(Number);
return new Date(y, m - 1, d).toLocaleDateString("en-GB", { day: "numeric", month: "short" });
}
function levelFor(count) {
if (count <= 0) return 0;
if (count === 1) return 1;
if (count <= 3) return 2;
if (count <= 6) return 3;
return 4;
// GitHub-style levels: quartiles over the non-zero days.
function levelMap(counts) {
const active = [...counts.values()].filter((n) => n > 0).sort((a, b) => a - b);
const levels = new Map();
for (const [day, n] of counts) {
if (n === 0) continue;
let lo = 0;
let hi = active.length;
while (lo < hi) {
const mid = (lo + hi) >> 1;
if (active[mid] < n) lo = mid + 1;
else hi = mid;
}
levels.set(day, Math.min(MAX_LEVEL, Math.floor((lo / active.length) * MAX_LEVEL) + 1));
}
return levels;
}
async function fetchPushCounts(cutoff) {
async function fetchContributions(fromIso) {
const res = await fetch("https://api.github.com/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
query: `{
viewer {
contributionsCollection(from: "${fromIso}T00:00:00Z") {
totalCommitContributions
totalPullRequestContributions
totalIssueContributions
totalPullRequestReviewContributions
contributionCalendar {
weeks {
contributionDays {
date
contributionCount
}
}
}
}
}
}`,
}),
});
const json = await res.json();
if (!res.ok || json.errors) {
throw new Error(json.errors?.[0]?.message || `GraphQL ${res.status}`);
}
const cc = json.data.viewer.contributionsCollection;
const counts = new Map();
let totalPushes = 0;
let lastPush = null;
for (let page = 1; page <= MAX_PAGES; page++) {
const res = await fetch(
`https://api.github.com/users/${profile.githubUser}/events/public?per_page=100&page=${page}`,
{ headers: { Accept: "application/vnd.github+json" } }
);
if (!res.ok) throw new Error(`GitHub API responded ${res.status}`);
const events = await res.json();
if (!Array.isArray(events) || events.length === 0) break;
let oldest = null;
for (const ev of events) {
const created = new Date(ev.created_at);
oldest = oldest === null ? created : (created < oldest ? created : oldest);
if (ev.type !== "PushEvent") continue;
const day = startOfLocalDay(created);
if (day < cutoff) continue;
const k = dayKey(day);
counts.set(k, (counts.get(k) || 0) + 1);
totalPushes += 1;
if (lastPush === null || created > lastPush) lastPush = created;
for (const week of cc.contributionCalendar.weeks) {
for (const day of week.contributionDays) {
if (day.contributionCount > 0) counts.set(day.date, day.contributionCount);
}
}
// Events arrive newest-first: once this page reaches past the window,
// older pages can't contribute anything.
if (oldest !== null && oldest < cutoff) break;
}
let last = null;
for (const day of counts.keys()) if (!last || day > last) last = day;
return { counts, totalPushes, lastPush };
// Calendar sum matches GitHub's profile number (includes private contributions).
let calendarSum = 0;
for (const n of counts.values()) calendarSum += n;
return {
counts,
total: calendarSum,
commits: cc.totalCommitContributions,
prs: cc.totalPullRequestContributions,
issues: cc.totalIssueContributions,
reviews: cc.totalPullRequestReviewContributions,
last,
};
}
export default function PushTracker() {
@@ -74,16 +103,19 @@ export default function PushTracker() {
const [data, setData] = useState(null);
useEffect(() => {
if (!TOKEN) {
setStatus("note");
return;
}
let cancelled = false;
(async () => {
try {
const today = startOfLocalDay(new Date());
const today = new Date();
const thisSunday = addDays(today, -today.getDay());
const gridStart = addDays(thisSunday, -(WEEKS - 1) * 7);
const cutoff = addDays(gridStart, -5);
const result = await fetchPushCounts(cutoff);
const result = await fetchContributions(dayKey(gridStart));
if (cancelled) return;
setData({ ...result, today, gridStart });
setData(result);
setStatus("ready");
} catch {
if (!cancelled) setStatus("error");
@@ -96,28 +128,63 @@ export default function PushTracker() {
let grid = null;
let statsLine = null;
if (status === "ready" && data) {
const { counts, totalPushes, lastPush, today, gridStart } = data;
const activeDays = counts.size;
const today = new Date();
const thisSunday = addDays(today, -today.getDay());
const gridStart = addDays(thisSunday, -(WEEKS - 1) * 7);
const levels = levelMap(data.counts);
const activeDays = [...data.counts.values()].filter((n) => n > 0).length;
const columns = [];
for (let c = 0; c < WEEKS; c++) {
const week = [];
for (let r = 0; r < 7; r++) {
const day = addDays(gridStart, c * 7 + r);
const count = counts.get(dayKey(day)) || 0;
week.push({ day, count, future: day > today });
for (let w = 0; w < WEEKS; w++) {
const cells = [];
for (let dow = 0; dow < 7; dow++) {
const day = addDays(gridStart, w * 7 + dow);
const key = dayKey(day);
const count = data.counts.get(key) || 0;
cells.push(
<span
key={key}
className={`pt-cell l${levels.get(key) || 0}${day > today ? " is-future" : ""}`}
title={count ? `${count} contribution${count === 1 ? "" : "s"} on ${fmtDay(key)}` : fmtDay(key)}
/>
);
}
columns.push(week);
columns.push(
<div className="pt-col" key={w}>
{cells}
</div>
);
}
grid = columns;
grid = (
<div className="pt-scroll">
<div className="pt-grid" role="img" aria-label={`Contribution graph: ${data.total} contributions in the last year`}>
{columns}
</div>
</div>
);
const parts = [`${data.commits} commit${data.commits === 1 ? "" : "s"}`];
if (data.prs) parts.push(`${data.prs} pull request${data.prs === 1 ? "" : "s"}`);
if (data.issues) parts.push(`${data.issues} issue${data.issues === 1 ? "" : "s"}`);
if (data.reviews) parts.push(`${data.reviews} review${data.reviews === 1 ? "" : "s"}`);
statsLine = (
<p className="pt-stats">
{totalPushes} push{totalPushes === 1 ? "" : "es"} · {activeDays} active day
{activeDays === 1 ? "" : "s"}
{lastPush ? ` · last push ${fmtDay(lastPush)}` : ""}
</p>
<>
<span className="pt-stats">
{data.total} contributions in the last year · {activeDays} active days
{data.last ? ` · last ${fmtDay(data.last)}` : ""}: {parts.join(" · ")}
</span>
<span className="pt-legend">
less
{[0, 1, 2, 3, 4].map((l) => (
<span key={l} className={`pt-cell l${l}`} />
))}
more
</span>
</>
);
}
@@ -125,49 +192,21 @@ export default function PushTracker() {
<section className="push-tracker section" id="activity">
<div className="container">
<p className="eyebrow">Activity</p>
<h2 className="section-title">Push tracker</h2>
<h2 className="section-title">Contributions</h2>
<p className="section-lede">
Every git push across my public repositories, pulled live from GitHub's
events API — the last 13 weeks.
Commits, pull requests and issues across all my repositories, public and private, pulled live from GitHub.
</p>
<div className="pt-card">
{status === "loading" && (
<p className="pt-note">Fetching push activity…</p>
{status === "loading" && <p className="pt-note">Fetching contribution activity…</p>}
{status === "note" && (
<p className="pt-note">Contribution data isn't available without a GitHub token.</p>
)}
{status === "error" && (
<p className="pt-note">Push activity is unavailable right now.</p>
)}
{status === "ready" && grid && (
<>
<div className="pt-grid" role="img" aria-label="Push activity heatmap, last 13 weeks">
{grid.map((week, c) => (
<div className="pt-col" key={c}>
{week.map((cell, r) => (
<span
key={r}
className={`pt-cell l${cell.future ? 0 : levelFor(cell.count)}${cell.future ? " is-future" : ""}`}
title={
cell.future
? undefined
: `${fmtDay(cell.day)} — ${cell.count} push${cell.count === 1 ? "" : "es"}`
}
/>
))}
</div>
))}
</div>
<div className="pt-foot">
{statsLine}
<div className="pt-legend" aria-hidden="true">
<span>less</span>
{[0, 1, 2, 3, 4].map((l) => (
<span className={`pt-cell l${l}`} key={l} />
))}
<span>more</span>
</div>
</div>
</>
<p className="pt-note">Contribution activity is unavailable right now.</p>
)}
{grid}
{statsLine && <div className="pt-foot">{statsLine}</div>}
</div>
</div>
</section>
+26 -26
View File
@@ -23,18 +23,18 @@ export const profile = {
cvUrl: CV_URL,
heroTagline:
"I build software end to end — from React front ends and mobile apps to the servers, networks, and self-hosted infrastructure that run them.",
"I build software end to end, from React front ends and mobile apps to the servers, networks, and self-hosted infrastructure that run them.",
availability: "Open to graduate software engineering roles",
education: {
degree: "BSc Computer Science & Distributed Systems (Hons)",
degree: "BSc Computer Science (Hons)",
classification: "First Class (1:1)",
institution: "Kingston University",
},
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.",
],
};
@@ -50,36 +50,36 @@ export const stats = [
// Experience & education timeline, newest first.
export const experience = [
{
period: "2025 — Present",
period: "2025 - Present",
title: "Graduate Software Engineer",
org: "Open to roles · London / Remote",
detail:
"Seeking graduate and early-career software engineering roles. Open to full-time starts only.",
},
{
period: "Summers 2020 — 2026",
period: "Summers 2020 - 2026",
title: "Network Infrastructure Engineer (Volunteer)",
org: "Jalsa Salana UK · Ahmadiyya Muslim Association",
detail:
"Engineered a high-availability network for 20,000+ concurrent users with 99.9% uptime, automating hardware monitoring via custom Linux scripts; configured hardware and structured cabling across multi-site event environments, troubleshooting in real time under time-critical conditions.",
},
{
period: "Nov 2025 — Feb 2026",
period: "Nov 2025 - Feb 2026",
title: "Optical Assistant",
org: "Specsavers · London",
detail:
"Managed sensitive patient data systems with 100% accuracy in a high-volume clinical environment; advised customers on eyewear options and completed sales; fitted and adjusted spectacle frames with precision.",
},
{
period: "2025 — 2026",
title: "Final-Year Project — MASS",
period: "2025 - 2026",
title: "Final-Year Project: MASS",
org: "Kingston University",
detail:
"Built MASS (Media Aggregation & Sorting System), a cross-platform React Native app that aggregates media from device storage, Google Photos, and a home NAS into one timeline view, backed by a RESTful Express.js backend; cut data retrieval latency 30% via API caching.",
},
{
period: "2023 — 2026",
title: "BSc Computer Science (Hons) & Distributed Systems",
period: "2023 - 2026",
title: "BSc Computer Science (Hons)",
org: "Kingston University · First Class (1:1)",
detail:
"Coursework spanning web and mobile development, databases, networking, and systems programming, capped by the MASS final-year project.",
@@ -91,7 +91,7 @@ export const interests = [
{
name: "Self-hosting",
detail:
"If it can run on my own hardware, it probably does — a Proxmox host carrying a dozen services.",
"If it can run on my own hardware, it probably does, on a Proxmox host carrying a dozen services.",
},
{
name: "Local LLMs",
@@ -101,12 +101,12 @@ export const interests = [
{
name: "Hardware tinkering",
detail:
"Arduino projects and sensor experiments — the gyroscope treasure hunt started as one of those.",
"Arduino projects and sensor experiments; the gyroscope treasure hunt started as one of those.",
},
{
name: "Browser mods",
detail:
"Customising Floorp with an Opera GX–styled sidebar. Small UI details matter to me.",
"Customising Floorp with a sidebar styled after Opera GX. Small UI details matter to me.",
},
];
@@ -114,11 +114,11 @@ export const interests = [
// the highlight bullets; `stack` replaces the old tag list.
export const projects = [
{
title: "MASS — Media Aggregation & Sorting System",
title: "MASS: Media Aggregation & Sorting System",
year: "2026",
role: "Final-year project · Solo",
description:
"A cross-platform React Native app that aggregates media from multiple services — device storage, Google Photos, and a home NAS — into one timeline view, backed by a RESTful Express.js backend.",
"A cross-platform React Native app that aggregates media from device storage, Google Photos, and a home NAS into one timeline view, backed by a RESTful Express.js backend.",
features: [
"Reduced data retrieval latency 30% through optimized API caching",
"Metadata-driven sorting across diverse media types",
@@ -130,7 +130,7 @@ export const projects = [
highlight: true,
},
{
title: "Hardware Tinkering — 240 GHz Doppler Radar",
title: "Hardware Tinkering: 240 GHz Doppler Radar",
role: "Hardware project · ESP32",
description:
"A 240 GHz radio-frequency setup that uses the Doppler effect to track three moving targets, with an Arduino ESP32 board processing the sensor data and serving live results as a website.",
@@ -157,11 +157,11 @@ export const projects = [
repo: `https://github.com/${GITHUB_USER}/Treasure-Hunt-App`,
},
{
title: "CRUDL — React Native Demo",
title: "CRUDL: React Native Demo",
year: "2024",
role: "University project",
description:
"A full CRUD(L) application built to learn React Native properly — create, read, update, delete, and list flows across screens.",
"A full CRUD(L) application built to learn React Native properly: create, read, update, delete, and list flows across screens.",
features: [
"Complete CRUD(L) flows across multiple screens",
"Navigation between list, detail, and edit views",
@@ -217,7 +217,7 @@ export const projects = [
year: "2022",
role: "Personal project · Desktop",
description:
"A desktop CV builder written in Java with a Swing interface — form-driven editing that generates a clean, printable CV.",
"A desktop CV builder written in Java with a Swing interface: form-driven editing that generates a clean, printable CV.",
features: [
"Form-driven editing of CV sections",
"Live preview before export",
@@ -232,7 +232,7 @@ export const githubRepos = [
{
name: "Abstracted-MASS-PublicVer",
description:
"Public version of my final-year project — a media aggregation & sorting app across device storage, Google Photos, and a home NAS.",
"Public version of my final-year project: a media aggregation & sorting app across device storage, Google Photos, and a home NAS.",
language: "JavaScript",
stars: 1,
url: `https://github.com/${GITHUB_USER}/Abstracted-MASS-PublicVer`,
@@ -248,7 +248,7 @@ export const githubRepos = [
{
name: "MAD-Treasure-Hunt",
description:
"GPS and proximity-driven React Native treasure hunt built for my mobile development coursework — players claim hidden caches from physical location.",
"GPS and proximity-driven React Native treasure hunt built for my mobile development coursework; players claim hidden caches from physical location.",
language: "JavaScript",
stars: 0,
url: `https://github.com/${GITHUB_USER}/MAD-Treasure-Hunt`,
@@ -256,14 +256,14 @@ export const githubRepos = [
{
name: "Kotlin-TB2P1",
description:
"Native Android habit tracker in Kotlin — MVVM architecture, Room persistence, and reminder notifications.",
"Native Android habit tracker in Kotlin: MVVM architecture, Room persistence, and reminder notifications.",
language: "Kotlin",
stars: 0,
url: `https://github.com/${GITHUB_USER}/Kotlin-TB2P1`,
},
{
name: "Project-MAD-crudler",
description: "University project for learning React Native — a CRUD(L) demo app.",
description: "University project for learning React Native: a CRUD(L) demo app.",
language: "JavaScript",
stars: 0,
url: `https://github.com/${GITHUB_USER}/Project-MAD-crudler`,
@@ -277,7 +277,7 @@ export const githubRepos = [
},
{
name: "Opera-GX-Styled-Floorp-Sidebar",
description: "Opera GX–styled sidebar mod for the Floorp browser.",
description: "Sidebar mod for the Floorp browser, styled after Opera GX.",
language: "CSS",
stars: 0,
url: `https://github.com/${GITHUB_USER}/Opera-GX-Styled-Floorp-Sidebar`,
@@ -329,7 +329,7 @@ export const skills = {
export const homelab = [
{ name: "Proxmox", detail: "Single-node hypervisor running the whole stack" },
{ name: "Jellyfin + own media server", detail: "Self-hosted streaming — media server WIP" },
{ name: "Jellyfin + own media server", detail: "Self-hosted streaming (media server WIP)" },
{ name: "SearXNG", detail: "Private metasearch engine" },
{ name: "Dockhand", detail: "Container management UI" },
{ name: "Nginx", detail: "Reverse proxy for the house network" },
@@ -348,7 +348,7 @@ export const homelab = [
export const localAI = {
heading: "Local AI, on my own hardware",
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 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.",
"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.",
],
};
+5
View File
@@ -597,6 +597,11 @@ a {
padding: 28px;
}
.pt-scroll {
overflow-x: auto;
padding-bottom: 4px;
}
.pt-grid {
display: flex;
gap: 3px;