apps/playground: The public-facing learning app. It useslocalStorage(via theAnzaClientcomponent) to persist user code. It consumes data primarily via direct server-side Drizzle queries inlib/lessons.server.ts.apps/dashboard: The educator portal. It relies on Logto for layout-level route protection (getLogtoContext). All data mutations (create/update/delete modules and lessons) are handled via Next.js Server Actions located inapp/actions/.
We use Tailwind CSS v4 and Radix UI. typical shadcn/ui in a monorepo setup.
Our database is managed centrally via Drizzle ORM connected to Neon Postgres.
- Bilingual Schema: Content localization is handled at the database level. Text fields (like lesson titles and descriptions) use a custom
jsonbtype structure:{ en: string; sw: string; }. - Migrations: Always generate migrations via
pnpm db:generatein thepackages/dbdirectory if you modifyschema.ts.
Warning
Only use pnpm db:push for local rapid prototyping.
The Nuru interpreter is written in Go and compiled to WASM.
- The JS Bridge: The
index.tsfile acts as the bridge. Code is executed synchronously. Standard Go output (stdout/stderr) is intercepted by a global JS callback (nuruOutputReceiver) and explicitly sanitized to prevent XSS. - Execution Safeguards: Because WASM runs on the main thread, the Go engine employs an execution limit (e.g.,
MAX_ITERATIONSinwhile.gois capped at 1,000,000) to prevent infinite loops from freezing the browser. - TinyGo: Ensure your Go code compiles with TinyGo, as it is used for production builds. Avoid reflection or heavy standard libraries that TinyGo does not fully support.
- Branch from
staging(feature/nameorfix/name). - Adhere strictly to the TypeScript and Go type systems. Do not use
anyor disable warnings. - Ensure any Server Action changes are properly permission-checked against Logto roles.