Open-source BaaS with a single Go runtime, embedded dashboard, PostgreSQL data plane, AI tooling, and self-host-first deployment paths.
OzyBase is a PostgreSQL-backed Backend-as-a-Service that ships as:
- a Go API server
- an embedded React dashboard
- a dynamic collections/data API
- authentication and API key management
- storage, realtime, webhooks, cron, vault, and edge functions
- security hardening, observability, integrations, and admin audit tooling
- AI-facing runtime endpoints for MCP, NLQ, and pgvector workflows
The repo is designed for self-hosting first: local binary, Docker, install-to-play, and Coolify-style managed Postgres deployments are all supported.
| Target | Status | Recommended for | Notes |
|---|---|---|---|
| Local PC | Stable | Development, QA, demos | Run API + frontend locally with one PostgreSQL instance. |
| Self-hosted Docker | Stable | Real apps on a single node | Shared DB runtime, full admin panel, quotas, storage, realtime, MCP. |
| Coolify | Recommended | The default production path for most users | OzyBase is intentionally optimized for Coolify-style managed Postgres + persistent volumes. |
| Cloud / enterprise control plane | Future track | Dedicated DB, managed billing, PITR UX, replicas | Not part of the self-hosted OSS contract today. |
In self-hosted mode, OzyBase keeps workspace as an internal backend entity but presents it as Project in the UI.
| Concept | Self-hosted behavior |
|---|---|
| Project | Logical scope only |
| PostgreSQL database | Shared physical DB for the whole installation |
| Schema provisioning | Not automatic |
| Bucket provisioning | Not automatic |
| Team members | Scoped by project |
| API keys | Scoped by project |
| Saved views | Scoped by project |
| MCP context | Scoped by project |
| Usage & limits | Scoped by project |
What this means in practice:
- selecting a project stores
ozy_workspace_idin the frontend - frontend sends the project context on internal requests
- backend validates membership and role
- reads, metadata, keys, usage, and quotas are applied inside that scope
This gives self-hosted users one installation that can serve multiple projects without pretending that every project is a separate PostgreSQL deployment.
| Topic | Doc |
|---|---|
| Local development on your PC | docs/LOCAL_DEVELOPMENT.md |
| Coolify deployment | docs/COOLIFY_DEPLOYMENT.md |
| Self-hosted project/workspace model | docs/SELF_HOSTED_PROJECTS.md |
| Usage, quotas, and limits | docs/USAGE_LIMITS.md |
| Feature matrix and frontend-admin surfaces | docs/FEATURE_MATRIX.md |
| Architecture gap analysis and hardening priorities | docs/ARCHITECTURE_CRITICAL_REVIEW.md |
| Final validation plan for project semantics and control plane | docs/PROJECT_SEMANTICS_CONTROL_PLANE_VALIDATION.md |
| GitHub Actions / CI / release validation | docs/GITHUB_ACTIONS.md |
| Production deployment runbook | docs/DEPLOYMENT.md |
| Deployment profiles | docs/DEPLOYMENT_PROFILES.md |
The security notification card for pending access requests now performs a complete action path instead of only opening a generic section.
What changed:
- Notification payload now includes a valid action destination (
security) and an explicit action target (access_requests). - Notification click handling now validates the target view before navigation and falls back safely when needed.
- A cross-component navigation intent event is emitted when the notification target is access validation.
- Security Hub now listens for that intent and auto-scrolls to the
Access Requestsblock where admins can approve or reject immediately.
Updated frontend files:
frontend/src/components/Layout.tsxfrontend/src/components/SecurityDashboard.tsx
Validation executed:
npm --prefix frontend run buildResult: build completed successfully after the navigation/scroll integration.
OzyBase now supports an outer-wall firewall middleware driven by environment variables.
- Default behavior:
OZY_FIREWALL_MODE=off(disabled) - Dry run:
OZY_FIREWALL_MODE=log-only(never blocks, logs what would be blocked) - Strict mode:
OZY_FIREWALL_MODE=enforce(hard blocks with HTTP 403) - Rule precedence:
- Internal bypass (
127.0.0.1,/api/health,/api/project/health) - IP deny list (
OZY_BLOCKED_IPSorOZY_DENIED_IPS) - IP allow list (
OZY_ALLOWED_IPS) with Geo check bypass - Country deny/allow (
OZY_BLOCKED_COUNTRIES,OZY_ALLOWED_COUNTRIES) - Default allow
- Internal bypass (
X-Forwarded-Foris trusted only whenRemoteAddrbelongs toOZY_TRUSTED_PROXIES- If proxy is not trusted, middleware uses socket remote IP directly
- Country checks use local MaxMind DB path from
OZY_MAXMIND_DB - If Geo rules are configured and DB is missing/corrupt:
enforce: startup fails (fail-closed)log-only: startup continues and logs warning ([FIREWALL_LOG])
OZY_FIREWALL_MODE=off|log-only|enforceOZY_ALLOWED_IPS=192.168.1.0/24,200.48.10.5OZY_BLOCKED_IPS=203.0.113.0/24OZY_DENIED_IPS=203.0.113.0/24(alias)OZY_TRUSTED_PROXIES=127.0.0.1/32,10.0.0.0/8OZY_ALLOWED_COUNTRIES=PEOZY_BLOCKED_COUNTRIES=RU,CNOZY_MAXMIND_DB=./internal/geoip/GeoLite2-Country.mmdbOZY_FIREWALL_AUDIT_HEADER=true(addsX-Ozy-Firewallresponse header)OZY_FIREWALL_DYNAMIC_CACHE_SECONDS=3(refresh interval for_v_ip_rulescache)
The middleware now combines strict ENV policy with dynamic DB rules from _v_ip_rules.
- Dynamic rule source:
_v_ip_rules(ALLOW/BLOCK, supports single IP and CIDR) - Active rule filter: expired rows are ignored (
expires_at <= NOW()) - In-memory cache: refreshed every
OZY_FIREWALL_DYNAMIC_CACHE_SECONDS - Near-instant updates: cache is invalidated on
POST /api/security/firewallandDELETE /api/security/firewall/:id
Dynamic precedence inside IP checks:
- ENV deny
- Dynamic deny
- Dynamic allow
- ENV allow
Firewall blocks are now recorded for Security Hub charts.
- Hot path: in-memory atomic counters (very low overhead)
- Persistence: async flush to
_v_security_stats(when storage ispostgres) - Aggregation dimensions:
reason,country_code,source_ip - Time bucket: hourly (
bucket_start)
New variables:
OZY_SECURITY_METRICS_STORAGE=postgres|memoryOZY_SECURITY_METRICS_FLUSH_SECONDS=300OZY_SECURITY_METRICS_FLUSH_THRESHOLD=500
Security Hub endpoint:
GET /api/security/firewall/metrics?hours=24
Response includes:
total_blockedby_reasontop_countriestop_ipspending_buffer
Validation executed on 2026-04-10:
go test ./internal/api -run Firewall -count=1
ok github.com/Xangel0s/OzyBase/internal/api 0.210s
go test ./cmd/ozybase -count=1
ok github.com/Xangel0s/OzyBase/cmd/ozybase 0.133sCovered cases in internal/api/firewall_test.go:
- deny precedence over allow
- allow list bypasses Geo check
- country restriction block
- fail-closed behavior for Geo lookup errors in
enforce log-onlybehavior (no block)- trusted proxy forwarding vs untrusted forwarding
OzyBase includes a first-run wizard with three real paths:
Do it myself: creates the first admin and leaves policies/manual hardening for laterSecure Fortress: creates the first admin, seeds geo-fencing from the detected country, and writes a secure bootstrap audit eventMigration Studio: translates supported inputs into PostgreSQL during setup and can import the initial dataset
Migration Studio currently supports:
CSVMongo-like JSONMySQL SQLSQLite SQLSQL Server SQLPostgres SQL
Setup-time migration preview endpoint:
POST /api/system/setup/migration/preview
Implemented auth features include:
- email/password login
- admin-managed user creation
- password reset request/confirm flow
- email verification
- session listing, single-session revoke, and revoke-all
- TOTP-based 2FA
- OAuth entry points and callbacks
- auth provider config, auth templates, and auth settings views
- role-based user management
- CSRF token endpoint and security-header middleware
Core auth routes:
POST /api/auth/loginPOST /api/auth/signupPOST /api/auth/reset-password/requestPOST /api/auth/reset-password/confirmGET|POST /api/auth/verify-emailGET /api/auth/usersPATCH /api/auth/users/:id/roleGET /api/auth/sessionsDELETE /api/auth/sessions/:idPOST /api/auth/sessions/revoke-allPOST /api/auth/2fa/setupPOST /api/auth/2fa/enablePOST /api/auth/2fa/disableGET /api/auth/2fa/statusPOST /api/auth/2fa/verify
The database layer includes:
- dynamic collection creation and deletion
- schema inspection and schema visualizer
- CRUD for collection records
- table-style CRUD aliases for dashboard flows
- CSV import from the dashboard/API
- bulk row actions
- column creation and deletion
- saved table views
- realtime toggles per collection
- SQL editor execution and system sync endpoint
- GraphQL endpoint
- wrappers/extensions management for advanced PostgreSQL capabilities
Key routes:
POST /api/collectionsGET /api/collectionsDELETE /api/collections/:nameGET /api/collections/schemasGET /api/collections/visualizePATCH /api/collections/rulesPATCH /api/collections/realtimeGET /api/collections/:name/recordsPOST /api/collections/:name/recordsPATCH /api/collections/:name/records/:idDELETE /api/collections/:name/records/:idPOST /api/tables/:name/importPOST /api/sqlPOST /api/sql/syncPOST /api/graphql/v1
Projects are powered by the workspace engine and behave as logical scopes in self-hosted mode.
| Capability | Status in self-hosted OSS |
|---|---|
| Create/list/update/delete project | Yes |
| Members and roles | Yes |
Active project routing via X-Workspace-Id |
Yes |
| Collection metadata scoping | Yes |
| API key scoping | Yes |
| Saved view scoping | Yes |
| MCP context scoping | Yes |
| Usage & limits by project | Yes |
| Dedicated PostgreSQL database per project | No |
| Dedicated schema per project | No |
| Dedicated physical bucket per project | No |
This is the simplest stable contract for the self-hosted product.
| Area | Runtime plane | Control plane |
|---|---|---|
| Authentication execution | Yes | No |
| Table and record CRUD | Yes | No |
| SQL execution | Yes | No |
| Storage reads/uploads/deletes | Yes | No |
| Realtime event delivery | Yes | No |
| Function invocation | Yes | No |
| MCP runtime tools | Yes | No |
| Project lifecycle | No | Yes |
| Members and roles | No | Yes |
| Usage accounting | No | Yes |
| Limits and warnings | Runtime consumes rules | Yes |
| Capability exposure | Runtime reads it | Yes |
| Future provisioning contracts | No | Yes |
Near-term direction:
- keep
Projectsemantics closed and explicit in self-hosted - keep governance rules centralized in the control plane
- let runtime modules consume those rules instead of redefining them
- if the product grows into cloud/enterprise later, extract this governance layer into a more explicit module instead of spreading it across features
Core routes:
POST /api/workspacesGET /api/workspacesPATCH /api/workspaces/:idDELETE /api/workspaces/:idGET /api/workspaces/:id/membersPOST /api/workspaces/:id/membersDELETE /api/workspaces/:id/members/:userIdGET /api/workspaces/:id/usageGET /api/workspaces/:id/limitsPATCH /api/workspaces/:id/limits
Storage features implemented today:
- bucket create/list/update/delete
- local filesystem storage
- S3-compatible storage
- signed upload sessions
- multipart upload sessions and part upload flow
- bucket max file size enforcement
- bucket total quota enforcement
- lifecycle deletion windows and sweep endpoint
- bucket policy inspection from the dashboard
Runtime-guaranteed ACL profiles today are:
- visibility/public-read
- owner only
- admin only
- deny all
Custom legacy expressions can still exist, but the runtime only guarantees the built-in profiles above when ACLs are edited.
Core storage routes:
GET /api/files/bucketsPOST /api/files/bucketsPATCH /api/files/buckets/:nameDELETE /api/files/buckets/:namePOST /api/files/uploads/sessionPOST /api/files/uploads/multipart/sessionPUT /api/files/uploads/multipart/:id/parts/:partPOST /api/files/uploads/multipart/:id/completeDELETE /api/files/uploads/multipart/:idGET /api/filesGET /api/files/:bucket/*DELETE /api/files/:bucket/*
OzyBase includes:
- edge functions
- JavaScript runtime via
goja - WASM runtime via
wazero - webhook endpoints and webhook management
- cron management
- vault/secret storage
- PostgreSQL wrappers/extensions controls
Function runtimes supported today:
jswasm
Core routes:
GET /api/functionsPOST /api/functionsPOST /api/functions/:name/invokeDELETE /api/functions/:nameGET /api/webhooksPOST /api/webhooksDELETE /api/webhooks/:idGET /api/cronPOST /api/cronPOST /api/cron/enableDELETE /api/cron/:idGET /api/vaultPOST /api/vaultDELETE /api/vault/:idGET /api/wrappersPOST /api/wrappersDELETE /api/wrappers/:name
Operational/runtime features implemented:
- SSE realtime stream
- local broker plus Redis pub/sub bridge for multi-node fan-out
- realtime status endpoint
- project stats/info/connection metadata
- project health checks and guided fix/review actions
- logs and log export
- traffic and geo analytics endpoints
- Prometheus metrics endpoint
- performance advisor and advisor history
- update status endpoint
- SLO status endpoint
- storage observability endpoint
- alert routing/on-call config
Core routes:
GET /api/project/statsGET /api/project/infoGET /api/project/connectionGET /api/project/update-statusGET /api/realtimeGET /api/project/realtime/statusGET /api/project/healthPOST /api/project/health/fixPOST /api/project/health/reviewGET /api/analytics/trafficGET /api/analytics/geoGET /api/project/logsGET /api/project/logs/exportGET /api/project/metricsGET /api/project/performance/advisorGET /api/project/performance/advisor/historyGET /api/project/observability/sloGET /api/project/observability/storageGET /api/project/security/alert-routingPOST /api/project/security/alert-routing
Security capabilities in the current codebase include:
- geo-fencing security policy
- security policy CRUD
- health-derived security alerts
- notification recipients
- firewall/IP rules
- admin audit trail
- RLS coverage inspection
- RLS mass enforcement
- RLS closeout flow
- API key creation/rotation/toggle/delete
- essential key vault with reveal/rotate/verify endpoints
Core routes:
GET /api/project/security/policiesPOST /api/project/security/policiesGET /api/project/security/statsGET /api/project/security/alertsGET /api/project/security/notificationsPOST /api/project/security/notificationsDELETE /api/project/security/notifications/:idGET /api/project/security/rls/coverageGET /api/project/security/rls/coverage/historyPOST /api/project/security/rls/enforcePOST /api/project/security/rls/closeoutGET /api/project/security/advisor/scanPOST /api/project/security/advisor/fixGET /api/security/advisor/scanPOST /api/security/advisor/fixGET /api/project/security/admin-auditGET /api/security/firewallPOST /api/security/firewallDELETE /api/security/firewall/:idPOST /api/security/sessions/terminate-by-ipPOST /api/security/sessions/terminate-by-countryPOST /api/project/security/sessions/terminate-by-ipPOST /api/project/security/sessions/terminate-by-countryGET /api/project/keysGET /api/project/keys/essentialPOST /api/project/keys/essential/verifyPOST /api/project/keys/essential/:role/revealPOST /api/project/keys/essential/:role/rotate
Implemented integration capabilities:
- project integrations list/create/delete/test
- delivery metrics
- DLQ inspection and retry
- security/integration delivery workers
- extension marketplace sync/install/uninstall
Core routes:
GET /api/project/integrationsPOST /api/project/integrationsDELETE /api/project/integrations/:idPOST /api/project/integrations/:id/testGET /api/project/integrations/metricsGET /api/project/integrations/dlqPOST /api/project/integrations/dlq/:id/retryGET /api/extensionsPOST /api/extensions/:nameGET /api/extensions/marketplacePOST /api/extensions/marketplace/syncPOST /api/extensions/marketplace/:slug/installDELETE /api/extensions/marketplace/:slug/install
OzyBase exposes an AI-facing admin runtime directly over HTTP.
Implemented today:
- pgvector status/setup/upsert/search
- natural language to SQL translate/query
- MCP JSON-RPC endpoint
- MCP helper endpoints for tools listing and invoke
- VS Code remote MCP configuration support
Core routes:
GET /api/project/vector/statusPOST /api/project/vector/setupPOST /api/project/vector/upsertPOST /api/project/vector/searchPOST /api/project/nlq/translatePOST /api/project/nlq/queryPOST /api/project/mcpGET /api/project/mcp/toolsPOST /api/project/mcp/invoke
Current built-in MCP tools include:
system.healthcollections.listcollections.createvector.statusnlq.translatenlq.query
See docs/MCP_VSCODE.md for editor setup.
The README should reflect the product honestly, so these constraints are explicit:
Migration Studiocurrently works from pasted/uploaded input during setup. It is not yet a live remote connector for MySQL, SQL Server, or Mongo deployments.- workspace scope is real for membership and dashboard metadata, but it does not auto-create isolated physical infrastructure
- the public npm JS/TS SDK package is still pending; the supported path today is direct HTTP plus generated types
- storage ACL composition is intentionally narrower than a full arbitrary-policy builder at edit time
git clone https://github.com/Xangel0s/OzyBase.git
cd OzyBase
go run ./cmd/ozybasedocker compose up -d --buildUse docker-compose.install.yml.
Required environment values:
SITE_URLAPP_DOMAINDB_PASSWORD
Common visible DB values:
DB_USERdefaultozybaseDB_NAMEdefaultozybaseDB_SSLMODEdefaultdisable
Use docker-compose.coolify.yml.
Required:
DATABASE_URLSITE_URLAPP_DOMAIN
At minimum for a serious deployment, set:
PORT=8090
SITE_URL=https://api.example.com
APP_DOMAIN=example.com
ALLOWED_ORIGINS=https://app.example.com,https://api.example.com
JWT_SECRET=<64-byte-random-secret>
DATABASE_URL=postgres://user:pass@db.example.com:5432/ozybase?sslmode=require
DB_POOLER_URL=postgres://user:pass@pool.example.com:6543/ozybase?sslmode=require
RATE_LIMIT_RPS=20
RATE_LIMIT_BURST=20
DEBUG=falseUseful optional settings:
OZY_STORAGE_PROVIDER=local|s3OZY_STORAGE_PATHS3_ENDPOINT,S3_ACCESS_KEY,S3_SECRET_KEY,S3_USE_SSLOZY_REALTIME_BROKER=local|redisREDIS_ADDR,REDIS_PASSWORD,REDIS_DBSMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,SMTP_FROMINITIAL_ADMIN_EMAIL,INITIAL_ADMIN_PASSWORDOZY_STRICT_SECURITY=true
Detailed deployment runbook: docs/DEPLOYMENT.md
The public CLI utilities available in this repo include:
ozybase init
ozybase version
ozybase upgrade
ozybase functions init helloThere are also helper binaries in cmd/ for benchmarking and password/admin maintenance.
The repo includes backend, frontend, smoke, and deployment validation paths. Common release checks:
go test ./...cd frontend
npm run lint
npm run typecheck
npm run buildpowershell -NoProfile -ExecutionPolicy Bypass -File scripts/validate_enterprise.ps1 -SkipE2E
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/run_frontend_qa.ps1Additional operational validations live in:
scripts/validate_external_stack.ps1scripts/validate_multinode_stack.ps1scripts/validate_https_smtp_stack.ps1scripts/smoke_api.shscripts/smoke_post_deploy.shscripts/deploy_canary.shscripts/disaster_drill.sh
- docs/DEPLOYMENT.md
- docs/DEPLOYMENT_PROFILES.md
- docs/MCP_VSCODE.md
- docs/PERFORMANCE_BENCHMARKS.md
- docs/SECURITY_SUITE.md
- docs/SECURITY_NOTIFICATIONS.md
- docs/PROJECT_STATUS_MASTER.md
- docs/ROADMAP.md
- docs/ARCHITECTURE_CRITICAL_REVIEW.md
- docs/PROJECT_SEMANTICS_CONTROL_PLANE_VALIDATION.md
- CHANGELOG.md
Developed by Xangel0s.