Astro Kitchen Sink
A self-contained Astro (SSR) app that exercises the full @timbl/client surface against a timbl CMS instance. Located at examples/astro-kitchen-sink/ in the repo.
astro.config.mjs
javascript
import { defineConfig } from "astro/config";
import node from "@astrojs/node";
// `output: "server"` + the Node adapter means every page is rendered on
// demand. Nothing is prerendered, so `astro build` never calls the CMS and
// succeeds without a running instance. Start the CMS, then `bun run dev`.
export default defineConfig({
output: "server",
adapter: node({ mode: "standalone" }),
}); What it demonstrates
- Typed reads:
collection().findMany()withstatus/sort/limit/offset/qsearch /selectprojection. - Detail by slug:
findBySlug()withinclude+depthrelation expansion. - Relations:
caseStudies -> project(single) andposts/projects -> tags(many), rendered from included records. - Globals:
siteSettings(site name, description,socialLinksarray) in the layout. - Markdown: renders the CMS-provided
bodyHtmlcompanion (already sanitized). No client-side markdown pipeline. - Assets:
assets.findMany()gallery; featured images resolved viaassets.findById().
Running it
cd examples/astro-kitchen-sinkbun installbun run devThe example expects a running timbl CMS at http://localhost:3000 (or whatever PUBLIC_TIMBL_BASE_URL is set to in .env). See the Quick Start for standing up the server.
File structure
src/ layouts/Base.astro # Global site shell, siteSettings globals lib/cms.ts # Typed @timbl/client wrapper pages/ index.astro # Public homepage (posts, case studies) admin.astro # Admin dashboard (assets, drafts) login.astro # Auth login health.astro # /health check api/auth/login.ts # Login endpoint api/auth/logout.ts # Logout endpoint assets/index.astro # Asset gallery