commit b2cd67e74f0064d98181b262935bf3e8fa59aa70 Author: Johan Sandoval Date: Thu Oct 8 14:41:39 2026 +0000 Initial portfolio site Astro + React islands + MDX with a theme system (terminal, concrete, nostromo, overgrowth), USMT Dash case study, work/log/sound/models/about/ contact pages, RSS, self-hosted contact form over SMTP, /media proxy to Nextcloud, Dockerfile for Coolify, and a GitHub Action that mirrors main to Gitea. diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6a254f9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +node_modules +dist +.astro +.git +.github +.env +.env.* +!.env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..23950c9 --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +# ---- Runtime (set these in Coolify → Environment Variables) ---- + +# Where /media/* is proxied from. Point it at a public Nextcloud share's WebDAV root: +# https://cloud.example.com/public.php/dav/files/ +# (Nextcloud: share a folder → "Share link" → the token is the last part of the link.) +MEDIA_ORIGIN= + +# Contact form → SMTP +SMTP_HOST= +SMTP_PORT=587 +SMTP_SECURE=false +SMTP_USER= +SMTP_PASS= +CONTACT_TO=contact@mail.yoyos.sh +CONTACT_FROM="yoyos.sh " diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 0000000..323159b --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,43 @@ +name: Mirror to Gitea + +# Pushes every commit on main to the Gitea repo as-is (same hashes, authors and +# dates), which in turn triggers the Coolify deploy. +# +# Repo secrets: +# GITEA_URL - https://gitea.yoyos.sh/yoyos/yoyos.sh.git +# GITEA_TOKEN - Gitea access token with write:repository + +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: mirror-gitea + cancel-in-progress: false + +jobs: + mirror: + # This file is mirrored too; never run it on Gitea's own runner. + if: github.server_url == 'https://github.com' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Push main to Gitea + env: + GITEA_URL: ${{ secrets.GITEA_URL }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -euo pipefail + if [ -z "${GITEA_URL}" ] || [ -z "${GITEA_TOKEN}" ]; then + echo "::error::GITEA_URL and GITEA_TOKEN secrets must be set" + exit 1 + fi + url="${GITEA_URL%/}" + scheme="${url%%://*}" + rest="${url#*://}" + case "$url" in *://*) ;; *) scheme=https; rest="$url" ;; esac + git push --force "${scheme}://${GITEA_TOKEN}:x-oauth-basic@${rest}" HEAD:refs/heads/main diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b24c71f --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# build output +dist/ +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* + +# environment +.env +.env.* +!.env.example + +# os / editor +.DS_Store +.vscode/* +!.vscode/extensions.json +.idea/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e41811 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# syntax=docker/dockerfile:1 + +# ---- deps ---- +FROM node:22-slim AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci + +# ---- build ---- +FROM deps AS build +COPY . . +RUN npm run build && npm prune --omit=dev + +# ---- runtime ---- +FROM node:22-slim AS runtime +WORKDIR /app +ENV NODE_ENV=production \ + HOST=0.0.0.0 \ + PORT=4321 +COPY --from=build --chown=node:node /app/node_modules ./node_modules +COPY --from=build --chown=node:node /app/dist ./dist +COPY --from=build --chown=node:node /app/package.json ./package.json +USER node +EXPOSE 4321 +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD node -e "fetch('http://127.0.0.1:'+process.env.PORT+'/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" +CMD ["node", "./dist/server/entry.mjs"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..ef2d499 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# yoyos.sh + +Portfolio, project archive and weekly log of Johan Sandoval. + +**Stack:** Astro (static pages + a small Node server) · React islands · MDX · plain CSS · +Docker on Coolify. Large media lives on the NAS (Nextcloud) and is proxied through `/media`. + +```bash +npm install +npm run dev # http://localhost:4321 +npm run build && npm start +``` + +## Deploy pipeline + +``` +push to GitHub main ──(.github/workflows/mirror.yml)──▶ Gitea yoyos/yoyos.sh ──▶ Coolify (Dockerfile) ──▶ yoyos.sh +``` + +- GitHub repo secrets: `GITEA_URL` (`https://gitea.yoyos.sh/yoyos/yoyos.sh.git`), `GITEA_TOKEN`. +- Coolify: Dockerfile build pack, port **4321**, health check `/healthz`. +- Coolify environment variables: see `.env.example` (`MEDIA_ORIGIN`, `SMTP_*`, `CONTACT_*`). + +## Adding content + +| What | Where | +|---|---| +| Project | `src/content/work/.md(x)` or `src/content/work//index.mdx` with images next to it | +| Log post | `src/content/log/.md(x)` (`draft: true` hides it in production) | +| Recording | `src/content/sound/.yaml` + audio file in the media share under `sound/` | +| 3D model | `src/content/models/.yaml` + `.glb` in the media share under `models/` | +| Game | add a `game:` block to a project + web export in the media share under `games//` → playable at `/play/` | +| Personal info, links, availability | `src/lib/site.ts` | + +Every field is typed in `src/content.config.ts`, so the build fails loudly when something's missing. + +## Styling + +- `src/styles/tokens.css`: raw palette (ink, cream, emerald, rust, peat), type scale, spacing. +- `src/styles/themes/*.css`: each theme maps the palette onto semantic tokens (`--bg`, `--fg`, + `--accent`, `--signal`, `--line`, fonts, grain, scanlines). Current themes: `terminal` (default), + `concrete`, `nostromo`, `overgrowth`. +- Use a theme on a whole page: ``, or `theme: concrete` in a project or post's frontmatter. +- Use a theme on one section: `
`. +- New theme: copy a theme file, rename the selector, import it in `themes/index.css`, and add the name to `src/lib/themes.ts`. +- One-off page styling: the page's own ` diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..067b607 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,68 @@ +--- +import { SITE } from '../lib/site'; +const year = new Date().getFullYear(); +const links = Object.entries(SITE.links).filter(([, href]) => !href.includes('PLACEHOLDER')); +--- + + + + diff --git a/src/components/Gallery.astro b/src/components/Gallery.astro new file mode 100644 index 0000000..4285278 --- /dev/null +++ b/src/components/Gallery.astro @@ -0,0 +1,18 @@ +--- +interface Props { + min?: string; +} +const { min = '18rem' } = Astro.props; +--- + + + + diff --git a/src/components/ModelViewer.astro b/src/components/ModelViewer.astro new file mode 100644 index 0000000..b9b342d --- /dev/null +++ b/src/components/ModelViewer.astro @@ -0,0 +1,80 @@ +--- +/** + * Drop-in 3D viewer for .glb/.gltf files using (three.js under + * the hood). For custom scenes, write a React Three Fiber island instead. + */ +interface Props { + src: string; + alt: string; + poster?: string; + ratio?: string; +} +const { src, alt, poster, ratio = '16 / 10' } = Astro.props; +--- + +
+ + +
+
+ Drag to orbit · scroll to zoom +
+ + + + diff --git a/src/components/Nav.astro b/src/components/Nav.astro new file mode 100644 index 0000000..ac89909 --- /dev/null +++ b/src/components/Nav.astro @@ -0,0 +1,151 @@ +--- +import { NAV, SITE } from '../lib/site'; +const path = Astro.url.pathname; +const isActive = (href: string) => path === href || path.startsWith(href + '/'); +--- + +
+ +
+ + diff --git a/src/components/ProjectCard.astro b/src/components/ProjectCard.astro new file mode 100644 index 0000000..2a4ee98 --- /dev/null +++ b/src/components/ProjectCard.astro @@ -0,0 +1,133 @@ +--- +import { Image } from 'astro:assets'; +import type { CollectionEntry } from 'astro:content'; + +interface Props { + project: CollectionEntry<'work'>; + index?: number; + large?: boolean; +} +const { project, index, large = false } = Astro.props; +const { title, summary, disciplines, cover, coverAlt, status, date, placeholder } = project.data; +const fileNo = String(index ?? 0).padStart(3, '0'); +--- + + + + diff --git a/src/components/SectionHead.astro b/src/components/SectionHead.astro new file mode 100644 index 0000000..86bd17a --- /dev/null +++ b/src/components/SectionHead.astro @@ -0,0 +1,49 @@ +--- +interface Props { + code: string; + title: string; + href?: string; + linkLabel?: string; +} +const { code, title, href, linkLabel = 'View all' } = Astro.props; +--- + +
+ // {code} +

{title}

+ + {href && {linkLabel} →} +
+ + diff --git a/src/content.config.ts b/src/content.config.ts new file mode 100644 index 0000000..7caf11d --- /dev/null +++ b/src/content.config.ts @@ -0,0 +1,90 @@ +import { defineCollection } from 'astro:content'; +import { glob } from 'astro/loaders'; +import { z } from 'astro/zod'; +import { THEMES } from './lib/themes'; + +const theme = z.enum(THEMES).optional(); + +export const DISCIPLINES = ['software', 'web', 'game', 'hardware', '3d', 'music'] as const; + +/** + * Projects. One .md/.mdx file per project in src/content/work/. + * Folder-style entries (work/my-thing/index.mdx) can keep their images alongside. + */ +const work = defineCollection({ + loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/work' }), + schema: ({ image }) => + z.object({ + title: z.string(), + summary: z.string(), + disciplines: z.array(z.enum(DISCIPLINES)).min(1), + stack: z.array(z.string()).default([]), + date: z.coerce.date(), + status: z.enum(['live', 'shipped', 'in-progress', 'archived']).default('shipped'), + role: z.string().optional(), + cover: image().optional(), + coverAlt: z.string().optional(), + links: z + .array(z.object({ label: z.string(), href: z.string() })) + .default([]), + // Playable build served from /media (see src/pages/play/[slug].astro) + game: z + .object({ + engine: z.enum(['godot', 'unity', 'web']), + // folder inside the media share, e.g. "games/my-game" + path: z.string(), + entry: z.string().default('index.html'), + aspect: z.string().default('16 / 9'), + }) + .optional(), + // .glb in the media share, shown with + model: z.string().optional(), + featured: z.boolean().default(false), + placeholder: z.boolean().default(false), + theme, + }), +}); + +/** Weekly log / blog. */ +const log = defineCollection({ + loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/log' }), + schema: ({ image }) => + z.object({ + title: z.string(), + summary: z.string(), + date: z.coerce.date(), + tags: z.array(z.string()).default([]), + cover: image().optional(), + coverAlt: z.string().optional(), + draft: z.boolean().default(false), + theme, + }), +}); + +/** Recordings. Audio files live in the media share under sound/. */ +const sound = defineCollection({ + loader: glob({ pattern: '**/*.{md,yaml,yml,json}', base: './src/content/sound' }), + schema: z.object({ + title: z.string(), + date: z.coerce.date(), + file: z.string(), + duration: z.string().optional(), + notes: z.string().optional(), + gear: z.array(z.string()).default([]), + }), +}); + +/** 3D models. .glb files live in the media share under models/. */ +const models = defineCollection({ + loader: glob({ pattern: '**/*.{md,yaml,yml,json}', base: './src/content/models' }), + schema: z.object({ + title: z.string(), + date: z.coerce.date(), + file: z.string(), + poster: z.string().optional(), + tools: z.array(z.string()).default([]), + notes: z.string().optional(), + }), +}); + +export const collections = { work, log, sound, models }; diff --git a/src/content/log/000-boot-sequence.md b/src/content/log/000-boot-sequence.md new file mode 100644 index 0000000..5749714 --- /dev/null +++ b/src/content/log/000-boot-sequence.md @@ -0,0 +1,14 @@ +--- +title: 'Transmission 000: Boot Sequence' +summary: Why this site exists, what it's built with, and what's going in the log each week. +date: 2026-10-08 +tags: [meta, site] +--- + +Placeholder for the first weekly log entry. + +This site is built with Astro, React islands and plain CSS. It runs in a Docker container on +my own Coolify server, and the heavy media (game builds, recordings, 3D models) is served +from my NAS. + +Each week I'll post what I worked on: code, builds, models and music. diff --git a/src/content/models/placeholder-model.yaml b/src/content/models/placeholder-model.yaml new file mode 100644 index 0000000..3d391bb --- /dev/null +++ b/src/content/models/placeholder-model.yaml @@ -0,0 +1,5 @@ +title: Placeholder Model +date: 2026-10-01 +file: models/placeholder.glb +tools: [Blender] +notes: Export from Blender as .glb (Draco compression on), upload under models/ in the media share. diff --git a/src/content/sound/placeholder-take.yaml b/src/content/sound/placeholder-take.yaml new file mode 100644 index 0000000..4371c7d --- /dev/null +++ b/src/content/sound/placeholder-take.yaml @@ -0,0 +1,5 @@ +title: Placeholder Take +date: 2026-10-01 +file: sound/placeholder-take.mp3 +notes: Upload an mp3/ogg/flac to the media share under sound/ and point `file` at it. +gear: [Guitar, Interface] diff --git a/src/content/work/chicago-in-3d.md b/src/content/work/chicago-in-3d.md new file mode 100644 index 0000000..2e406e0 --- /dev/null +++ b/src/content/work/chicago-in-3d.md @@ -0,0 +1,12 @@ +--- +title: Chicago in 3D +summary: An architectural tour of the city. Chicago landmarks modeled in Blender and explored in the browser, with the history and trivia for each building. +disciplines: [3d, web] +stack: [React, Three.js, Blender] +date: 2026-06-01 +status: in-progress +placeholder: true +theme: concrete +--- + +Placeholder. Write-up coming soon, with an interactive viewer for the city map. diff --git a/src/content/work/hardware-build.md b/src/content/work/hardware-build.md new file mode 100644 index 0000000..6526b96 --- /dev/null +++ b/src/content/work/hardware-build.md @@ -0,0 +1,12 @@ +--- +title: Hardware Build +summary: Placeholder for a physical engineering project, with photos, schematics and a build log. +disciplines: [hardware] +stack: [] +date: 2025-09-01 +status: shipped +placeholder: true +theme: concrete +--- + +Placeholder. diff --git a/src/content/work/homelab.md b/src/content/work/homelab.md new file mode 100644 index 0000000..74b7268 --- /dev/null +++ b/src/content/work/homelab.md @@ -0,0 +1,12 @@ +--- +title: Homelab Infrastructure +summary: Self-hosted file storage, budgeting, receipts and password management for family and friends, running on Docker, Podman and LXC on Proxmox. +disciplines: [software, hardware] +stack: [Proxmox, Docker, Podman, LXC, NixOS, Coolify, Gitea] +date: 2025-04-01 +status: live +placeholder: true +theme: nostromo +--- + +Placeholder. A write-up of the rack, the network and the services is coming soon. diff --git a/src/content/work/untitled-game.md b/src/content/work/untitled-game.md new file mode 100644 index 0000000..0b9238b --- /dev/null +++ b/src/content/work/untitled-game.md @@ -0,0 +1,16 @@ +--- +title: Untitled Game +summary: Placeholder for a Godot or Unity game. Once a web build is uploaded to the media share, it becomes playable right here. +disciplines: [game] +stack: [Godot] +date: 2026-01-01 +status: in-progress +placeholder: true +theme: overgrowth +# Uncomment when a web export is uploaded to /games/untitled-game/ +# game: +# engine: godot +# path: games/untitled-game +--- + +Placeholder. diff --git a/src/content/work/usmt-dash/architecture.png b/src/content/work/usmt-dash/architecture.png new file mode 100644 index 0000000..40406f1 Binary files /dev/null and b/src/content/work/usmt-dash/architecture.png differ diff --git a/src/content/work/usmt-dash/custom-view.png b/src/content/work/usmt-dash/custom-view.png new file mode 100644 index 0000000..a39b3ad Binary files /dev/null and b/src/content/work/usmt-dash/custom-view.png differ diff --git a/src/content/work/usmt-dash/device-details.png b/src/content/work/usmt-dash/device-details.png new file mode 100644 index 0000000..b3e1fef Binary files /dev/null and b/src/content/work/usmt-dash/device-details.png differ diff --git a/src/content/work/usmt-dash/documentation.png b/src/content/work/usmt-dash/documentation.png new file mode 100644 index 0000000..0a52abd Binary files /dev/null and b/src/content/work/usmt-dash/documentation.png differ diff --git a/src/content/work/usmt-dash/index.mdx b/src/content/work/usmt-dash/index.mdx new file mode 100644 index 0000000..bd6a0c9 --- /dev/null +++ b/src/content/work/usmt-dash/index.mdx @@ -0,0 +1,90 @@ +--- +title: USMT Dash +summary: A real-time migration dashboard over SCCM that took a six-person refresh team from about 10 builds a day to 25. PowerShell from end to end, with a live public demo. +disciplines: [software, web] +stack: [PowerShell, HttpListener, SQL (ConfigMgr), Active Directory, HTML/JS, Docker, Coolify] +date: 2026-08-01 +status: live +role: Sole developer · Technical lead +cover: ./overview.png +coverAlt: USMT Dash overview page showing issue counters, progress, a building and floor map and a deployment calendar. +featured: true +links: + - { label: Live demo, href: 'https://usmt.yoyos.sh' } + - { label: Source, href: 'https://gitea.yoyos.sh/yoyos/usmt-dash' } +--- + +import Figure from '../../../components/Figure.astro'; +import Gallery from '../../../components/Gallery.astro'; +import overview from './overview.png'; +import status from './usmt-status.png'; +import terminals from './terminals.png'; +import software from './missing-software.png'; +import custom from './custom-view.png'; +import details from './device-details.png'; +import docs from './documentation.png'; +import architecture from './architecture.png'; + +## The problem + +On a large hardware refresh, every old PC gets backed up with USMT, paired with its new +machine in ConfigMgr (SCCM), and restored. Checking a single device in the ConfigMgr console +took about **a minute**: is the association there, did the backup start, is the box even on +the network? On a 1,300-device refresh with a six-person team, those minutes added up to the +bottleneck. + +## What I built + +USMT Dash is one shared live view of the whole refresh. Every device answers in **under a +second**, and the overview page is built to drive the refresh's open issues to zero. + +
+ +It's **PowerShell from end to end**, with no web framework, database server or runtime +beyond PowerShell. That was deliberate: it had to run on locked-down hospital +infrastructure where installing a stack wasn't an option. + +- **Server:** a `System.Net.HttpListener` web server with a 17-route JSON API, IP allowlist and gzip. +- **Worker:** a polling loop that queries SCCM's SQL database, Active Directory, DNS/ICMP and admin shares, works out each device's state, and writes JSON. +- **Front end:** a single-file HTML/JS dashboard of about 4,600 lines, with routing, Excel-style filters, a knowledge base and a mobile card layout. + +
+ +## Details that mattered + +- **A smart status engine.** It combines ConfigMgr's `MigrationStatus` with whether the + USMT progress log is actively being written, so "in progress" means in progress. +- **Network checks that tell the truth.** It resolves *all* A records, pings each one and + validates reverse DNS, which separates *Online*, *Timed Out*, *Not Found* and *DNS Issue* + (a stale record pointing at a different machine). +- **Missing software.** It diffs installed software between the source and destination + machines, filters out the baseline image and groups suites, so a technician sees only the + specialty apps still left to install. +- **Live while it works.** Rows publish every few seconds during a sweep, newly tracked + devices go first, and the worker sleeps overnight with a midnight pitstop for the software + refresh. + + +
+
+
+
+
+
+ + +## The public demo + +The [hosted demo](https://usmt.yoyos.sh) runs the **unmodified** server and worker in a +container against a simulated 200-device fleet. A demo provider replaces the SCCM provider, +and that is the only difference. A simulated team tags, reschedules and fixes devices +through the day. Visitor changes stay in their own browser (IndexedDB) and the API is +read-only, so there is nothing to moderate or inject. It deploys from Gitea to Coolify like +everything else I host. + +## Outcome + +Shipped halfway through the Lurie Children's FY26 refresh. Daily builds went from roughly +**10 to 25**, and the project closed **about 1,900 machines against a 1,300-device scope**, +under budget. + diff --git a/src/content/work/usmt-dash/missing-software.png b/src/content/work/usmt-dash/missing-software.png new file mode 100644 index 0000000..b79a013 Binary files /dev/null and b/src/content/work/usmt-dash/missing-software.png differ diff --git a/src/content/work/usmt-dash/overview.png b/src/content/work/usmt-dash/overview.png new file mode 100644 index 0000000..a7c997a Binary files /dev/null and b/src/content/work/usmt-dash/overview.png differ diff --git a/src/content/work/usmt-dash/terminals.png b/src/content/work/usmt-dash/terminals.png new file mode 100644 index 0000000..8e5e97e Binary files /dev/null and b/src/content/work/usmt-dash/terminals.png differ diff --git a/src/content/work/usmt-dash/usmt-status.png b/src/content/work/usmt-dash/usmt-status.png new file mode 100644 index 0000000..d929026 Binary files /dev/null and b/src/content/work/usmt-dash/usmt-status.png differ diff --git a/src/content/work/xsport-booking.md b/src/content/work/xsport-booking.md new file mode 100644 index 0000000..0552a3c --- /dev/null +++ b/src/content/work/xsport-booking.md @@ -0,0 +1,12 @@ +--- +title: Trainer Booking Site +summary: A trainer booking site for XSport Fitness Gold Coast. It pulls open session times out of an HTML-only internal scheduler into browsable trainer profiles. Bookings rose 50% in the first month. +disciplines: [web] +stack: [React, Tailwind, Node.js] +date: 2023-05-01 +status: archived +role: Contract web developer +placeholder: true +--- + +Placeholder. The case study is coming soon. diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro new file mode 100644 index 0000000..9b031d4 --- /dev/null +++ b/src/layouts/Base.astro @@ -0,0 +1,97 @@ +--- +import { ClientRouter } from 'astro:transitions'; +import Nav from '../components/Nav.astro'; +import Footer from '../components/Footer.astro'; +import { SITE } from '../lib/site'; +import type { Theme } from '../lib/themes'; +import '../styles/global.css'; + +interface Props { + title?: string; + description?: string; + /** Any theme from src/styles/themes. Defaults to "terminal". */ + theme?: Theme; + /** Extra class on for page-level styling hooks. */ + bodyClass?: string; + image?: string; + type?: 'website' | 'article'; +} + +const { + title, + description = SITE.description, + theme = 'terminal', + bodyClass, + image, + type = 'website', +} = Astro.props; + +const fullTitle = title ? `${title} · ${SITE.name}` : SITE.title; +const canonical = new URL(Astro.url.pathname, Astro.site); +const ogImage = image ? new URL(image, Astro.site) : undefined; + +const person = { + '@context': 'https://schema.org', + '@type': 'Person', + name: SITE.name, + jobTitle: 'Software Engineer', + url: Astro.site?.href, + email: `mailto:${SITE.email}`, + address: { '@type': 'PostalAddress', addressLocality: 'Chicago', addressRegion: 'IL' }, + sameAs: Object.values(SITE.links).filter((l) => !l.includes('PLACEHOLDER')), +}; +--- + + + + + + + {fullTitle} + + + + + + + + + + + + {ogImage && } + + + diff --git a/src/pages/healthz.ts b/src/pages/healthz.ts new file mode 100644 index 0000000..cbcda57 --- /dev/null +++ b/src/pages/healthz.ts @@ -0,0 +1,2 @@ +export const prerender = false; +export const GET = () => new Response('ok'); diff --git a/src/pages/index.astro b/src/pages/index.astro new file mode 100644 index 0000000..a7c71ba --- /dev/null +++ b/src/pages/index.astro @@ -0,0 +1,234 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../layouts/Base.astro'; +import ProjectCard from '../components/ProjectCard.astro'; +import SectionHead from '../components/SectionHead.astro'; +import { SITE } from '../lib/site'; +import { DISCIPLINES } from '../content.config'; + +const work = (await getCollection('work')).sort((a, b) => +b.data.date - +a.data.date); +const featured = work.find((p) => p.data.featured) ?? work[0]; +const rest = work.filter((p) => p !== featured).slice(0, 3); +const posts = (await getCollection('log', ({ data }) => !data.draft)) + .sort((a, b) => +b.data.date - +a.data.date) + .slice(0, 3); + +const counts = Object.fromEntries( + DISCIPLINES.map((d) => [d, work.filter((p) => p.data.disciplines.includes(d)).length]), +); +const disciplineLabels: Record = { + software: 'Software & tools', + web: 'Web', + game: 'Games', + hardware: 'Hardware', + '3d': '3D modeling', + music: 'Music', +}; + +const fmt = (d: Date) => d.toISOString().slice(0, 10).replaceAll('-', '.'); +--- + + +
+ + +

+ Johan + Sandoval +

+ +
+

+ Software engineer who builds the tools other teams run on. Dashboards, automation and web apps, plus games, 3D models, hardware and music on the side. +

+ +
+
Role
+
{SITE.role}
+
Base
+
{SITE.location}
+
Status
+
+ {SITE.availability.text}_ +
+
Stack
+
TypeScript · Python · PowerShell · React · SQL · Docker
+
+
+ + +
+ +
+ + {featured && } +
+ {rest.map((p, i) => )} +
+
+ +
+ + +
+ +
+ +
    + { + posts.map((post) => ( +
  1. + + + {post.data.title} + {post.data.summary} + +
  2. + )) + } +
+
+ + + diff --git a/src/pages/log/[...slug].astro b/src/pages/log/[...slug].astro new file mode 100644 index 0000000..c92935b --- /dev/null +++ b/src/pages/log/[...slug].astro @@ -0,0 +1,66 @@ +--- +import { getCollection, render } from 'astro:content'; +import { Image } from 'astro:assets'; +import Base from '../../layouts/Base.astro'; + +export async function getStaticPaths() { + const posts = await getCollection('log', ({ data }) => import.meta.env.DEV || !data.draft); + return posts.map((post) => ({ params: { slug: post.id }, props: { post } })); +} + +const { post } = Astro.props; +const { Content } = await render(post); +const d = post.data; +const words = post.body?.split(/\s+/).length ?? 0; +const minutes = Math.max(1, Math.round(words / 230)); +--- + + +
+ ← All transmissions +
+

+ + · {minutes} min read + {d.tags.map((t) => {t})} +

+

{d.title}

+

{d.summary}

+
+ { + d.cover && ( + {d.coverAlt + ) + } +
+ +
+
+ + + diff --git a/src/pages/log/index.astro b/src/pages/log/index.astro new file mode 100644 index 0000000..24d1d44 --- /dev/null +++ b/src/pages/log/index.astro @@ -0,0 +1,87 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../../layouts/Base.astro'; + +const posts = (await getCollection('log', ({ data }) => import.meta.env.DEV || !data.draft)).sort( + (a, b) => +b.data.date - +a.data.date, +); +const fmt = (d: Date) => d.toISOString().slice(0, 10).replaceAll('-', '.'); +--- + + +
+

// 02 — Weekly log

+

Transmissions

+

+ What I'm building each week. Subscribe via RSS. +

+ +
    + { + posts.map((post, i) => ( +
  1. + + {String(posts.length - 1 - i).padStart(3, '0')} + + + {post.data.title} + {post.data.draft && draft} + + {post.data.summary} + +
  2. + )) + } +
+
+ + + diff --git a/src/pages/media/[...path].ts b/src/pages/media/[...path].ts new file mode 100644 index 0000000..c3d065a --- /dev/null +++ b/src/pages/media/[...path].ts @@ -0,0 +1,100 @@ +import type { APIRoute } from 'astro'; + +export const prerender = false; + +/** + * Streams files from the Nextcloud share on the NAS (MEDIA_ORIGIN) so they're + * served from yoyos.sh. Range requests pass through for audio/video seeking. + * + * MEDIA_ORIGIN example (public share, WebDAV): + * https://cloud.example.com/public.php/dav/files/ + */ +const PASS_HEADERS = [ + 'content-type', + 'content-length', + 'content-range', + 'accept-ranges', + 'etag', + 'last-modified', +]; + +const TYPES: Record = { + wasm: 'application/wasm', + pck: 'application/octet-stream', + glb: 'model/gltf-binary', + gltf: 'model/gltf+json', + mp3: 'audio/mpeg', + ogg: 'audio/ogg', + flac: 'audio/flac', + wav: 'audio/wav', + mp4: 'video/mp4', + webm: 'video/webm', + pdf: 'application/pdf', + js: 'text/javascript', + html: 'text/html; charset=utf-8', + data: 'application/octet-stream', +}; + +export const GET: APIRoute = async ({ params, request }) => { + const origin = (process.env.MEDIA_ORIGIN ?? import.meta.env.MEDIA_ORIGIN)?.replace(/\/+$/, ''); + if (!origin) return new Response('Media storage not configured', { status: 503 }); + + const path = params.path ?? ''; + if (!path || path.split('/').some((seg) => seg === '..' || seg === '.')) { + return new Response('Not found', { status: 404 }); + } + + const upstreamHeaders: HeadersInit = {}; + const range = request.headers.get('range'); + if (range) upstreamHeaders['range'] = range; + const inm = request.headers.get('if-none-match'); + if (inm) upstreamHeaders['if-none-match'] = inm; + + const encoded = path.split('/').map(encodeURIComponent).join('/'); + let upstream: Response; + try { + upstream = await fetch(`${origin}/${encoded}`, { headers: upstreamHeaders, redirect: 'follow' }); + } catch { + return new Response('Media storage unreachable', { status: 502 }); + } + if (upstream.status === 404 || upstream.status === 403) { + return new Response('Not found', { status: 404 }); + } + + const headers = new Headers(); + for (const h of PASS_HEADERS) { + const v = upstream.headers.get(h); + if (v) headers.set(h, v); + } + // fetch() transparently decodes transport compression, so the upstream length no longer applies. + if (upstream.headers.get('content-encoding')) headers.delete('content-length'); + + const name = path.split('/').pop()!; + let ext = name.split('.').pop()!.toLowerCase(); + + // Unity pre-compressed builds: foo.wasm.br / foo.data.gz + const compressed = ext === 'br' ? 'br' : ext === 'gz' ? 'gzip' : undefined; + if (compressed) { + headers.set('content-encoding', compressed); + ext = name.split('.').slice(-2, -1)[0]?.toLowerCase() ?? ext; + } + if (TYPES[ext]) headers.set('content-type', TYPES[ext]); + + // Game builds may need cross-origin isolation (Godot threaded exports). + if (path.startsWith('games/')) { + headers.set('cross-origin-opener-policy', 'same-origin'); + headers.set('cross-origin-embedder-policy', 'require-corp'); + headers.set('cross-origin-resource-policy', 'same-origin'); + } + + headers.set('cache-control', 'public, max-age=3600, stale-while-revalidate=86400'); + headers.set('x-content-type-options', 'nosniff'); + if (ext === 'html' || ext === 'svg') { + // Uploaded HTML (game shells) runs on this origin; keep it from being framed elsewhere. + headers.set('x-frame-options', 'SAMEORIGIN'); + } + + return new Response(upstream.body, { status: upstream.status, headers }); +}; + +export const HEAD = GET; diff --git a/src/pages/models.astro b/src/pages/models.astro new file mode 100644 index 0000000..d26113f --- /dev/null +++ b/src/pages/models.astro @@ -0,0 +1,53 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../layouts/Base.astro'; +import ModelViewer from '../components/ModelViewer.astro'; +import { media } from '../lib/media'; + +const models = (await getCollection('models')).sort((a, b) => +b.data.date - +a.data.date); +--- + + +
+

// 04 — Specimens

+

Models

+

Blender work you can spin around. Drag to orbit, scroll to zoom.

+ +
+ { + models.map((m) => ( +
+ +
+

{m.data.title}

+

+ {m.data.date.toISOString().slice(0, 10)} · {m.data.tools.join(' · ')} +

+ {m.data.notes &&

{m.data.notes}

} +
+
+ )) + } +
+
+ + + diff --git a/src/pages/play/[slug].astro b/src/pages/play/[slug].astro new file mode 100644 index 0000000..299617e --- /dev/null +++ b/src/pages/play/[slug].astro @@ -0,0 +1,91 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../../layouts/Base.astro'; +import { media } from '../../lib/media'; + +export async function getStaticPaths() { + const games = await getCollection('work', ({ data }) => !!data.game); + return games.map((project) => ({ params: { slug: project.id }, props: { project } })); +} + +const { project } = Astro.props; +const game = project.data.game!; +const src = media(`${game.path}/${game.entry}`); +--- + + +
+ ← {project.data.title} +
+
+ {project.data.title} + {game.engine} build +
+ +
+ + Open in new tab ↗ + Click into the game to give it keyboard focus. +
+
+
+ + + + + diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts new file mode 100644 index 0000000..8664dce --- /dev/null +++ b/src/pages/rss.xml.ts @@ -0,0 +1,22 @@ +import rss from '@astrojs/rss'; +import { getCollection } from 'astro:content'; +import type { APIContext } from 'astro'; +import { SITE } from '../lib/site'; + +export async function GET(context: APIContext) { + const posts = (await getCollection('log', ({ data }) => !data.draft)).sort( + (a, b) => +b.data.date - +a.data.date, + ); + return rss({ + title: `${SITE.name} — Log`, + description: 'Weekly transmissions: code, builds, models and music.', + site: context.site!, + items: posts.map((post) => ({ + title: post.data.title, + description: post.data.summary, + pubDate: post.data.date, + link: `/log/${post.id}/`, + categories: post.data.tags, + })), + }); +} diff --git a/src/pages/sound.astro b/src/pages/sound.astro new file mode 100644 index 0000000..9047379 --- /dev/null +++ b/src/pages/sound.astro @@ -0,0 +1,74 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../layouts/Base.astro'; +import AudioPlayer from '../components/AudioPlayer'; +import { media } from '../lib/media'; + +const tracks = (await getCollection('sound')).sort((a, b) => +b.data.date - +a.data.date); +--- + + +
+

// 03 — Audio logs

+

Sound

+

Guitar, recordings and experiments. Self-hosted, no streaming service in the middle.

+ +
    + { + tracks.map((t, i) => ( +
  1. +
    +

    {t.data.title}

    +

    + {t.data.date.toISOString().slice(0, 10)} + {t.data.gear.length > 0 && ` · ${t.data.gear.join(' · ')}`} +

    + {t.data.notes &&

    {t.data.notes}

    } +
    + +
  2. + )) + } +
+
+ + + diff --git a/src/pages/work/[...slug].astro b/src/pages/work/[...slug].astro new file mode 100644 index 0000000..ed601ed --- /dev/null +++ b/src/pages/work/[...slug].astro @@ -0,0 +1,125 @@ +--- +import { getCollection, render } from 'astro:content'; +import { Image } from 'astro:assets'; +import Base from '../../layouts/Base.astro'; +import ModelViewer from '../../components/ModelViewer.astro'; +import { media } from '../../lib/media'; + +export async function getStaticPaths() { + const work = await getCollection('work'); + return work.map((project) => ({ params: { slug: project.id }, props: { project } })); +} + +const { project } = Astro.props; +const { Content } = await render(project); +const d = project.data; +--- + + +
+ ← All case files + +
+
+

// {d.disciplines.join(' · ')}

+

{d.title}

+

{d.summary}

+ { + d.links.length > 0 && ( +
+ {d.links.map((l, i) => ( + + {l.label} ↗ + + ))} + {d.game && ( + + Play ▶ + + )} +
+ ) + } + { + d.links.length === 0 && d.game && ( + + Play ▶ + + ) + } +
+
+
Status
+
{d.status.replace('-', ' ')}
+
Date
+
{d.date.toISOString().slice(0, 7)}
+ { + d.role && ( + <> +
Role
+
{d.role}
+ + ) + } + { + d.stack.length > 0 && ( + <> +
Stack
+
{d.stack.join(' · ')}
+ + ) + } +
+
+ + { + d.cover && ( + {d.coverAlt + ) + } + + {d.model && } + +
+ +
+
+ + + diff --git a/src/pages/work/index.astro b/src/pages/work/index.astro new file mode 100644 index 0000000..4ac7a75 --- /dev/null +++ b/src/pages/work/index.astro @@ -0,0 +1,77 @@ +--- +import { getCollection } from 'astro:content'; +import Base from '../../layouts/Base.astro'; +import ProjectCard from '../../components/ProjectCard.astro'; +import { DISCIPLINES } from '../../content.config'; + +const work = (await getCollection('work')).sort((a, b) => +b.data.date - +a.data.date); +--- + + +
+

// 01 — Archive

+

Case files

+ +
+ + { + DISCIPLINES.map((d) => ( + + )) + } +
+ +
+ {work.map((p, i) => )} +
+ +
+ + + + + diff --git a/src/styles/global.css b/src/styles/global.css new file mode 100644 index 0000000..8b79925 --- /dev/null +++ b/src/styles/global.css @@ -0,0 +1,401 @@ +@layer reset, tokens, base, layout, components, utilities, page; + +@import '@fontsource-variable/big-shoulders'; +@import '@fontsource-variable/ibm-plex-sans'; +@import '@fontsource/ibm-plex-mono/400.css'; +@import '@fontsource/ibm-plex-mono/500.css'; + +@import './tokens.css' layer(tokens); +@import './themes/index.css' layer(tokens); + +/* + * Page-specific styles should go in the page's own