We're in early-stage — get in touch!
MIT Licensed • Open Source • Multi-Cloud

The opinionated backoffice framework for serious teams, software architects, visionary CTOs

Primebrick v3 is an open-source framework that defines infrastructure, architecture, and coding rules according to best practices. MIT license: use it in commercial projects, no strings attached.

MIT License
6+ Deploy targets
Zero vendor lock-in

From schema to production

Everything is an entity — not just your domain models, but settings, configurations, and metadata too. Define your entities, and Primebrick handles the rest: database migrations, API endpoints, RBAC, backoffice UI, tests — all generated following your conventions.

1 Define your entity schema
2 AI generates migration, CRUD API, UI, tests
3 Review, approve, deploy
primebrick@dev: ~ Schema Declaration
# Describe your entity
$ primebrick generate entity Customer
name: string (required)
email: string (unique)
status: enum [active, inactive]
phone: string (optional)
createdAt: timestamp (auto)
# AI generates everything...
✓ Database migration created
→ 00000000000003_create_customers_table.sql
✓ API CRUD endpoints (6 routes)
→ GET /api/v1/customers
→ POST /api/v1/customers
→ PUT /api/v1/customers/:id
→ DELETE /api/v1/customers/:id
✓ RBAC permissions configured
→ customers.read.* (guest, collaborator)
→ customers.* (administrator)
# Review the generated code
$ primebrick review --diff
14 files changed, 847 insertions(+), 0 deletions(-)
✓ Backoffice UI pages generated
→ /admin/customers (list, detail, form)
✓ Test scaffolding (12 tests)
→ unit: 4 | integration: 6 | e2e: 2
✓ OpenAPI spec updated
→ /api/v1/openapi/aggregated.json
# Deploy to production
$ primebrick deploy --env production
Building TypeScript...
Running tests... 12/12 passed ✓
Migrating database...
Registering microservice...
Deploying to Cloudflare Workers...
Health check passed...
🚀 Live at https://api.primebrick.dev/v1/customers
# Verify the deployment
$ curl https://api.primebrick.dev/v1/customers | jq .
status: 200 OK
count: 42 customers
response time: 18ms
$

Multi-cloud, truly.

Your infrastructure, your rules. No vendor lock-in: Primebrick runs identically from your laptop to the enterprise datacenter, from K8s cluster to the public cloud closest to your users.

AWS®
Azure®
Google Cloud™
Alibaba Cloud™
Docker®
Kubernetes®
Self-hosted
Run on your own infrastructure
Cloud-hosted
Deploy to any public cloud
On-Premise
Enterprise datacenter deployment
AI Chat — Private by design

An AI assistant that knows your domain. And never leaves your infrastructure.

Primebrick AI Chat is integrated into the backoffice, not bolted on. The LLM runs as a local container, the knowledge base lives in your PostgreSQL®, and conversations stay in your database. Zero cloud LLM calls by default — privacy is the default, not an option.

Integrated & Private

AI chat lives inside your backoffice. Prompts, responses, and conversations never leave your infrastructure. The LLM runs as a local container — zero cloud calls by default.

Qwen3™ — Apache 2.0

Default model: Qwen3™-4B-Instruct-2507, licensed under Apache 2.0. Runs on CPU with ~2.5GB RAM. No GPU required, no commercial licenses, no vendor lock-in.

OpenAI®-compatible

The runtime exposes an OpenAI®-compatible API. Swap to OpenAI®, Anthropic™, Zhipu™ GLM™, DeepSeek™, Groq™, or any compatible provider by changing one config key. Your code stays the same.

Compliance-ready

All-Apache-2.0 stack (mistral.rs™, Qwen3™, Vercel AI SDK™, pgvector™). Air-gapped deployment supported. GDPR-aligned: no data transfer to third-party LLM providers. Suitable for regulated industries.

No data leaves your infrastructure

No data leaves your infrastructure. Default configuration runs 100% on-premise. Cloud LLM is optional and opt-in — you explicitly configure it if you want it.

Powered by Qwen3™-4B-Instruct-2507 · Apache 2.0 · mistral.rs™ · OpenAI®-compatible
Agentic Development

Two ways to build. Both are first-class.

Primebrick supports the full spectrum of development workflows. Use your IDE of choice for deep, hands-on coding. Or let AI agents build features directly from the web app — no local environment needed.

// AI-POWERED

Agentic Mode

In-browser AI agents

Describe what you want, approve the plan, and AI agents build it directly in the web app. No local setup, no environment config. From idea to deployed feature without leaving the browser.

🔒 primebrick.dev/agent/cowork
Customer Entity — Session #42
Create a Customer entity with name, email, and status fields
🤖 AI Agent
I'll create the Customer entity. Here's my plan:
1. Schema: name, email, status
2. Migration: 00004_create_customers
3. API: 6 CRUD endpoints
4. RBAC: customers.* permissions
5. UI: list, detail, form pages
6. Tests: 12 scaffolds
Plan ready — 14 files to create/modify:
Ask the agent to build something...Send
// TRADITIONAL

IDE Mode

VS Code, Cursor, Windsurf

Clone, run locally, debug with breakpoints, full control. The traditional developer experience with all the framework conventions enforced by tooling.

entity.schema.ts — Primebrick IDE — Visual Studio Code
entity.schema.ts
router.ts
1// Entity definition
2export const Customer = entity({
3name: string().required(),
4email: string().unique(),
5status: enum(['active']),
6});
7
8// AI generated:
9✓ Migration + API + RBAC + UI + Tests
✓ No problemsUTF-8TypeScript®Ln 9, Col 1
Design-Free

Your frontend. Your components. Our conventions.

Primebrick is opinionated about architecture but design-free about UI. Use any component library — vanilla HTML, Svelte™, or our own Primebrick UI Library. The micro-frontend architecture lets you build any page with any component, while the framework enforces best practices.

1

Everything is an entity

Settings, configurations, metadata — all entities. The same CRUD, RBAC, and validation patterns apply everywhere.

2

Opinionated but design-free

Best practices enforced by the framework. But you choose the UI: vanilla HTML, Svelte™, or our Primebrick UI Library.

3

Primebrick UI Library

Our own component library with best practices built in. Use it directly or as a reference for your own components.

4

Micro-frontend architecture

Like microservices, but for the frontend. Each page is independent, deployable, and can use different component stacks.

A backoffice that starts with its own rules.

Every backoffice starts well and ends in chaos. Primebrick v3 flips the perspective: we start from best practices and enforce them through the framework.

1

Infrastructure as Code

K8s manifests, Helm™ charts, Terraform® templates ready for staging and production.

2

Layered architecture

Clean separation between domain, application, infrastructure, and UI. Testable by construction.

3

Opinionated coding rules

Linting, strict types, mandatory patterns: technical debt is prevented, not paid later.

4

Native observability

OpenTelemetry, structured logging, health-checks integrated from the first commit.

Everything you need. Nothing you don't.

We made the hard decisions once, so your teams don't make them every sprint. Every brick is tested, integrated, and documented.

/ AUTH

Identity & RBAC

OIDC, role management, granular schema-level permissions.

/ DATA

Persistence layer

PostgreSQL®: DB server AND vector server for generative AI. Soft-delete, audit fields, bulk operations.

/ UI

Backoffice engine

CRUD, tables, forms, filters generated from domain schemas.

/ OBS

Full observability

OpenTelemetry integrated, tracing, metrics, correlated logs.

/ MULTI

Multi-tenant ready

Logical and physical isolation for thousands of organizations.

/ SDK

Type-safe SDK

TypeScript® clients generated from endpoints, end-to-end type safety.

Modular by design

One brick at a time. Or all of them.

Every Primebrick module is a self-contained brick that follows the same shared standards. Start with the built-in bricks, then ship your own billing or inventory brick using the exact same pattern. The SDK and DAL do the heavy lifting; your module only declares its schema and its typed config.

Shared standards

ConfigEntityBase, ConfigLoader<TResult>, entity CRUD path conventions, OpenAPI meta — every brick inherits the same building blocks.

Schema isolation

Each module owns its own PostgreSQL® schema (auth, emailsender, billing…). No cross-module coupling at the data layer.

Self-describing

Modules expose /meta + /openapi.json. The BE proxy, the FE ConfigTable, and the MCP™ server all discover capabilities dynamically — no hard-coding.

Add without forking

A new module is one or more domain entity, one config table, one route file, one FE route. The reusable ConfigTable component renders its settings page automatically.

DB + Vector Server

PostgreSQL®: your database AND your vector server.

Primebrick uses PostgreSQL® not just as a database, but as a vector server for generative AI. No separate vector database to manage. More database support coming soon.

More database support coming soon
Vector similarity search
-- Find similar customers using vector embeddings
SELECT name, email,
embedding <=> $1 AS distance
FROM customers
WHERE status = 'active'
ORDER BY embedding <=> $1
LIMIT 5;
$
Real-Time Collaboration

Real-time collaboration no backoffice has ever had.

See who’s editing in real time. When a colleague saves, their changes merge into your form silently — field by field, never the whole entity. If you both touched the same field, you pick which value wins. No refresh, no lost work, always in sync.

Live presence avatars

See who is reading or editing the same record. Avatars show the field being edited and the value in progress, in real time.

Field-level merge

When a colleague saves, their changes merge into your form field by field. Untouched fields update silently with a transient green badge. No full-page reload.

Conflict resolution

Both editing the same field? The conflict panel shows your value, their value, and the original — side by side. Pick which wins, field by field.

Optimistic locking

State-of-the-art optimistic concurrency built in. No more silent overwrites, no more lost data — just safe, conflict-free saves.

Real-time stack: SSE + Redis® + NATS™ · Works on HTTP/1.1 or HTTP/2
One decorator to sync them all — zero config, ready from minute one
Enterprise-Ready

Optimized for enterprise and high traffic.

Primebrick scales from a single-container laptop setup to enterprise datacenters behind a load balancer. Thanks to Redis®, no matter how the infrastructure scales up or down, every piece stays in sync — cache invalidation, session state, and cross-instance coordination all flow through one reliable backbone.

Redis®-powered cache

Mark any entity with @Cached(ttl) and hot single-row reads go to Redis® first. Omit the TTL for immutable data; pick a TTL that bounds staleness for mutable data. Zero DAL coupling — the cache lives entirely in the SDK.

Always in sync

Redis® keeps every instance on the same page. Writes go to PostgreSQL® first, then invalidate the cache. Reads always hit fresh data — no stale entries, no race conditions, no surprises.

Multi-instance ready

Redis® is the shared cache. Pod #1 invalidates a key, pod #2 sees the miss and re-hydrates from PostgreSQL®. No NATS™ broadcaster needed. Scale the BE horizontally behind any LB — Docker®, K8s, Swarm, Azure® Container Apps, Cloud Run.

Zero vendor lock-in on cache too

Redis® is the only cache implementation shipped today, but the CachePort interface is open. Implement your own cache port for Memcached™, DragonflyDB™, or any KV store — no SDK changes needed.

Infrastructure

Every component, mapped.

From browser to database — clear ports, protocols, and data flow. Dockerized for local dev, Terraform®-ready for production.

HTTPHTTP /api/v1/OIDCcache · presenceLLM APINATS™ pub/subSSE proxy /ws/:codeSQL via DALregisterrate limitSQL via DALBrowserAdmin UI / API ClientsSvelteKit™port 5173Admin UI · SSRBackendExpress® · port 3001Auth · RBAC · ProxyMCP™ · SSE proxyseparate containerAI RuntimeQwen3™-4B-Instructmistral.rs™Vercel AI SDK™OpenAI®-compatibleport 8080 · ~2.5GB RAM · no GPURedis®port 6379cache · presencerate limit · sessionCasdoor™OIDC · port 8000Auth · RBAC · SSOMicroservicesAI · Email · dynamicBun™ · port autoauto-register via NATS™NATS™port 4222pub/sub · service discoveryPostgreSQL®port 5432pgvector™ — vector DBembeddings · similarity · single data store
AI Knowledge Pipeline

From MDX docs to RAG — end to end.

Docs are written as MDX in each repo, synced by CI, embedded locally with Transformers.js™, and stored in pgvector™. The AI microservice retrieves context and sends prompts to a separate LLM container — no cloud calls by default.

AI Knowledge Pipeline — from MDX docs to RAGRepos (MDX)backend/docs/*.mdxfrontend/docs/*.mdxmicroservices/docs/*.mdxsdk · dal/docs/*.mdxCI SyncGitHub™ Actionscollects MDXfrom all reposEmbeddingTransformers.js™MDX → vectorchunk + embedpgvector™PostgreSQL® extvector storesimilarity searchAI MicroserviceRAG querycontext retrievalprompt assemblyseparate containerLLMQwen3™-4Bmistral.rs™port 8080~2.5GB RAMpushMDXvectorssimilaritypromptresponseSSE stream response → Backend → BrowserShared Libraries — every runtime component depends on theseBackendExpress® · port 3001Auth · RBAC · Proxy · MCP™MicroservicesAI · Email · dynamicBun™ · auto-register@primebrick/sdkNATS™ · cache · presencehealth · rate limit@primebrick/dalpool · repositoryaudit · soft-deleteusesusesHow RAG works — end to end① WRITEDocs written as MDXin each repo's docs/folder — architecture,API, guides, rules② SYNCCI collects all MDXfrom every repo onpush — DeepWikienriches with AI③ EMBEDTransformers.js™chunks MDX andgenerates vectorembeddings locally④ STOREVectors stored inpgvector™ (PostgreSQL®extension) — noseparate vector DB⑤ QUERYAI MS retrieves relevantcontext via similaritysearch, assemblesprompt + context⑥ GENERATELLM (elsewhere)generates answerstreamed via SSEto browser
Architecture

Layered by design.

Frontend, Backend, Microservices, Libraries, Data — each layer has a clear responsibility and communicates through defined protocols.

1

Frontend

SvelteKit™ Admin UI — communicates only with the Backend API

2

Backend

Express® API — Auth, RBAC, Service Registry, Proxy

3

Microservices

Independent Docker® services — self-register via NATS™

4

Libraries

@primebrick/sdk + @primebrick/dal-pg — shared across all services

5

Data

PostgreSQL® — single data store, accessed via DAL

Accessibility

WCAG, VPAT & ARIA. Tested, not promised.

Primebrick is built accessibility-first. Automated WCAG 2.x + ARIA auditing runs on every route via axe-core. A downloadable VPAT 2.5 INT conformance report covers WCAG 2.0/2.1/2.2 (A/AA/AAA), Section 508, and EN 301 549 — so your compliance team has real evidence, not marketing claims.

WCAG 2.2 A/AA/AAA

Automated axe-core scans on every route, every build. Level A, AA, and AAA success criteria tested continuously.

VPAT 2.5 INT Report

Downloadable Voluntary Product Accessibility Template covering WCAG, Section 508, and EN 301 549. Generated from real scan data.

ARIA compliance

Full ARIA roles, states, and properties validated. Screen-reader-compatible components out of the box.

Section 508 & EN 301 549

US Section 508 (Chapters 3–6) and EU EN 301 549 (Clauses 4–13) covered in the INT edition report.

Enforced Security

Passkeys, WebAuthn & MFA. Built in, not bolted on.

Primebrick enforces modern authentication best practices. Passkey support via WebAuthn means users authenticate with Windows Hello™, Face ID™, or Touch ID™ — no passwords to phish, no OTP codes to intercept. Multi-factor authentication is integrated at the identity layer, not added as an afterthought.

Passkeys (WebAuthn)

FIDO2/WebAuthn passkey authentication. Phishing-resistant by design — no shared secrets, no replay attacks.

Windows Hello™

Biometric and PIN authentication on Windows 10/11 via Windows Hello™. No password required.

Face ID™ & Touch ID™

Biometric authentication on macOS and iOS via Face ID™ and Touch ID™. Seamless, secure, native.

MFA everywhere

Multi-factor authentication enforced at the identity provider (Casdoor™/OIDC). TOTP, hardware keys, and passkeys supported.

Security Posture

Critical actions require re-authentication. Always.

Primebrick enforces a strict security posture: every critical action — changing a user password, modifying RBAC permissions, altering security settings — requires an in-app security guard with admin re-login and MFA verification. No session reuse, no silent elevation. This follows NIST SP 800-63B step-up authentication and OWASP ASVS V3.4 session management requirements.

In-app security guard

Critical actions trigger an in-app modal requiring admin credentials + MFA. No action proceeds without fresh verification.

Step-up authentication

Following NIST SP 800-63B: sensitive operations require a fresh authentication event, not just an existing session.

No session reuse

Existing JWT/session tokens are insufficient for critical actions. A new MFA challenge is always required.

OWASP ASVS aligned

Meets OWASP Application Security Verification Standard V3.4 (session management for high-value transactions).

Security Compliance

ISO 27001 & NIS2. Scanned, not self-reported.

An automated compliance scanner reads the Primebrick source code on every build and maps security controls to ISO 27001 Annex A, NIS2 Article 21(2), and OWASP Top 10 — with file:line evidence for each control. No manual questionnaires, no self-assessment spreadsheets. Download the full report as PDF and see exactly what is compliant, what is partial, and where the evidence lives.

ISO 27001 Annex A

17 controls mapped to Annex A (A.5, A.6, A.8) with evidence: RBAC, audit trail, encryption, access control, and more.

NIS2 Article 21(2)

All 10 mandatory security measures covered: incident management, business continuity, supply chain security, cryptography.

OWASP Top 10

Injection, auth failures, cryptographic failures, misconfiguration — mapped to actual code patterns with evidence.

Downloadable PDF report

Full compliance report generated as PDF on every build. Hand it to your auditors, compliance team, or security reviewers.

GDPR & CCPA

Data privacy by design. With evidence.

Primebrick implements GDPR and CCPA requirements at the code level: multi-tenant data isolation, soft-delete with recovery, audit trails for Article 30 records, data minimization via field-level access control. The automated scanner verifies these controls against the actual source code and produces a compliance report you can download.

GDPR Article 32

Security of processing: encryption in transit, multi-tenant isolation, audit trails. Verified by code pattern scanning.

GDPR Article 17

Right to erasure: soft-delete with deleted_at column and restore capability. Data is recoverable, not destroyed.

CCPA §1798.150

Consumer data protection: access controls, audit trails, and data minimization mapped to California Consumer Privacy Act.

Article 30 records

Automated audit trail logging satisfies GDPR Article 30 record-of-processing requirements. Every CRUD operation is logged.

Less boilerplate, more value.

Clear structure, objective coding rules, DX designed for speed. Clone, run, and you're already in a best-practice environment — CI/CD, linting, types, tests, observability all ready.

  • Onboarding in hours, not weeks
  • Zero discussions about "how we do things here"
  • Modern, typed, tested stack

Software selection without risk.

MIT license, open and inspectable code, deploy where you decide. Reduce time-to-market and technical debt from minute zero. No vendor lock-in, no contractual surprises.

  • Free commercial use (MIT)
  • Host it where needed: cloud or on-prem
  • Verifiable standards, not promises

Open source. Even for commercial use.

Primebrick v3 is released under the MIT license: you can use, modify, redistribute, and integrate it in commercial products without royalties. Code is public on GitHub®, design decisions are documented, contributions are welcome.

Build your next backoffice with the right rules.

Clone the repo, follow the quick-start, and you're in production with an architecture your future developers will thank you for choosing.

Read the architecture