Aller au contenu

OpsAPI

One self-hosted API for sign-in, workspaces and business modules.

OpsAPI signs your users in once for every app, keeps each customer's data in its own workspace, and switches on the business modules a product needs, from CRM to UK tax filing. It is open source and runs on your own infrastructure.

Stop building a backend per product

Most teams that run several products end up with several backends, each with its own login, user table, roles and admin screens. OpsAPI replaces them with one. Sign-in, two-factor codes, Google, Apple and SAML single sign-on, workspaces, roles and API keys are always on. On top sit 20 business modules: CRM, invoicing, accounting, UK tax filing, kanban, chat, e-commerce, CMS, forms, hiring and more. One setting, PROJECT_CODE, chooses which modules a deployment loads; the rest have no routes and no tables. OpsAPI is built and run by Workstation, the company behind TenthMatrix, and it is the API this website's blog and contact form use.

How OpsAPI fits together

OpsAPI system overview: admin dashboard, web apps, mobile apps and scripts call an edge proxy, which forwards to the OpsAPI container (Nginx workers, before_filter, middleware, routes, queries, models) backed by PostgreSQL, Redis, MinIO or S3, Kafka, an LLM provider, Prometheus and external APIs
Clients reach one OpenResty container through the edge. Lua runs inside the Nginx workers, so a request never hops to a separate app server. Dashed lines are connections made as needed: Redis, MinIO, Kafka and the model provider are optional, and a minimal deployment needs only PostgreSQL.

Four things it does for every product

  • One sign-in for every app

    Email and password with lockout and rate limits, emailed two-factor codes, Google, Apple, SAML 2.0 and a hosted sign-in page. Any app checks a token with one call: /auth/me.

  • Workspaces from the first table

    Each customer is a workspace with its own members, roles, invitations, mail settings and AI provider. Every query is scoped to the workspace.

  • 20 business modules

    Switch on CRM, invoicing, accounting, tax filing, kanban, chat, e-commerce, CMS, forms, hiring and more, per deployment, with 16 ready-made presets.

  • Built to be run

    One Docker image, a Helm chart with a migration job, health probes, Prometheus metrics, Grafana dashboards, an audit trail and a catalogue of error codes.

One request, from client to database

  1. Edge

    TLS ends at the edge proxy, which routes by host name to the OpsAPI container.

  2. Authenticate

    Public paths skip sign-in; every other request needs a JWT or an opsk_ API key.

  3. Pick the workspace

    From a header, the token or the subdomain. Unknown, suspended or non-member: the request stops.

  4. Check the permission

    module.action permissions per role. Missing permission: 403.

  5. Run the module

    Only modules switched on by PROJECT_CODE have routes. Others answer 404 for everyone.

  6. Réponse

    Queries scoped to the workspace, a JSON reply, and any error returned with a code and a correlation id.

What is in the box

48 capabilities in five groups. Sign-in, workspaces and the platform layer are always on; business modules are switched per deployment.

  • SAML single sign-on per workspace

    Each workspace connects its own identity provider, such as Okta, Entra ID, Google Workspace, OneLogin or Keycloak. Accounts are created on first sign-in and matched by email domain.

  • Roles and permissions

    Owner, admin and member roles are seeded in every workspace. Permissions are module.action pairs, and the dashboard menu follows them.

  • API keys and audit

    Long-lived keys for servers and scripts, scoped to a workspace. Sign-in events, user activity and an audit trail of changes per workspace.

  • Signed webhooks

    Workspaces send their events to their own URLs, signed with HMAC-SHA256 and a timestamp, and retried for up to eight attempts.

  • Headless CMS

    Pages and blog posts with media and categories. Publishing calls a signed webhook, so a static website rebuilds itself.

  • UK tax filing (HMRC MTD)

    Bank statement extraction, AI classification and Making Tax Digital submission with the anti-fraud headers HMRC requires.

  • Plugins

    Drop a folder of Lua in and it gets sign-in, workspaces, roles, migrations, dashboard pages, event listeners and scheduled jobs.

  • TypeScript SDK and OpenAPI

    @opsapi/client gives typed calls for every endpoint, sign-in with two-factor, pagination, retries and webhook checks. The spec is at /openapi.json.

  • Secret vault

    Encrypted secrets per workspace with pluggable vault providers.

The business modules

Each module is a feature flag. A switched-off module is absent, not hidden: its addresses answer 'not found' and its tables are never created.

  • CRM

    Accounts, contacts, deals, pipelines, activities and public lead capture.

  • Invoicing and accounting

    Invoices, PDFs and payments; bookkeeping, VAT returns and trial balance with AI-assisted categorisation.

  • UK tax filing

    Statement extraction, AI classification and HMRC Making Tax Digital submission.

  • Kanban and timesheets

    Projects, boards, sprints, epics, tasks and time tracking, with time entry and approval.

  • Chat and notifications

    Channels, mentions and reactions with an AI agent, plus push delivery through FCM and APNs.

  • E-commerce and delivery

    Stores, products, carts, orders and Stripe payments; delivery partners, pricing and assignments.

  • CMS and forms

    Website pages and blog posts with rebuild webhooks; public forms whose responses become records.

  • Field service

    Service requests, jobs, site visits, assets, parts, contracts and reports.

  • Hiring

    Jobs and candidates, with AI first-round interviews.

  • Academy

    Courses, lessons, instructors and paid enrolment.

  • Hospital and care

    Hospitals, wards, patients, care plans, medications and care logs, with access controls.

  • Billing and entitlements

    Apps, plans, subscriptions, entitlement checks and signed licence keys.

Safe by default

OpsAPI holds the logins and the data of every product that uses it, so the defaults are strict.

  • Passwords are hashed with bcrypt, with lockout after failed attempts and per-IP rate limits.
  • Short-lived JWTs, rotating refresh tokens in an HttpOnly cookie, and tokens issued only to allowed origins.
  • SAML responses that are tampered, wrapped, unsigned, replayed, expired or signed with SHA-1 are refused.
  • Every query is scoped to the workspace; platform admins are still scoped to the workspace they name.
  • Workspace owners decide whether members need two-factor codes. Platform admins always do.
  • The admin dashboard is designed to sit behind a VPN or zero-trust broker, not on the open internet.

Pick the modules per deployment

Choose one preset with PROJECT_CODE, or combine them, for example ecommerce,collaboration. Sign-in, workspaces and roles are always included. There are 16 presets in all.

  • business

    Running a company

    CRM, timesheets, invoicing, accounting, kanban, notifications and forms.

  • tax_copilot

    UK tax filing

    The HMRC Making Tax Digital module with notifications.

  • ecommerce

    Selling online

    E-commerce, delivery, reviews, shop, notifications and forms.

  • field_service

    Field teams

    Field service, e-commerce, timesheets, invoicing, notifications and forms.

  • hospital

    Care providers

    Hospital and care, notifications and forms.

  • core_only

    Identity only

    Sign-in, workspaces and roles, for a single sign-on service across your own apps.

Lua inside Nginx, PostgreSQL underneath

OpsAPI is a Lapis application that runs inside OpenResty's Nginx workers. A minimal deployment needs only PostgreSQL; Redis, MinIO, Kafka and an AI model are optional.

  1. Clients

    The admin dashboard, your web and mobile apps, servers and scripts, all on the same API and the same sign-in.

  2. OpenResty workers

    Lua runs in the Nginx worker processes: no proxy hop and no separate app server.

  3. Modules per deployment

    The PROJECT_CODE preset decides which modules load. A module that is not loaded has no routes and no tables.

  4. Services

    PostgreSQL with pgvector for every table, plus optional Redis, MinIO or S3, Kafka, Ollama or a hosted model, and Prometheus.

Diagrams and workflows

From the OpsAPI technical notes on opsapi.org.

opsapi.org home page: One API for sign-in, tenants and business modules, with the start.sh, health check and Swagger commands
Up and running in three commands. start.sh brings up the API, the dashboard, PostgreSQL and the rest of the stack. /health tells you it is up, and /swagger lists every endpoint.
Sign-in sequence between the browser, your app, OpsAPI and Google: nonce, redirect to the hosted sign-in page, optional Google consent, signed JWT, redirect back, then GET /auth/me
Single sign-on for any app. The app saves a nonce, sends the user to OpsAPI's hosted sign-in page, receives a signed token, checks the nonce and asks /auth/me who the user is.
Matrix of PROJECT_CODE presets against the business modules each one switches on
Which modules each PROJECT_CODE preset switches on. Presets combine, for example ecommerce,collaboration, and every preset includes sign-in, workspaces, roles, API keys, webhooks, audit and plugins.
How OpsAPI picks the workspace from headers, the JWT or the subdomain, then checks it exists, is active and that the user is a member
How each request picks its workspace and checks access. Every failed check ends the request.
Resources the OpsAPI Helm chart creates: ingress, service, API pods, Postgres StatefulSet, ExternalSecret from a secrets vault, reloader, migrate job and backup CronJobs
What the Helm chart runs on Kubernetes: API pods with probes, PostgreSQL with pgvector, secrets synced from a vault, a pre-upgrade migration job and hourly and daily backups.

Running in minutes

Run the bwalia/opsapi image from Docker Hub with PostgreSQL, or clone the repository and bring up the API, dashboard, PostgreSQL, Redis, MinIO, Kafka, Grafana and Prometheus with one script. For production, the Helm chart runs migrations before each upgrade and drains pods gracefully.

Read the README

The product site

Features, architecture, a live read-only demo and 14 technical notes for developers and DevOps.

opsapi.org

Questions fréquentes

Is OpsAPI free?

OpsAPI is open source and self-hosted, so there is no per-user fee. You run the PostgreSQL database, take its backups, upgrade OpsAPI and monitor it yourself, or ask TenthMatrix to do it for you.

What does it run on?

OpenResty (Nginx with LuaJIT), the Lapis framework and PostgreSQL. Redis, MinIO or S3, Kafka and a model provider are optional; a minimal deployment needs only PostgreSQL. It ships as one Docker image and a Helm chart.

Can different customers see each other's data?

Each customer is a workspace, and every query is scoped to it. A request with no workspace, an unknown or suspended workspace, or a user who is not a member is refused before any module code runs.

Can one deployment run only some modules?

Yes. PROJECT_CODE picks the modules, using presets such as business, ecommerce, cms or tax_copilot, or core_only for sign-in and workspaces alone. Module sets are per deployment, not per workspace.

Which languages can call it?

Any language that speaks HTTP. There is a TypeScript SDK, an OpenAPI spec and Swagger explorer, and sample apps in Java, PHP, Python, Rust and Go that share one sign-in.

Does it work with AI agents?

The repository includes an MCP server, so Claude Code, Cursor or another MCP-capable agent can work with kanban tasks and website content using a personal API key, with every change logged as that user. Several modules also use AI: chat, accounting, tax filing, hiring and the shop, with Ollama or a hosted model.

Can I try it?

Yes. opsapi.org/demo has a read-only dashboard that resets every 30 minutes, a SAML test identity provider and five sample apps signing in through one OpsAPI.

One backend for every product you run

Try OpsAPI on your own infrastructure, or talk to TenthMatrix about building your product on it with the modules, sign-in and hosting you need.