Colophon
Craft, Palette & Architecture
The design tokens, typography, edge architecture, and agent-assisted engineering conventions that power hendrasadewa.com and the Niwa monorepo.
Botanical Palette
Defined once in @niwa/ui/styles/tokens.css. Every app inherits warm paper and botanical charcoal neutrals while scoping its own craft pigment via data-brand.
Botanical Sage
#6B7F6ENiwa base primary (Pustaka, Blog, Labs, Web)
--niwa-sage-500
Aizome Indigo
#587496Toko commerce accent
--niwa-aizome-500
Terracotta
#B85535Niwa Auth identity accent
--niwa-terracotta-500
Waterlily Pink
#D48C9EPre-order craft accent
--niwa-waterlily-500
Warm Canvas
#F7F3ECLight paper background
--niwa-canvas
Botanical Charcoal
#161816Dark mode canvas
--niwa-night-950
Typography
Playfair Display
Editorial headings, page titles, and quiet serif accents.
Open Sans
Clear, legible body copy, navigation, and interface controls.
JetBrains Mono
Subdomains, dates, CSS tokens, and technical metadata.
Monorepo Architecture
One TypeScript & pnpm workspace targeting Cloudflare Workers, D1, R2, and Static Assets.
Two Purpose-Built Web Archetypes
SEO-first product sites run on Next.js 16 + OpenNext on Cloudflare Workers; client-only portals run as Vite 8 + React Router SPAs on Static Assets.
- Next.js 16 App Router (web, pustaka-web, toko-web, blog-web)
- Vite 8 Static SPAs (auth-web, labs)
- Tailwind CSS v4 + @niwa/ui botanical design tokens
Strict One-Way Hono + Drizzle Workers
Every backend service follows the same canonical layered architecture backed by Cloudflare D1 and R2, built on shared @niwa/api-core primitives.
- routes → services → repositories → db (zero leaky imports)
- Per-request D1 injection & atomic db.batch() writes
- Worker Service Bindings for fast internal worker-to-worker calls
One Monorepo, Shared Contracts
A pnpm workspace unifies UI primitives, ES256 JWKS auth verification, typed Fetch clients, and Zod v4 schemas across every app.
- @niwa/ui — shared tokens, primitives & ColorSchemeToggle
- @niwa/auth — Passkey SSO & JWKS server verification
- @niwa/*-validators — single Zod v4 source of truth
Agent-Assisted Development
Niwa is designed to be legible to AI coding agents from the ground up so adding a new app or endpoint follows the exact same craft.
Living Repository Maps
Root and per-app AGENTS.md files document every Worker, port, shared package, and convention so coding agents orient in seconds without guessing.
Reusable Domain Skills
Repeatable engineering playbooks — like niwa-api-architecture — encode exact templates for routes, services, repositories, error catalogs, and D1 migrations.
Machine-Checkable Contracts
Shared @niwa/*-validators schemas, strict TypeScript (noUncheckedIndexedAccess), and @niwa/ui tokens constrain agent output so every new app feels native to Niwa.
Human Taste + Automated Gates
Design decisions stay human-led through interactive planning, while typechecks, Drizzle migrations, and path-filtered GitHub Actions safely ship each Worker to Cloudflare.