Hendra Sadewa

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

#6B7F6E

Niwa base primary (Pustaka, Blog, Labs, Web)

--niwa-sage-500

Aizome Indigo

#587496

Toko commerce accent

--niwa-aizome-500

Terracotta

#B85535

Niwa Auth identity accent

--niwa-terracotta-500

Waterlily Pink

#D48C9E

Pre-order craft accent

--niwa-waterlily-500

Warm Canvas

#F7F3EC

Light paper background

--niwa-canvas

Botanical Charcoal

#161816

Dark mode canvas

--niwa-night-950


Typography

--font-serif

Playfair Display

Editorial headings, page titles, and quiet serif accents.

--font-sans

Open Sans

Clear, legible body copy, navigation, and interface controls.

--font-mono

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.

01 · Frontends
  • 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.

02 · Layered APIs
  • 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.

03 · Shared Foundations
  • @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.

01AGENTS.md

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.

02.agents/skills/*

Reusable Domain Skills

Repeatable engineering playbooks — like niwa-api-architecture — encode exact templates for routes, services, repositories, error catalogs, and D1 migrations.

03Zod v4 + Strict TS

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.

04Plan → Verify → Deploy

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.