Skip to Content
Build and operateLocal development

Local development

Bahama prepares infrastructure and configuration; it does not replace the framework’s development server. Once the required resources are available, your agent keeps using commands such as npm run dev.

You can provision a database for local work before the application is ready to deploy anywhere.

Ask for local-first setup

Add the database this application needs with Bahama and make it available to the local server. Do not deploy the application yet. Explain whether local work will use live or isolated data before creating anything.

Your agent can begin with a local environment and a resource:

bahama.yaml
environments: local: provider: local resources: database: provider: neon engine: postgres bindings: DATABASE_URL: from: resources.database.connectionUrl to: environments.local.variables

After you approve and apply the plan, the protected environment file is ready. No application code has been published.

Know which data local code reaches

Bahama binds exactly the resource declared in the manifest. If one Neon database is bound to both local and production, both environments reach that same database. Bahama does not automatically create a development branch or copy.

For isolated data, declare and manage a separate development resource when the current provider and project shape support it, or use a separate local database outside Bahama. Make the choice explicit before tests write data.

Bahama Cloud local access also reaches the real project database through a scoped development token. See Database and local development for its server-only runtime bridge and limitations.

Keep environment files private

The local provider defaults to .env.local, preserves unrelated entries, gitignores the file, and applies restrictive permissions. Your agent should bind provider-produced values without reading or echoing them.

Do not give server credentials public framework prefixes. VITE_* and NEXT_PUBLIC_* values are browser-visible.

Add hosting later

When the application is ready, your agent adds a hosted environment and extends only the bindings production needs:

bahama.yaml
environments: local: provider: local production: provider: vercel bindings: DATABASE_URL: from: resources.database.connectionUrl to: - environments.local.variables - environments.production.variables

A new plan preserves the verified database, highlights the hosting and new binding work, and waits for your approval. Deployment remains a separate step.

When returning to a project after time away, ask your agent to check bahama status --json. It can confirm the locked resources before planning any repair or deployment.

Last updated on