Quickstart
Deploy your first app on Flect in under 5 minutes.
Prerequisites
Section titled “Prerequisites”- Docker — to build and push your image
- A container registry (GitHub Container Registry, Docker Hub, etc.)
- Flect CLI installed
1. Install the CLI
Section titled “1. Install the CLI”npm install -g @flect/cli2. Log in
Section titled “2. Log in”flect loginThis opens a browser window. Sign in with your account and the CLI saves your token locally.
3. Set up your workspace
Section titled “3. Set up your workspace”# create or select an orgflect org create --name my-orgflect org use my-org
# create a workspace and projectflect ws create --name defaultflect ws use default
flect proj create --name myprojectflect proj use myproject
# create a production environmentflect env create --name productionflect env use production4. Create your resources
Section titled “4. Create your resources”# database (SQLite, isolated per app)flect db create --name myapp-db
# run migrationsflect db migrate myapp-db --dir ./migrations
# KV store (Redis-compatible cache)flect kv create --name myapp-cache5. Create an app
Section titled “5. Create an app”flect app create --name myapp# → myapp-abc123.up.flect.run6. Add a flect.toml
Section titled “6. Add a flect.toml”In your project root:
name = "myapp"port = 3000
[[databases]]binding = "DB"name = "myapp-db"
[[kv]]binding = "CACHE"name = "myapp-cache"The binding is the env var prefix your app uses. The name is the resource name in Flect.
7. Use the SDK in your app
Section titled “7. Use the SDK in your app”npm install @flect/sdkimport { createEnv } from '@flect/sdk'
const env = createEnv()const db = env.db('DB') // reads DB_URL, DB_NAMESPACE, FLECT_TOKENconst cache = env.kv('CACHE') // reads CACHE_URL, FLECT_TOKEN8. Deploy
Section titled “8. Deploy”Build and push your image, then deploy from the directory containing flect.toml:
docker build -t ghcr.io/you/myapp:1.0.0 .docker push ghcr.io/you/myapp:1.0.0
flect app deploy myapp --image ghcr.io/you/myapp:1.0.0✓ Deployed: abc123 id abc123 status running url https://myapp-abc123.up.flect.run image ghcr.io/you/myapp:1.0.0Your app is live. All env vars (DB_URL, CACHE_URL, FLECT_TOKEN) are injected automatically — your code needs no configuration.
Next steps
Section titled “Next steps”- CLI Reference — all available commands
- SDK Reference — database and KV API
- flect.toml Reference — full config options
- Notes API example — complete working example