- Home
- Skills
- Cameronapak
- Bknd Skills
- Bknd Deploy Hosting
bknd-deploy-hosting_skill
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cameronapak/bknd-skills --skill bknd-deploy-hosting- SKILL.md10.4 KB
Overview
This skill guides deploying a Bknd application to production hosting across Cloudflare Workers/Pages, Vercel, Node.js/Bun VPS, Docker, AWS Lambda and similar platforms. It focuses on adapter configuration, environment variables, database bindings, and platform-specific deployment commands. The goal is a repeatable, production-ready deployment flow with attention to auth, media, and cold-start tradeoffs.
How this skill works
The skill inspects your Bknd app configuration and shows how to wire platform adapters, database connections, and media adapters for each target host. It provides sample config files, environment variable steps, and deployment commands for each platform. It highlights common runtime issues (native modules, D1 bindings, JWT secret) and offers fixes and pre-deployment checks.
When to use it
- You are ready to move a tested Bknd app from local to production.
- You need platform-specific adapter examples (Cloudflare, Vercel, AWS, Docker, Node/Bun).
- You must configure environment variables, secrets, or database bindings in a deployment dashboard.
- You are creating CI/CD pipelines and need deployment commands and config samples.
- You want guidance avoiding serverless pitfalls like file-based SQLite or cold starts.
Best practices
- Always set isProduction: true and use environment variables for secrets (JWT_SECRET >= 32 chars).
- Prefer cloud-hosted DBs (Turso/LibSQL) over file-based SQLite for serverless platforms.
- Use cloud storage adapters (S3, R2, Cloudinary) for media in production.
- Match platform bindings (e.g., D1 binding names) with adapter env references.
- Test locally with production-like env and run npx bknd types before deploy.
Example use cases
- Deploy a Bknd API to Cloudflare Workers using wrangler, D1 binding, and R2 for media.
- Host a Next.js + Bknd backend on Vercel with bknd.config and Vercel environment variables.
- Run Bknd on a VPS with Bun/Node and a process manager (PM2 or systemd) connecting to Turso.
- Containerize a Bknd service with Docker and docker-compose, persisting data via volumes.
- Package Bknd as an AWS Lambda using serverless + esbuild and enable provisioned concurrency to reduce cold starts.
FAQ
Use a hosted DB (LibSQL/Turso) instead of file-based SQLite; update connection to libsql:// and provide DB_TOKEN.
How do I fix env.DB undefined with Cloudflare D1?
Ensure wrangler.toml has a matching [[d1_databases]] binding name and the same binding is used in code (env.DB).
How can I avoid Lambda cold starts?
Use lighter databases, reduce bundle size, or enable provisioned concurrency for critical functions.