Note
Stratum is live: High-performance Postgres-native Backend-as-a-Service, automated REST API, real-time change data capture, S3/R2 storage, edge serverless functions, AI SQL assistant, and local-first developer experience.
Developed by Jojin John β’ LinkedIn Profile
# Initialize a new Stratum project in seconds
npx @jojin1709/stratum-cli init my-app
# Or install the official client SDK
npm install @jojin1709/stratumTip
Zero Cloud Lock-in: Stratum runs locally with zero dependencies or deploys seamlessly to any VPS, Docker cluster, or edge cloud infrastructure (Cloudflare Workers + Hyperdrive + R2 + PostgreSQL).
- What is Stratum?
- Key Capabilities
- System Architecture
- Verified Benchmarks & Test Suite
- Quick Start Guide
- Subsystems & Workspace Structure
- Docker Deployment
- Security & Authorization Model
- License & Intellectual Property
Stratum is an all-in-one Backend-as-a-Service (BaaS) designed by Jojin John for developers who demand complete control over their database, sub-50ms query execution, and zero bloat.
Operating directly on PostgreSQL with Cloudflare Hyperdrive connection pooling, Stratum provides:
- π Interactive Data Grid: Browse and edit table rows, filter/sort, insert records with typed validation, and delete rows without raw SQL.
- β¨ AI SQL Copilot: Natural language query assistant transforming plain English into optimized PostgreSQL 18 queries.
- π Interactive REST API Playground: Instant parameterised endpoints with built-in live tester and multi-language code generators for TypeScript, Python, cURL, and Go.
- πΈοΈ Visual Schema ERD: Interactive entity-relationship diagram rendering tables, columns, primary keys, and relations.
- β‘ Database Webhooks & Event Triggers: Stream row
INSERT,UPDATE, andDELETEevents to external URLs with HMAC SHA-256 signatures. - π Migration Timeline & DDL Exporter: Atomic versioned migrations with one-click full PostgreSQL DDL schema export.
- π GitHub OAuth Security Gate: Strict authentication protecting the console and database resources.
| Feature | Stratum Implementation | Benefit |
|---|---|---|
| Introspected REST | Generated dynamically from information_schema |
Zero code required to expose new tables safely |
| Interactive Data Grid | Real-time row viewer with typed cell editing & insert modal | Manage data visually without writing manual queries |
| AI SQL Copilot | Schema-aware natural language to SQL translation | 10x faster query authoring and diagnostics |
| Visual Schema ERD | Dynamic canvas showing tables, PKs, and relations | Instant visual comprehension of database architecture |
| Database Webhooks | Outgoing HTTP webhooks triggered on Postgres mutations | Connect with Zapier, Slack, Discord, and external APIs |
| Multi-Language SDKs | Code generation for TypeScript, Python, Go, and cURL | Onboard frontend & backend developers immediately |
| Realtime CDC | Database trigger notify_change() -> Node/WS LISTEN |
Instant sub-millisecond event streaming to frontends |
| Zero-Config Storage | Abstracted provider supporting local disk or Cloudflare R2 | Switch from dev to production with a single env var |
| Atomic Migrations & DDL | Transactional -- +stratum up/down migrations + DDL export |
Guaranteed zero schema drift across environments |
flowchart TB
subgraph Clients["Client Layer"]
Browser["Web Browser (@stratum/client)"]
Mobile["Mobile App / Frontend"]
Console["Stratum Dashboard (:8787 / Vercel)"]
CLI["Stratum CLI (@stratum/cli)"]
end
subgraph Gateway["Stratum API Engine (:8788 / Workers)"]
Auth["Auth & Role Guard (GitHub OAuth / Public / Secret Key)"]
REST["Auto REST CRUD & OpenAPI 3.1"]
SQL["Parametric SQL Executor & AI Copilot"]
StorageEngine["Storage Router (Local / S3 / R2)"]
WebhooksEngine["Database Webhooks Dispatcher"]
FnRuntime["Function Runtime & Workers Deployer"]
end
subgraph RealtimeLayer["Realtime Hub (:8789)"]
WSServer["WebSocket Server"]
CDCListener["Postgres LISTEN/NOTIFY Trigger Listener"]
PubSub["Topic & Channel Multiplexer"]
end
subgraph DataPlane["Data & Storage Infrastructure"]
Postgres[(PostgreSQL 18.6 Engine)]
Hyperdrive[(Cloudflare Hyperdrive Pool)]
R2Storage[("Cloudflare R2 / S3 Storage")]
end
Browser -->|Public Key| Auth
Mobile -->|Public Key| Auth
Console -->|Secret Key Proxy| Auth
CLI -->|Secret Key| Auth
Auth --> REST
Auth --> SQL
Auth --> StorageEngine
Auth --> WebhooksEngine
Auth --> FnRuntime
REST --> Hyperdrive --> Postgres
SQL --> Hyperdrive --> Postgres
CDCListener -->|LISTEN stratum_changes| Postgres
StorageEngine --> R2Storage
WSServer --> PubSub
CDCListener --> PubSub
Browser <-->|WebSocket| WSServer
Stratum is comprehensively tested against live PostgreSQL instances:
| Package / Suite | Tests | Status | Coverage Focus |
|---|---|---|---|
@stratum/shared |
12 | β Passed | Errors, identifiers, key masking & hashing |
@stratum/database |
23 | β Passed | Dynamic query compiler, DDL builder, migrations |
@stratum/storage |
9 | β Passed | Path safety, S3/local streaming, content headers |
@stratum/realtime |
10 | β Passed | Protocol frame parsing, channel isolation, heartbeats |
@stratum/functions |
9 | β Passed | Worker AST static analysis, invocation sandboxing |
@stratum/client |
13 | β Passed | Type-safe URL queries, query builder, browser safety |
@stratum/cli |
8 | β Passed | Config loading, project init, command routing |
apps/api (Integration) |
35 | β Passed | End-to-end integration tests on live PostgreSQL |
apps/dashboard (E2E) |
35 | β Passed | All 18 Next.js routes & API proxy verified |
| Total | 154 | 100% Passed | Full platform verification |
- Node.js:
>= 20.11.0 - pnpm:
>= 9.0.0 - PostgreSQL:
>= 15(or Docker)
# Clone the repository
git clone https://github.com/jojin1709/Stratum.git
cd Stratum
# Build all workspace packages
pnpm build
# Run complete test suite
pnpm test# Start Postgres via Docker
pnpm db:up
# Launch API and Dashboard
pnpm dev- API Engine:
http://localhost:8788 - Dashboard:
http://localhost:8787 - Realtime Gateway:
ws://localhost:8788/realtime/v1
stratum/
βββ apps/
β βββ api/ # Core Hono HTTP API & Cloudflare Worker Gateway
β βββ dashboard/ # Next.js 14 Dark-Mode Console (Vercel Live)
βββ packages/
β βββ cli/ # Developer CLI binary (`stratum`)
β βββ client/ # Isomorphic TypeScript SDK (@stratum/client)
β βββ config/ # Centralized configuration & environment loader
β βββ database/ # PostgreSQL adapter, introspection & migrations
β βββ functions/ # Serverless function runner & Cloudflare deployer
β βββ realtime/ # WebSocket hub & PostgreSQL CDC listener
β βββ shared/ # Shared types, error definitions & cryptography
β βββ storage/ # Local & Cloudflare R2 / S3 storage providers
βββ docker-compose.yml # Multi-service stack definition
βββ LICENSE # Proprietary Software License
Provides atomic schema introspection, safe SQL DDL execution, and an irreversible migration manager with SHA-256 verification.
Unified driver supporting local storage with traversal prevention, and Cloudflare R2 / AWS S3 with signed upload/download URLs.
High-throughput WebSocket multiplexer broadcasting PostgreSQL table row alterations directly to frontends.
Enables zero-overhead local execution of TypeScript/JavaScript serverless handlers and seamless packaging into Cloudflare Workers.
import { createClient } from '@jojin1709/stratum';
const stratum = createClient({
url: 'https://stratum-api.jojin1709.workers.dev',
key: 'strat_public_...'
});
// Type-safe queries
const { data, error } = await stratum
.from('products')
.select('id, name, price')
.eq('status', 'active')
.order('price', { ascending: false })
.limit(10);
// Realtime subscriptions
stratum
.channel('products')
.on('INSERT', (event) => {
console.log('New product added:', event.record);
})
.subscribe();Stratum includes production-ready Dockerfiles and orchestration configurations:
# Start complete standalone container stack
docker compose up -d
# View API logs
docker compose logs -f api- Role-Based API Keys:
strat_public_...: Read and write data according to public permissions.strat_secret_...: Administrative access for schema, SQL, and key rotation.
- GitHub OAuth Gate: Restricts administrative console access to authenticated authorized accounts.
- Path Traversal Protection: All object keys and migration paths are strictly sanitized.
- In-Memory Rate Limiting: Token-bucket rate limiting protecting public endpoints.
- Header Hardening: Automatic CSP, HSTS, X-Frame-Options, and download disposition enforcement.
Stratum is built and maintained by Jojin John (@jojin1709). We adhere to strict engineering, security, and community standards:
- π‘οΈ Security Policy: Vulnerability disclosure & cryptographic integrity.
- π Code of Conduct: Contributor Covenant v2.1 standard.
- π οΈ Contributing Guide: Monorepo workflow, PR guidelines, and testing requirements.
- π¬ Support Portal: Documentation links, direct contact, and enterprise inquiries.
- π Changelog: Release versioning notes and breaking changes.
- π LinkedIn Profile: Connect directly with creator Jojin John.
Copyright (c) 2026 Jojin John. All Rights Reserved.
This software and associated documentation files (the "Software") are the proprietary and confidential property of Jojin John.
Unauthorized copying, cloning, modifying, distributing, sublicensing, or making available publicly of this software, via any medium, is strictly prohibited without explicit written permission from the author.