Skip to content

Flect

Write createEnv(). Deploy. Flect wires up the databases, caches, and buckets — no URLs, ports, or secrets in your code.

Flect is a developer platform for deploying apps and their backing resources — databases, KV stores, and object storage — on your own infrastructure. You describe an application in flect.toml: its services, the resources they use, and what each service may reach. Flect deploys each service behind TLS with exactly that and nothing more.

Your application code stays clean: it calls createEnv() and asks for a binding by name. It never sees a connection string, a port, or a credential.

import { createEnv } from '@dotlabshq/flect-sdk'
const env = createEnv()
const db = await env.db('DB') // an official @libsql/client
const rows = await db.execute('SELECT * FROM notes')
Terminal window
flect login # SSO, stored in ~/.flect/config.json
flect use acme # your org; flect.toml names its own scope
flect init # scaffold flect.toml: one app, one scope
flect db create myapp-db # prints the id to write in flect.toml
flect deploy # check the file, bind by id, deploy each service

At deploy time Flect injects exactly two environment variables into your container — FLECT_TOKEN and FLECT_BROKER_URL. Everything else (the database URL, the cache prefix, the bucket keys) is resolved at runtime through the broker, scoped to your project, and never written into your image.

  • Apps — deploy any Docker image; get a public HTTPS URL with an auto-issued TLS certificate.
  • Databases — SQLite-compatible via sqld/libsql, isolated per resource.
  • KV — Redis-compatible via Valkey, key-prefixed per resource.
  • Object storage — S3-compatible via Garage, one bucket + key pair per resource.
  • SDK — @dotlabshq/flect-sdk hands you the official client for each resource (@libsql/client, ioredis, @aws-sdk/client-s3), pre-wired and scoped.
  • Least privilege by default — each service lists the bindings it uses, the services it calls and the secrets it gets; the broker refuses the rest.
  • Scopes — an Org → Workspace → Project → Environment tree. One file per environment (flect.toml, flect.dev.toml), each with its own resources; a dev service can never reach a production database.
  • Secrets — names in the file, values set from stdin with flect secret set, per service and per environment.