One YAML file. PostgreSQL + SQLite + Redis + Stripe. Zero boilerplate.
┌───────────────────┐ omni generate ┌───────────────────────────────────┐
│ omni.config.yaml │ ───────────────────> │ src/generated/ │
│ (Single Source) │ │ ├── omni-bridge.ts │
└───────────────────┘ │ ├── services/ (Postgres/Redis) │
│ │ ├── routes/ (Express/Hono/Next) │
│ omni db push │ └── types/models.ts │
▼ └───────────────────────────────────┘
┌───────────────────┐
│ Database Schema │ (Auto DDL Migrations: CREATE TABLE, INDEXES, CONSTRAINTS)
└───────────────────┘
OmniAdapter solves the universal "glue code" problem that every backend developer faces: writing the same connection pools, cache layers, webhook handlers, router boilerplate, and CRUD services over and over. Define your schema in omni.config.yaml, run the CLI, and get a fully type-safe, production-ready TypeScript backend bridge in seconds.
| Problem | Traditional Approach | OmniAdapter |
|---|---|---|
| PostgreSQL / SQLite connection pooling | 40 lines of manual pool setup | Auto-generated with optimized defaults |
| Redis caching layer | Manual get/set logic |
Automatic cache-aside / write-through strategies |
| Express / Hono / Next.js Routers | Hand-rolled HTTP handlers | `--target express |
| Database Schema Migrations | Manual CREATE TABLE scripts |
omni db push auto DDL schema sync |
| Stripe webhook handling | Hand-rolled event parsing | Fully typed webhook event constructor |
| Type-safe service layer | Manual interfaces + validation | AST-generated interfaces from YAML |
| Mock testing infrastructure | Write your own mocks | Built-in mock environment with 100% test coverage |
npm install -g omniadapter
# or clone and build locally
npm install && npm run buildproject: "my-saas"
version: "1.0.0"
database:
provider: postgresql
host: localhost
port: 5432
database: my_saas
user: postgres
password: secret
ssl: false
pool:
min: 2
max: 10
redis:
host: localhost
port: 6379
stripe:
secretKey: sk_test_...
webhookSecret: whsec_...
collections:
users:
name: "users"
table: "users"
fields:
id: { type: uuid, required: true, unique: true }
email: { type: string, required: true, unique: true, index: true }
name: { type: string, required: false }
age: { type: number, required: false }
cache:
ttlSeconds: 300
strategy: write-through
stripe:
webhookEndpoint: /webhooks/stripe/users
webhookEvents:
- invoice.payment_succeeded
outputs:
directory: "src/generated"omni generate --config omni.config.yaml --out src/generatedimport { OmniBridge, UsersService } from './generated';
const app = new OmniBridge({
database: { host: 'localhost', port: 5432, database: 'my_saas', user: 'postgres', password: 'secret' },
redis: { host: 'localhost', port: 6379 },
stripe: { secretKey: 'sk_test_...' }
});
await app.connect();
const user = await (app.collections.users as UsersService).findById('user-123');
console.log(user?.email);
await app.disconnect();OmniAdapter/
├── cli/ # CLI entry point (omni generate, omni serve)
├── generator/ # AST parser, config validator, code emitter
├── templates/ # Code template fragments
├── types/ # Shared TypeScript interfaces
├── tests/ # Vitest suite with mock PostgreSQL, Redis, Stripe
├── src/generated/ # Your auto-generated backend (DO NOT EDIT MANUALLY)
└── omni.config.yaml # The single source of truth
database.service.ts— Connection-pooled PostgreSQL queriesredis.service.ts— Auto-connect with TTL supportstripe.service.ts— Product/price creation + webhook event constructionusers.service.ts/orders.service.ts— Type-safe CRUD with cachingomni-bridge.ts— Unified bridge that wires everything togethertypes/models.ts— Fully typed interfaces derived from YAML
Every generated service is covered by a mock environment that simulates real database, Redis, and Stripe behavior without external dependencies:
npm test # Run full suite
npm run test:watch # Watch mode for TDDMock infrastructure (tests/mock-env/):
MockPool— Returns predictable rows for SQL queriesMockRedis— In-memory key-value store with TTL simulationMockStripe— Returns mock products, prices, and webhook events
| Command | Description |
|---|---|
omni generate --config omni.config.yaml |
Generate backend services |
omni generate --target express |
Auto-generate Express router (src/generated/routes/express.router.ts) |
omni generate --target hono |
Auto-generate Hono router (src/generated/routes/hono.router.ts) |
omni generate --target nextjs |
Auto-generate Next.js Route Handlers |
omni db push |
Auto DDL migration (CREATE TABLE, indexes, constraints) |
omni migrate |
Output timestamped SQL migration script to migrations/ |
omni serve |
Start development REST API preview server |
| Metric | Traditional | OmniAdapter |
|---|---|---|
| Setup time for new service | ~4 hours | < 30 seconds |
| Lines of boilerplate removed | 0 | 500+ |
| Type errors caught at build | Some | 100% |
| Mock test infrastructure | Manual | Built-in |
We believe every backend developer deserves a universal adapter. No vendor lock-in. No hidden configuration. Just one YAML file that describes your data, and a generator that produces production-grade TypeScript code you actually want to maintain.
Generate from scratch:
npm install
npm run generate
npm test
npm run buildWatch and rebuild:
npm run devBuilt with ❤️ by shashank — July 2026