Patterns you can copy
Each example is a focused, runnable app showing one slice of Fakebase, written in Next.js here for concreteness. The kernel is server-only, so reads happen on the server and client writes go through your framework's API routes.
App Router — Basic CRUD
The smallest useful Fakebase app: a notes list with create / toggle / delete, built entirely with Server Components + Server Actions. No API routes, no client JS.
SSR Auth
Server-rendered auth: sign up / in / out as Server Actions, with the page gated on the server-read session — the same structure you'll use with @supabase/ssr in production.
Storage & Realtime
Upload / list / delete files via Server Actions (bytes land in .fakebase/storage/), plus the in-process realtime bus bridged to the browser over Server-Sent Events.
The server-read, route-write pattern
The Fakebase kernel is backed by Node built-ins (fs, crypto), so it must run on the server. Read in Server Components; have Client Components call Server Actions or Route Handlers for mutations. The live Playground wires up posts and auth this way — and shows the real { data, error } at every step.
// Server Component — read directly from the kernel
import { supabase } from "@/lib/fakebase";
export default async function PostsPage() {
const { data: posts } = await supabase
.from("posts")
.select("*")
.order("created_at", { ascending: false });
return <PostList posts={posts ?? []} />;
}
// Client writes go through a Route Handler:
// app/api/posts/route.ts -> supabase.from("posts").insert(...)