Getting Started
Tutorials
New to Bakend? Start with Tutorial 01: Build a Todo API.
Production Deployment
For installing the binary, see Installation. For VPS or Docker deployment, see Deployment.
Create a Project
After installing the bak binary:
bak init myapp
cd myapp
bak start
bak init creates bakend.json, collections/, functions/, jobs/, and a generated JWT secret.
Development Setup
Install Bun, clone the repository, and install dependencies:
git clone https://github.com/alpbak/bakend.git
cd bakend
bun install
From the repo you can run bun run src/index.ts init myapp or scaffold in place:
mkdir myapp && cd myapp
bun run ../src/index.ts init
Configuration
bakend.json (created by bak init):
{
"port": 8080,
"database": "./bakend.db",
"storage": "./storage",
"logLevel": "INFO",
"auth": {
"jwtSecret": "<generated>",
"accessTokenTtl": "15m",
"refreshTokenTtl": "7d"
}
}
Paths are relative to the bakend.json file location.
Environment overrides:
BAKEND_PORTBAKEND_DATABASEBAKEND_STORAGEBAKEND_LOG_LEVELBAKEND_LOG_FILE
Start the Server
bak start
Or from the Bakend repo during development:
bun run start
Expected output:
Bakend v1.0
Database: ready
API: ready
Listening on :8080
Verify
curl http://localhost:8080/health
{ "status": "ok", "version": "1.0.1" }
Custom Config Path
bak start --config path/to/bakend.json