/projects and the homepage featured-work section to use the published Django project catalog./api/chat to use the published Django project catalog with a graceful unavailable-catalog fallback.This module defines the public HTTP surface through Astro file-based routing. It renders portfolio pages, prerenders content detail pages, emits RSS, and serves the Anthropic chat endpoint.
Astro discovers files under this directory. src/middleware.ts runs before routes and can return a maintenance response. All visual pages compose src/layouts/BaseLayout.astro.
| Method and route | File | Rendering and responsibility |
|---|---|---|
GET / |
index.astro |
Server page; featured projects from Django, recent posts, hero, and about summary |
GET /about |
about.astro |
Server page; biography, education, skills, and contact links |
GET /projects |
projects/index.astro |
Server page; serializes published Django projects into an idle-hydrated filter |
GET /projects/[slug] |
projects/[slug].astro |
Runtime Django metadata detail with optional MDX body, headings, reading time, and API-related projects |
GET /blog |
blog/index.astro |
Server page; published posts in an idle-hydrated filter |
GET /blog/[slug] |
blog/[slug].astro |
Prerendered, non-draft MDX detail with headings and reading time |
GET /til |
til/index.astro |
Server page; published short notes with search and topic filtering |
GET /til/[slug] |
til/[slug].astro |
Prerendered, non-draft MDX detail with headings and reading time |
GET /rss.xml |
rss.xml.ts |
RSS for non-draft posts |
GET /404 |
404.astro |
Custom not-found presentation |
POST /api/chat |
api/chat.ts |
Server API for the visitor assistant |
POST /api/chat expects JSON with messages as an array and optional currentPath. It loads published project metadata from PROJECT_API_URL, keeps non-draft blog context from MDX, adds static skills, education, and contact data, caches the base prompt per server cold start, adds page context, and returns { message }. Missing credentials, unavailable project API data, and runtime errors deliberately return friendly JSON messages without inventing project details.
@anthropic-ai/sdk powers the server-only chat route.@astrojs/rss powers the feed.src/lib/project-api.ts validates and maps Django project catalog responses for server consumers.astro.config.mjs selects standalone Node server output; detail routes explicitly set prerender = true.src/middleware.ts bypasses /api/ when maintenance mode is active.Page props are derived from content entry schemas. Lists serialize Dates to ISO strings where client components need them. The chat route accepts message objects with role and content, then narrows roles for the Anthropic client; no database or server session is used.
No route/API unit-test framework exists. Run npm run check, npm run build, and npm run smoke:chat against a running standalone server. Manually verify route generation for all MDX slugs, draft exclusion, RSS links, 404 behavior, maintenance 503 headers, chat responses with and without credentials, Django catalog fallback behavior, and that no secret enters client bundles.
Add it under this directory following Astro filename routing, and wrap visual pages in BaseLayout. Add navigation in src/lib/constants.ts only when the page belongs in global navigation.
Their slugs and bodies are known from local content at build time. Prerendering avoids a server lookup on every detail request while leaving /api/chat and general server output available.
Keep the Anthropic SDK and key server-only. If the public request contract changes, update ChatWidget.tsx at the same time and add validation/rate-limit tests when a test harness is introduced.
src/middleware.ts — pre-route maintenance gate.src/layouts/BaseLayout.astro — shared page shell.src/content.config.ts and src/content/ — route data.src/components/react/ChatWidget.tsx — chat client.astro.config.mjs and vercel.json — hosting behavior.