MCPcopy
hub / github.com/daptin/daptin

github.com/daptin/daptin @v0.12.28 sqlite

repository ↗ · DeepWiki ↗ · release v0.12.28 ↗
2,963 symbols 12,577 edges 305 files 557 documented · 19%
README

Daptin

Release License Go Report Discord

Daptin is the batteries-included application server for your next software project.

Most apps need the same backend capabilities: data modeling, APIs, auth, permissions, files, background jobs, integrations, metering, realtime events, and production operations. Daptin gives you those pieces in one server.

Use Daptin as the primary backend for a new app, or run it beside an existing stack as a sidecar for the features you are missing.

schema.yaml -> Daptin -> APIs + Auth + Permissions + Files + Sites + Actions + Integrations + Ops

Build your app. Let Daptin run and enforce the backend.

Why Daptin

Most software projects eventually need the same backend foundation. Daptin keeps that foundation stable:

  • Your data model becomes REST, GraphQL, OpenAPI, metadata, validation, and standard columns.
  • Your users, teams, tenants, and roles become user_account, usergroup, relations, OAuth, and row-level permissions.
  • Your backend logic becomes actions, state machines, scheduled tasks, data exchange, and integration calls.
  • Your product runtime gets files, sites, realtime events, LLM routing, metering, quotas, rate limits, audit trails, caching, TLS, and monitoring.

Use Daptin behind web apps, mobile apps, internal tools, stores, blogs, SaaS products, dashboards, portals, API products, content sites, and AI products.

What You Get

Data Model And APIs

  • Schema-defined entities backed by SQLite, PostgreSQL, or MySQL/MariaDB.
  • Standard columns: internal id, public reference_id, version, created_at, updated_at, and row permission.
  • Relations, joins, default groups, default relations, validations, conformations, composite keys, and column types.
  • JSON:API CRUD endpoints under /api/{entity}.
  • Optional GraphQL endpoint under /graphql.
  • OpenAPI and metadata through /openapi.yaml, /meta, and /jsmodel/{typename}.
  • Import, export, aggregation, filtering, pagination, and generated test data.

Identity, Policy, And Multi-Tenancy

  • Users, usergroups, group membership, and ownership-aware rows.
  • Entity-level and row-level permission checks.
  • Guest, owner, and group permission scopes for peek, read, create, update, delete, refer, and execute.
  • JWT/session authentication, signup/signin, password reset, and OTP/2FA flows.
  • OAuth as a client through oauth_connect and oauth_token.
  • OAuth/OIDC-style provider endpoints through oauth_app, authorization codes, access tokens, refresh tokens, grants, JWKS, UserInfo, introspection, and revocation.
  • Multi-tenant app patterns through usergroups, relations, ownership, default groups, and row permissions.

Backend Logic And Workflows

  • Buildable actions with input fields, validation, conditions, outcomes, and action-level permissions.
  • Action chains for CRUD, performer execution, rendering, file download, response shaping, user switching, and backend-side orchestration.
  • State machines and state transition tracking.
  • Scheduled tasks that execute actions on cron-like schedules.
  • Data exchange and custom business logic hooks.

Files, Storage, Sites, And Templates

  • Encrypted credentials and cloud_store records.
  • rclone-backed local and cloud storage providers.
  • Asset columns for files, images, videos, blobs, markdown, HTML, JSON, and compressed content.
  • Upload routes, direct asset serving, cache headers, ETags, gzip, and optimized static file serving.
  • Static site and subsite hosting from the same runtime.
  • Site creation and site storage sync actions.
  • Template hooks for static sites and app frontends.

Realtime, Protocols, And Collaboration

  • WebSocket endpoint at /live.
  • Create/update/delete events published through Olric PubSub.
  • Optional YJS collaboration support.
  • Streams and RSS/Atom/JSON feeds.
  • Built-in or config-gated SMTP, IMAP, FTP, CalDAV/CardDAV, HTTPS/TLS, CORS, gzip, rate limiting, and language middleware.

LLM, Integrations, Metering, And Product Runtime

  • OpenAI-compatible endpoints:
  • /v1/chat/completions
  • /v1/completions
  • /v1/embeddings
  • /v1/models
  • LLM provider routing through llm_provider and encrypted credentials.
  • OpenAPI-backed third-party integrations under /integration/{provider}/{operation}.
  • OAuth-token and custom-credential execution boundaries for integrations.
  • API plans, members, usage logs, quotas, rate limits, and credit hooks.
  • CRUD, action, and LLM metering for paid AI/API products.

Operations

  • Runtime configuration through /_config.
  • Health and statistics through /ping and /statistics.
  • Optional audit tables and audit rows.
  • Olric-backed cache, PubSub, and clustered rate-limit counters.
  • TLS certificate management, including ACME/self-signed certificate actions.
  • Background mail sync and outbox processing.
  • OpenAPI and metadata endpoints for tools, agents, and client generation.

Quick Start

Download the latest release binary:

# Linux amd64
curl -L -o daptin https://github.com/daptin/daptin/releases/latest/download/daptin-linux-amd64
chmod +x daptin
./daptin -port=6336

Or run the Docker image with the current release tag:

docker run --rm -p 6336:8080 -p 6443:6443 daptin/daptin:v0.12.15

Then open:

http://localhost:6336

Create the first admin user and finish setup using the wiki:

Build Your First Backend

Create a schema file such as schema_product.yaml:

Tables:
  - TableName: product
    Columns:
      - Name: name
        DataType: varchar(200)
        ColumnType: label
        IsIndexed: true
      - Name: price
        DataType: float
        ColumnType: measurement
      - Name: published
        DataType: bool
        ColumnType: truefalse
        DefaultValue: "false"

Start Daptin in the same directory:

./daptin -port=6336

Daptin creates the table and exposes the backend surfaces around it:

GET    /api/product
POST   /api/product
PATCH  /api/product/{reference_id}
DELETE /api/product/{reference_id}
GET    /openapi.yaml
GET    /meta
POST   /graphql              # when GraphQL is enabled

From there, add users, usergroups, relations, permissions, actions, asset columns, state machines, integrations, metering, or site hosting as your app needs them.

For New Projects And Existing Stacks

Daptin works well as the backend foundation for new software and as a sidecar for existing systems:

  • Point frontends, tools, and services at JSON:API, GraphQL, OpenAPI, or metadata endpoints instead of building bespoke backend glue.
  • Use usergroups, relations, and row permissions for access boundaries.
  • Keep secrets in Daptin credentials, OAuth tokens, and integration config instead of application client code.
  • Put backend logic in Daptin actions and state machines.
  • Store uploads through asset columns and cloud stores.
  • Host static frontends, docs, blogs, and sites as Daptin subsites.
  • Route LLM calls through Daptin's OpenAI-compatible /v1 endpoints.
  • Add plans, quotas, usage logs, credits, and rate limits through API metering.
  • Subscribe to data changes through WebSocket events when apps need realtime behavior.

Ecosystem

  • Daptin CLI - manage contexts, CRUD, actions, OAuth, integrations, storage, assets, and discovery from the command line.
  • Daptin JS client - JavaScript and TypeScript client for auth, JSON:API, actions, and uploads.
  • Daptin Go client - Go client for Daptin APIs.
  • Schema samples - reusable schemas for blogs, stores, task lists, FAQs, payments, and more.
  • Daptin LLM demo - contract demo for OpenAI-compatible LLM endpoints.
  • Metering credit demo
  • quotas, usage, credits, LLM metering, and denial paths.
  • Integration auth demo
  • OAuth/custom-credential integration execution and wrong-user denial.
  • OAuth provider demo
  • Daptin as OAuth 2.0 / OpenID Connect provider.
  • Dadadash - larger app proof with file browser, document editor, spreadsheet editor, calendar, and CRUD data tables.

Production Notes

For production deployments:

  • Use PostgreSQL or MySQL/MariaDB instead of development SQLite.
  • Set stable jwt.secret and encryption.secret values.
  • Enable HTTPS/TLS and configure hostnames.
  • Configure backups and restore testing for your database and file storage.
  • Use cloud storage for durable files and media when appropriate.
  • Enable only the protocols your app needs.
  • Configure rate limits, metering, monitoring, and audit behavior for your product.

Useful docs:

Documentation

Community

License

Daptin is licensed under LGPL v3.

Extension points exported contracts — how you extend this code

Compressor (Interface)
compressedData struct will be compressed using zlib when printed via fmt [10 implementers]
server/mail_adapter.go
StreamingExportWriter (Interface)
StreamingExportWriter interface for different export format writers [5 implementers]
server/resource/paginated_dbmethods.go
ActionPerformerInterface (Interface)
(no doc) [53 implementers]
server/actionresponse/action_pojo.go
StreamingImportParser (Interface)
StreamingImportParser defines the interface for import parsers [3 implementers]
server/actions/streaming_import_parsers.go
TokenExtractor (FuncType)
TokenExtractor is a function that takes a request as input and returns either a token or an error. An error should only
server/jwt/jwtmiddleware.go
HostRouterProvider (Interface)
(no doc) [1 implementers]
server/subsite/template_handler.go
DatabaseConnection (Interface)
(no doc) [1 implementers]
server/database/database_connection_interface.go
ResourceAdapter (Interface)
(no doc) [1 implementers]
server/auth/auth.go

Core symbols most depended-on inside this repo

make
called by 750
docs/assets/javascripts/lunr/wordcut.js
CheckErr
called by 475
server/resource/dbfunctions_check.go
Close
called by 414
server/websockets/websocket_server.go
String
called by 306
server/mail_adapter.go
Exec
called by 176
server/inmemory_mock_db.go
Beginx
called by 159
server/database/database_connection_interface.go
Get
called by 148
server/database/database_connection_interface.go
Select
called by 136
server/database/database_connection_interface.go

Shape

Function 1,971
Method 705
Struct 249
Interface 16
TypeAlias 15
Class 4
FuncType 3

Languages

Go70%
TypeScript30%
Python1%

Modules by API surface

docs/assets/javascripts/bundle.5413a266.min.js306 symbols
docs/assets/javascripts/lunr/wordcut.js139 symbols
server/resource/dbmethods.go75 symbols
docs_markdown/rtd_dropdown/js/jquery-2.1.1.min.js63 symbols
docs/assets/javascripts/lunr/min/lunr.tr.min.js55 symbols
websocket_test.go50 symbols
docs/assets/javascripts/bundle.f9edbbd5.min.js47 symbols
server/actions/action_integration_execute.go46 symbols
server/apiblueprint/apiblueprint.go45 symbols
server/resource/dbresource.go41 symbols
server/resource/oauth_provider.go37 symbols
server/ftp_server.go34 symbols

Dependencies from manifests, versioned

cloud.google.com/gov0.115.1 · 1×
cloud.google.com/go/authv0.15.0 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.7 · 1×
cloud.google.com/go/compute/metadatav0.6.0 · 1×
cloud.google.com/go/storagev1.43.0 · 1×
github.com/Azure/azure-pipeline-gov0.2.3 · 1×
github.com/Azure/azure-sdk-for-go/sdk/azcorev1.17.1 · 1×
github.com/Azure/azure-sdk-for-go/sdk/azidentityv1.8.2 · 1×
github.com/Azure/azure-sdk-for-go/sdk/internalv1.10.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/storage/azblobv1.6.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/storage/azfilev1.5.0 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add daptin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact