@geenius/adapters
v0.16.0
Published
Adapter contracts, local-first prototype adapters, framework bindings, and Convex schema helpers for the Geenius ecosystem.
Downloads
1,542
Readme
@geenius/adapters
Adapter contracts, local-first prototype adapters, framework bindings, and Convex schema helpers for the Geenius ecosystem.
Install
pnpm add @geenius/adaptersAdd the peers you actually use:
reactandreact-domfor@geenius/adapters/reactor@geenius/adapters/react-csssolid-jsfor@geenius/adapters/solidjsor@geenius/adapters/solidjs-cssconvexfor@geenius/adapters/convex
Available Exports
import { configureAdapters, createLocalStorageDbAdapter } from '@geenius/adapters'
import { AdapterProvider, useAdapters, useDb } from '@geenius/adapters/react'
import { AdapterProvider as SolidProvider, createAdapters } from '@geenius/adapters/solidjs'
import { AdapterProvider as CssProvider } from '@geenius/adapters/react-css'
import { AdapterProvider as SolidCssProvider } from '@geenius/adapters/solidjs-css'
import { createConvexAdapter, schema } from '@geenius/adapters/convex'What This Package Owns
@geenius/adapters is the contract layer for six infrastructure domains:
dbauthpaymentsaistorageadmin
It ships:
- shared TypeScript interfaces and typed error classes
- a provider registry and tier-gating helpers
- localStorage-backed prototype adapters for rapid setup
- React hooks/providers and SolidJS primitives/providers
- Tailwind and vanilla CSS UI variants
- Convex schema and mutation/query helpers for adapter registry storage
Production provider implementations live in the domain packages such as @geenius/db, @geenius/auth, @geenius/payments, and @geenius/ai.
Basic Usage
import {
configureAdapters,
createLocalStorageAuthAdapter,
createLocalStorageDbAdapter,
} from '@geenius/adapters'
configureAdapters({
db: { provider: 'localStorage' },
auth: { provider: 'localStorage' },
})
export const adapters = {
db: createLocalStorageDbAdapter(),
auth: createLocalStorageAuthAdapter(),
}import { AdapterProvider, useDb } from '@geenius/adapters/react'
import { adapters } from './adapters'
function Dashboard() {
const db = useDb()
void db.list('users')
return null
}
export function App() {
return (
<AdapterProvider adapters={adapters} healthCheck>
<Dashboard />
</AdapterProvider>
)
}Local Prototype Adapters
The shared entrypoint exposes prototype factories for every supported domain:
import {
createLocalStorageAdminAdapter,
createLocalStorageAiAdapter,
createLocalStorageAuthAdapter,
createLocalStorageDbAdapter,
createLocalStorageFileAdapter,
createLocalStoragePaymentsAdapter,
createNoopPaymentsAdapter,
} from '@geenius/adapters'These factories are intended for local development, Storybook review, and Pronto-tier bootstrapping. Swapping to a production provider should not change the consuming component API.
Errors
Adapter failures are surfaced as typed error classes:
AdapterErrorDbErrorAuthErrorAiErrorStorageErrorPaymentsErrorAdminErrorAdapterConfigurationErrorAdapterResolutionErrorAdapterContextErrorAdapterInvariantError
Consumers should catch these exported classes instead of vendor-specific exceptions.
Storybook Review Apps
The repository includes React and SolidJS review apps that exercise both the Tailwind and vanilla CSS variants:
pnpm --filter ./apps/storybook-react build
pnpm --filter ./apps/storybook-solidjs buildLicense
FSL-1.1-Apache-2.0 (free-tier) / Proprietary (commercial)
