Skip to content

Deploy your first app

Complete installation and platform login first. This guide uses a test user with an owner verification attestation. It sends no email.

Terminal window
mkdir -p my-counter
curl -fsS https://docs.backend.fast/examples/simple-counter/backend.fast \
-o my-counter/backend.fast

This is the complete checked Counter example. It defines a model, protected create/list/increment routes, caching and an event. Read the source.

Choose a fresh display name. Deleted names cannot be reused.

Terminal window
BF_APP="counter-$(date +%s)"
bfast deploy --name "$BF_APP" --tier small ./my-counter
bfast apps list
bfast inspect --json "$BF_APP"

Creation waits for public HTTPS health. The CLI prints an operation ID. The same owned app appears in the dashboard. Its hostname uses two random words and six hex characters. Read its URL from inspect; the display name does not determine the URL.

Terminal window
bfast users create --app "$BF_APP" \
--email tester@example.invalid --name "Test User" --verified
bfast users list --app "$BF_APP"

Enter a new app password at the hidden prompt. Remember it for the next step. --verified records an owner attestation. Public signup instead requires email verification and app SMTP. Your platform login does not create an app user.

Terminal window
bfast request --app "$BF_APP" --email tester@example.invalid \
--method POST --path /counters --data '{"name":"visits"}'
bfast request --app "$BF_APP" --email tester@example.invalid --path /counters

Each command prompts for the app password. It logs in, sends an app bearer token, performs the request and attempts logout. It keeps the session in memory. Copy the counter record ID from the response:

Terminal window
BF_COUNTER_ID='<counter record ID>'
bfast request --app "$BF_APP" --email tester@example.invalid \
--method POST --path "/counters/$BF_COUNTER_ID/increment"

The value becomes 1. An app ID, a user ID and a counter ID identify different things.

Keep the DSL app "simple-counter" declaration unchanged. You can add a comment to exercise update without changing the model schema:

Terminal window
printf '\n// Updated through the public CLI.\n' >> my-counter/backend.fast
bfast update --app "$BF_APP" ./my-counter
bfast request --app "$BF_APP" --email tester@example.invalid --path /counters

The app retains its ID, URL, user and counter value. Schema-changing migrations are not implied by normal update. Read app lifecycle.

Terminal window
bfast sdk --app "$BF_APP" --out client.ts
bfast openapi --app "$BF_APP" --out openapi.json
bfast storage --json

The generated SDK uses app tokens. The account storage command uses the platform key. See clients and files.

Terminal window
bfast delete "$BF_APP"
bfast apps list

Deletion removes the app from the active catalog. The result reports retained_data: true. Its volume and saved objects remain retained. This is not a permanent purge or a storage refund. See retention.