Files
portfolio/tools/build.py
T

91 lines
19 KiB
Python

"""Generate the public portfolio and its Gitea homepage from reviewed content.
Standard library only. This tool never reads application profiles or credentials.
"""
from pathlib import Path
import html
import json
import shutil
import textwrap
ROOT = Path(__file__).resolve().parents[1]
DATA = json.loads((ROOT / "content.json").read_text(encoding="utf-8"))
OUT = ROOT / "dist"
ASSETS = OUT / "assets" / "portfolio"
DEPLOY = ROOT / "deploy"
CASES = ROOT / "case-studies"
BASE = "/assets/portfolio"
REPO = "https://code.knickqueue.win/publish-bot/portfolio"
VERSION = "20261016-1"
def esc(value): return html.escape(str(value), quote=True)
def paragraphs(values): return "".join(f"<p>{esc(value)}</p>" for value in values)
def tags(values): return '<div class="tags">' + ''.join(f'<span>{esc(value)}</span>' for value in values) + '</div>'
def case_url(project): return f"{BASE}/case-studies/{project['id']}.html"
def link(url, label, css=""): return f'<a class="{css}" href="{esc(url)}">{esc(label)}</a>'
for folder in (ASSETS / "images", ASSETS / "diagrams", ASSETS / "case-studies", DEPLOY, CASES):
folder.mkdir(parents=True, exist_ok=True)
for file in ("portfolio.css", "portfolio.js"):
shutil.copy2(ROOT / "site" / file, ASSETS / file)
for file in (ROOT / "assets" / "images").glob("*"):
shutil.copy2(file, ASSETS / "images" / file.name)
DIAGRAMS = {
"centra-tab": ("Encrypted cross-device clipboard", ["Desktop / Android", "Encrypted outbox", "Private hub", "Peer history"], ["Capture locally", "Persist through outages", "Store ciphertext", "Reconcile generations"], "Workspace keys stay on clients · stable identity through recovery"),
"repo-relay": ("Reviewed publication boundary", ["Private snapshot", "Immutable review", "Public commit", "Verified release"], ["Pinned source revision", "Profile + file hashes", "Separate public history", "Anonymous clone + hashes"], "Approval expires when bytes or policy change · durable worker state"),
"remoraid": ("Session-bound actions and response receipts", ["Authenticated client", "Session / relay", "Target action", "Result journal"], ["Request identity", "Lease + capability checks", "Fresh foreground / screen", "Persist before delivery"], "Lost delivery ≠ permission to repeat a mutation"),
"nfcauth": ("Windows authentication and recovery boundaries", ["Signed authority", "SYSTEM service", "Credential provider", "User companion"], ["Issue approved grants", "Validate local policy", "Windows sign-in boundary", "Interactive session status"], "Protected local communication · SCM and companion supervision")
}
def diagram(key):
title, names, detail, note = DIAGRAMS[key]
blocks = []
for i, (name, sub) in enumerate(zip(names, detail)):
x,y = [(25,90),(320,90),(320,205),(25,205)][i]
blocks.append(f'<rect x="{x}" y="{y}" width="255" height="95" rx="7" fill="#1a2b36" stroke="#55717d"/><text x="{x+15}" y="{y+23}" fill="#9ae4f0" font-size="12">0{i+1}</text><text x="{x+15}" y="{y+51}" fill="#edf4f8" font-size="18">{esc(name)}</text><text x="{x+15}" y="{y+76}" fill="#a2b1bc" font-size="13">{esc(sub)}</text>')
arrows='<path d="M286 137h25m-6-6 6 6-6 6M447 191v8m-5-5 5 5 5-5M311 252h-25m6-6-6 6 6 6" stroke="#9ae4f0" stroke-width="2" fill="none"/>'
note_lines=''.join(f'<text x="25" y="{328+i*18}" fill="#a2b1bc" font-size="12">{esc(line)}</text>' for i,line in enumerate(textwrap.wrap(note,width=83)))
return f'<svg xmlns="http://www.w3.org/2000/svg" width="600" height="365" viewBox="0 0 600 365" role="img" aria-labelledby="title desc"><title id="title">{esc(title)}</title><desc id="desc">{esc(" → ".join(names)+". "+note)}</desc><rect width="600" height="365" fill="#13202a"/><g font-family="Segoe UI,Arial,sans-serif"><text x="25" y="31" fill="#9ae4f0" font-size="10" letter-spacing="2">SYSTEM OVERVIEW</text><text x="25" y="61" fill="#edf4f8" font-size="20">{esc(title)}</text>{"".join(blocks)}{arrows}{note_lines}</g></svg>'
for project in DATA["projects"]:
(ASSETS / "diagrams" / project["diagram"]).write_text(diagram(project["id"]), encoding="utf-8", newline="\n")
def masthead(home=False):
prefix = "" if home else "/"
return f'''<div class="wrap"><header class="masthead"><a class="identity" href="/" aria-label="Nicholas Quandt home"><span class="monogram" aria-hidden="true">NQ</span><span><strong>Nicholas Quandt</strong><small>Software &amp; systems engineering</small></span></a><nav aria-label="Portfolio"><a href="{prefix}#work">Work</a><a href="{prefix}#approach">Approach</a><a href="{prefix}#about">About</a><a class="nav-contact" href="mailto:{DATA['email']}">Get in touch ↗</a></nav></header></div>'''
def footer():
return f'''<div class="wrap"><footer><span>© 2026 Nicholas Quandt · Built and operated on my own infrastructure.</span><span>{link(REPO,'Portfolio source')} · {link(DATA['github'],'GitHub')} · {link(DATA['linkedin'],'LinkedIn')}</span></footer></div>'''
def document(title, description, body, canonical):
return f'''<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{esc(title)} · Nicholas Quandt</title><meta name="description" content="{esc(description)}"><meta name="author" content="Nicholas Quandt"><link rel="canonical" href="{esc(canonical)}"><meta property="og:title" content="{esc(title)} · Nicholas Quandt"><meta property="og:description" content="{esc(description)}"><meta property="og:type" content="website"><meta property="og:url" content="{esc(canonical)}"><meta property="og:image" content="https://code.knickqueue.win{BASE}/images/social.png"><meta name="twitter:card" content="summary_large_image"><link rel="icon" href="{BASE}/images/mark.svg" type="image/svg+xml"><link rel="stylesheet" href="{BASE}/portfolio.css?v={VERSION}"><script src="{BASE}/portfolio.js?v={VERSION}" defer></script></head><body class="portfolio"><a class="skip" href="#main">Skip to content</a>{body}</body></html>'''
rows = []
for i, project in enumerate(DATA["projects"], 1):
rows.append(f'''<article class="project-row"><span class="project-number">0{i}</span><div><p class="project-category">{esc(project['category'])}</p><h3>{link(case_url(project),project['name'])}</h3><p class="project-headline">{esc(project['headline'])}</p><p class="project-description">{esc(project['summary'])}</p><span class="status-tag">{esc(project['status'])}</span>{tags(project['technologies'])}{link(case_url(project),'Read the case study →','project-link')}</div><a class="diagram-frame" href="{case_url(project)}" aria-label="Read the {esc(project['name'])} case study"><img src="{BASE}/diagrams/{project['diagram']}" alt="{esc(DIAGRAMS[project['id']][0])}" width="600" height="365" loading="lazy"></a></article>''')
tools = ''.join(f'''<article class="tool"><h3>{esc(item['name'])}</h3><span class="status-tag">{esc(item['status'])}</span><p>{esc(item['description'])}</p><span class="tagline">{esc(item['tag'])}</span>{link(item['url'],'Source & releases ↗','project-link')}</article>''' for item in DATA['tools'])
lab = ''.join(f'''<article class="lab"><h3>{esc(item['name'])}</h3><span class="status-tag">{esc(item['status'])}</span><p>{esc(item['description'])}</p>{link(item['url'],'Explore the source ↗','project-link') if item.get('url') else ''}</article>''' for item in DATA['lab'])
source_links = ''.join(f'<a data-repo="{esc(item[0])}" href="https://code.knickqueue.win/publish-bot/{esc(item[0])}">{esc(item[1])}<span>{esc(item[2])}</span></a>' for item in [("portfolio","Portfolio source","Python / HTML / CSS"),("UniClik","UniClik","C#"),("WindowsVolumeSteps","WindowsVolumeSteps","C++"),("ats-native-fsd","ATS native simulator controller","Python")])
HOME = f'''{masthead(True)}<main id="main"><div class="wrap"><section class="hero" aria-labelledby="hero-title"><div><p class="eyebrow">Nicholas Quandt / selected engineering work</p><h1 id="hero-title">Desktop software.<br>Connected devices.<br><em>Resilient systems.</em></h1><p class="intro">I build desktop tools, device integrations and self-hosted platforms. My focus is reliable state, clear boundaries and recovery when something goes wrong.</p><div class="actions"><a class="button primary" href="#work">Explore selected work ↓</a>{link(DATA['resume'],'View résumé ↗','text-link')}</div></div><div class="hero-visual"><div class="window-label"><span>01 / CENTRA TAB</span><span class="online">ENCRYPTED ON YOUR DEVICES</span></div><a class="product-frame" href="{case_url(DATA['projects'][0])}" aria-label="Explore Centra Tab"><img src="{BASE}/images/centra-history.png" width="1164" height="751" alt="Centra Tab's native Windows interface with synthetic clipboard test entries"></a><div class="hero-caption"><span>Native Windows UI · synthetic test entries</span><span>Desktop ↔ hub ↔ phone</span></div></div></section><div class="signal-strip"><div><strong>Build across boundaries</strong><span>Windows, Linux, macOS and Android</span></div><div><strong>Make failure observable</strong><span>Receipts, durable queues and recovery</span></div><div><strong>Ship the whole system</strong><span>Packaging, deployment and verification</span></div></div><section class="content-section" id="work" aria-labelledby="work-title"><div class="section-heading"><div><p class="eyebrow">01 / selected work</p><h2 id="work-title">Four systems. Four engineering stories.</h2></div><p>What I built, the decisions behind it, and the evidence that supports each result.</p></div>{''.join(rows)}</section></div><section class="approach content-section" id="approach" aria-labelledby="approach-title"><div class="wrap"><div class="section-heading"><div><p class="eyebrow">02 / how I work</p><h2 id="approach-title">The difficult part is the boundary.</h2></div><p>Between a device and its service. Between a saved setting and a restart. Between an upload and a verified release.</p></div><div class="principles"><article><span class="eyebrow">01</span><h3>Preserve identity and intent</h3><p>A temporary failure should not create a new workspace or repeat an action. I make ownership, pending work and uncertain outcomes explicit.</p></article><article><span class="eyebrow">02</span><h3>Build a recovery path</h3><p>Durable state, bounded workers, atomic replacement and intentional maintenance behavior are part of the design from the beginning.</p></article><article><span class="eyebrow">03</span><h3>Keep the evidence specific</h3><p>Source tests, installed behavior and physical-device trials establish different things. My case studies state the conditions and limits of the result.</p></article></div></div></section><div class="wrap"><section class="content-section" aria-labelledby="tools-title"><div class="section-heading"><div><p class="eyebrow">03 / useful tools</p><h2 id="tools-title">Small problems, complete deliveries.</h2></div><p>Public source and downloadable releases. Each repository documents its own setup, license and current status.</p></div><div class="tools-grid">{tools}</div></section><section class="content-section" aria-labelledby="lab-title"><div class="section-heading"><div><p class="eyebrow">04 / engineering experiments</p><h2 id="lab-title">Room to investigate.</h2></div><p>Systems work exploring control, agent behavior and local inference. Experimental status is part of the story.</p></div><div class="lab-grid">{lab}</div><p class="context-note">Additional work includes a FUTO keyboard fork (NuBoard), vehicle-protocol investigation in an upstream fork, and a now-retired updater for third-party creative tools. Those contributions have their own ownership and validation boundaries.</p></section><section class="content-section" id="about" aria-labelledby="about-title"><div class="about-grid"><div><p class="eyebrow">05 / background</p><h2 id="about-title">Software informed by operations.</h2></div><div><p>My background spans systems escalation, Microsoft cloud environments, deployment automation and platform engineering. That experience shapes the software I build: configuration has to survive upgrades, a failed service needs a recovery path, and a release should be inspectable.</p><p>As <strong>co-founder and platform engineer at Fur-Ever.Club</strong>, I built its containerized platform and deployment workflows. The product is operating in beta. The work connects Linux, Docker, Next.js, FastAPI, PostgreSQL/PostGIS, Redis, payments and operational monitoring.</p><p>Based in <strong>Port Saint Lucie, Florida</strong>. Remote preferred; open to relocation.</p><div class="actions">{link(DATA['resume'],'Résumé & experience ↗','button')}{link(DATA['linkedin'],'LinkedIn ↗','text-link')}</div></div></div></section><section class="content-section" aria-labelledby="source-title"><div class="section-heading"><div><p class="eyebrow">06 / public code</p><h2 id="source-title">Inspect the work.</h2></div>{link('https://code.knickqueue.win/explore/repos','Browse every public repository ↗','text-link')}</div><div class="public-source-list" data-public-source>{source_links}</div></section><section class="contact-panel" aria-labelledby="contact-title"><div><p class="eyebrow">Let's talk</p><h2 id="contact-title">Building something that needs to hold up?</h2><p>I'm interested in software, systems and platform engineering opportunities.</p></div>{link('mailto:'+DATA['email'],'Get in touch ↗','button primary')}</section></div></main>{footer()}'''
(OUT / "index.html").write_text(document("Software & systems engineering", "Nicholas Quandt's selected software and systems work: encrypted desktop sync, release infrastructure, device control and Windows authentication.", HOME, "https://code.knickqueue.win/"), encoding="utf-8", newline="\n")
(DEPLOY / "home.tmpl").write_text('{{template "base/head" .}}\n<link rel="stylesheet" href="'+BASE+'/portfolio.css?v='+VERSION+'">\n<div class="portfolio"><a class="skip" href="#main">Skip to portfolio content</a>'+HOME+'</div>\n<script src="'+BASE+'/portfolio.js?v='+VERSION+'" defer></script>\n{{template "base/footer" .}}\n', encoding="utf-8", newline="\n")
def markdown(project):
text = f"# {project['name']}\n\n**{project['headline']}**\n\n{project['summary']}\n\nStatus: {project['status']}. Evidence reviewed {DATA['reviewed']}.\n\n[Read the illustrated case study](https://code.knickqueue.win{case_url(project)})\n\n## My contribution\n\n{project['contribution']}\n\n## The problem\n\n" + '\n\n'.join(project['problem']) + '\n\n## Engineering decisions\n\n'
for decision in project['decisions']: text += f"### {decision['title']}\n\n{decision['text']}\n\n"
text += f"## A failure that shaped the design\n\n{project['failure']}\n\n## Evidence and scope\n\n"
for evidence in project['evidence']: text += f"- **{evidence['label']}:** {evidence['result']} Scope: {evidence['scope']}\n"
text += '\nThese are reviewed recorded results, unless explicitly described as current public-access verification. Application tests and physical-device checks were not rerun for this portfolio.\n\n## Remaining limits\n\n' + '\n'.join('- '+item for item in project['limits']) + '\n\n## Evidence references\n\n' + '\n'.join('- '+item for item in project['references']) + f"\n\nRevision: `{project['revision']}`\n\n{project['sourceStatus']}\n"
for item in project['links']: text += f"\n[{item['label']}]({item['url']})\n"
return text
for index, project in enumerate(DATA['projects']):
sections = ['problem','contribution','decisions','failure','evidence','walkthrough','limits','references']
labels = ['The problem','My contribution','Engineering decisions','A useful failure','Evidence','Recovery walkthrough','Remaining limits','References']
toc = ''.join(f'<a href="#{key}">{label}</a>' for key,label in zip(sections,labels))
evidence = ''.join(f'<tr><td><strong>{esc(item["label"])}</strong></td><td>{esc(item["result"])}</td><td>{esc(item["scope"])}</td></tr>' for item in project['evidence'])
decisions = ''.join(f'<h3>{esc(item["title"])}</h3><p>{esc(item["text"])}</p>' for item in project['decisions'])
walkthrough = ''.join(f'<li><span class="step-number">0{i+1}</span><h3>{esc(item["title"])}</h3><p>{esc(item["text"])}</p></li>' for i,item in enumerate(project['walkthrough']))
next_project = DATA['projects'][(index+1)%len(DATA['projects'])]
body = f'''{masthead()}<main id="main" class="wrap"><header class="case-hero"><p class="breadcrumb">{link('/#work','Selected work')} / {esc(project['name'])}</p><p class="eyebrow">{esc(project['category'])}</p><h1>{esc(project['headline'])}</h1><p class="intro">{esc(project['summary'])}</p><div class="case-meta"><span>{esc(project['status'])}</span><span>Evidence reviewed {DATA['reviewed']}</span></div>{tags(project['technologies'])}</header><div class="case-overview diagram-frame"><img src="{BASE}/diagrams/{project['diagram']}" width="600" height="365" alt="{esc(DIAGRAMS[project['id']][0])}"></div><div class="case-layout"><nav class="case-toc" aria-label="Case study sections">{toc}</nav><article class="article"><section id="problem"><h2>The problem</h2>{paragraphs(project['problem'])}</section><section id="contribution"><h2>My contribution</h2><p>{esc(project['contribution'])}</p></section><section id="decisions"><h2>Engineering decisions</h2>{decisions}</section><section id="failure"><h2>A failure that shaped the design</h2><p>{esc(project['failure'])}</p></section><section id="evidence"><h2>Evidence and scope</h2><p class="scope-note">These are reviewed recorded results unless explicitly described as current public-access verification. Application tests and physical-device checks were not rerun for this portfolio.</p><table class="evidence-table"><thead><tr><th>Check</th><th>Recorded result</th><th>Conditions & limits</th></tr></thead><tbody>{evidence}</tbody></table></section><section id="walkthrough"><h2>Walk through the recovery path</h2><p class="scope-note">An illustrated explanation of the design. This is not a live application or a recording of a device trial.</p><div data-walkthrough><ol class="walkthrough">{walkthrough}</ol><button class="button" type="button" hidden>Start walkthrough →</button><div class="walk-status" role="status" aria-live="polite"></div></div></section><section id="limits"><h2>Remaining limits</h2><ul>{''.join('<li>'+esc(item)+'</li>' for item in project['limits'])}</ul></section><section id="references"><h2>Evidence references</h2><p class="scope-note">These filenames identify the source and acceptance records used to prepare this write-up. Private application files are not published as part of the portfolio.</p><ul class="references">{''.join('<li>'+esc(item)+'</li>' for item in project['references'])}</ul><p class="project-revision">Revision: {esc(project['revision'])}</p><p class="source-note">{esc(project['sourceStatus'])}</p><div class="actions">{''.join(link(item['url'],item['label']+' ↗','button') for item in project['links'])}{link(REPO+'/src/branch/main/case-studies/'+project['id']+'.md','Markdown version ↗','text-link')}</div></section><div class="case-end">{link('/#work','← All selected work')}{link(case_url(next_project),'Next: '+next_project['name']+' →')}</div></article></div></main>{footer()}'''
(ASSETS / "case-studies" / (project['id']+'.html')).write_text(document(project['name'],project['summary'],body,'https://code.knickqueue.win'+case_url(project)),encoding="utf-8",newline="\n")
(CASES / (project['id']+'.md')).write_text(markdown(project),encoding="utf-8",newline="\n")
print(f"Built homepage, {len(DATA['projects'])} case studies and {len(DIAGRAMS)} diagrams in {OUT}")