Playground & Docs
The sample app supports switching between Mock, Supabase, and PocketBase adapters at runtime. The adapter picker is accessible from both the login screen and the profile screen.
When you switch adapters, the app:
// From lib/client.ts
export async function buildClient(config: AdapterConfig) {
if (config.type === 'mock') {
return createSeededMockClient(); // pre-seeded data
}
if (config.type === 'supabase') {
const { SupabaseAdapter } = await import(
'@vibecode-db/client/adapters/supabase'
);
const adapter = new SupabaseAdapter({
supabaseUrl: config.supabaseUrl!,
supabaseKey: config.supabaseKey!,
});
return createClient(url, key, { adapter });
}
if (config.type === 'pocketbase') {
const { PocketBaseAdapter } = await import(
'@vibecode-db/client/adapters/pocketbase'
);
const adapter = new PocketBaseAdapter({
url: config.pocketbaseUrl!,
});
return createClient(url, '', { adapter });
}
}
No configuration needed. Comes with seeded data:
Requires a Supabase project:
https://xxx.supabase.co)posts and profiles tablescreate table posts (
id serial primary key,
title text not null,
content text not null,
author_id text not null,
author_name text,
created_at timestamptz default now()
);
create table profiles (
id text primary key,
email text,
name text,
bio text,
avatar_url text
);
Requires a running PocketBase instance:
http://127.0.0.1:8090)posts and profiles collections in the PocketBase admin UIThe app uses NativeWind v4 for Tailwind CSS support in React Native. Key configuration:
| File | Purpose |
|---|---|
babel.config.js | jsxImportSource: "nativewind" enables className on RN components |
metro.config.js | withNativeWind() processes CSS at build time |
tailwind.config.js | nativewind/preset generates RN-compatible styles |
global.css | Standard Tailwind directives |
nativewind-env.d.ts | TypeScript support for className prop |