Skip to content

Providers Overview

Providers render the canonical Codabra application model into native source files. Every target receives the same normalized models, endpoint operations and feature kits; only syntax and framework integration live in a provider.

Available targets

NameRuntimeGenerated architecturePersistence
nextjsNext.js 16 App Routertypes, API routes, views, functions, votersDrizzle or Prisma
nodeNode.js 22 + Express 5domain, application ports, persistence and HTTP adaptersreplaceable memory adapter
phpPHP 8.2, no frameworkPSR-4 domain, application ports, persistence, front controlreplaceable memory adapter
goGo 1.23 + net/httpdomain, ports, memory and HTTP packages, cmd/apireplaceable memory adapter
symfonySymfony 7.4 LTS + PHP 8.2shared PHP domain/ports plus Symfony controllers and wiringreplaceable memory adapter

API-only targets emit a warning when a config contains declarative views or custom functions that do not yet have a target adapter. Generation never silently invents business logic.

The memory repositories are useful development adapters and demonstrate the port contract. Replace them with a database adapter before production. Next.js already integrates Drizzle and Prisma lifecycle commands.

Several outputs from one config

json
{
  "$schema": "./.codabra/schemas/codabra.schema.json",
  "features": ["comments"],
  "providers": [
    { "provider": "nextjs", "orm": "drizzle", "database": "postgresql" },
    { "provider": "go", "orm": "native", "database": "memory" },
    { "provider": "symfony", "orm": "native", "database": "memory" }
  ]
}

codabra generate produces apps/nextjs, apps/go and apps/symfony. Use --provider go to target only one output.

Provider contract

typescript
interface Provider {
  name: string;
  label: string;
  initCommand: string;
  persistence: 'codabra-orm' | 'provider-native';
  port: number;

  generate(config: ConfigSet, appDir: string): Promise<CompilerResult>;
  startDev(appDir: string, options?: { port?: string }): Promise<void>;
  runBuild(appDir: string): Promise<void>;
  generateDockerfile(): string;
}

See Generation Architecture before adding a renderer.

Released under the Elastic License 2.0.