Hello bit2

Modern web development with Astro, libSQL, and your choice of deployment platform.

Built with bit2 v3.0.3

"Every new beginning comes from some other beginning's end."

— Seneca, Letters

API Endpoints

RESTful API for quote management

Deploy Your App

Run `bit2 deploy` to set up your database and choose a deployment platform

Deploy to Cloudflare Pages

Deploy to Cloudflare Pages

Cloudflare Pages provides fast, secure hosting with global CDN and automatic HTTPS.

Prerequisites

  • Cloudflare account (free at cloudflare.com)
  • Git repository (GitHub, GitLab, or Bitbucket)
  • Turso database credentials (created by bit2 deploy)

Step 1: Push to Git Repository

If you don’t have a Git remote yet:

  1. Create a repository on GitHub, GitLab, or Bitbucket
  2. Push your code:
git remote add origin <your-repo-url>
git push -u origin main

Step 2: Go to Cloudflare Dashboard

  1. Go to Cloudflare Dashboard
  2. Click on Developer Platform tab
  3. Click on Pages
  4. Click Import an existing Git repository

Step 3: Select Repository

  1. Select your repository from the list
  2. Click Begin setup

Step 4: Configure Build Settings

  1. Framework preset: Select Astro
  2. Build command: Change to bun run build (instead of npm)
  3. Build output directory: dist
  4. Root directory: (leave blank)

Step 5: Setup Environment Variables for Turso

  1. Click Environment variables section
  2. Add these variables:
Variable NameValue
TURSO_DATABASE_URLYour database URL from bit2 deploy
TURSO_AUTH_TOKENYour auth token from bit2 deploy

Step 6: Deploy

  1. Click Save and Deploy
  2. Cloudflare will build and deploy your site
  3. Your site will be live at: https://YOUR_PROJECT.pages.dev

Features You Get

Global CDN - Your site loads fast worldwide
Automatic HTTPS - Secure by default
Preview Deployments - Test changes before going live
Web Analytics - Free, privacy-focused analytics
Custom Domains - Use your own domain
Unlimited Bandwidth - No traffic limits

Next Steps

  • Custom Domain: Settings → Custom domains → Add domain
  • Web Analytics: Analytics → Web Analytics → Enable
  • Build Hooks: Settings → Builds & deployments → Add build hook
  • Access Control: Settings → Access → Configure

Troubleshooting

Build Fails

  • Check build logs in Cloudflare dashboard
  • Ensure all environment variables are set
  • Verify bun run build works locally

Database Connection Issues

  • Double-check environment variable values
  • Ensure no extra spaces in values
  • Verify database is accessible from Cloudflare

Need Help?

Deploy to Vercel

Deploy to Vercel

Vercel offers seamless deployment with automatic scaling and excellent developer experience.

Prerequisites

  • Vercel account (free at vercel.com)
  • Git repository (GitHub, GitLab, or Bitbucket)
  • Turso database credentials (created by bit2 deploy)

Step 1: Push to Git Repository

If you don’t have a Git remote yet:

  1. Create a repository on GitHub, GitLab, or Bitbucket
  2. Push your code:
git remote add origin <your-repo-url>
git push -u origin main

Step 2: Import to Vercel

  1. Go to vercel.com/new
  2. Click Import Git Repository
  3. Select your Git provider (GitHub/GitLab/Bitbucket)
  4. Choose your repository from the list

Step 3: Configure Project

Vercel auto-detects Astro! Verify these settings:

  • Framework Preset: Astro (auto-detected)
  • Build Command: bun run build
  • Output Directory: dist
  • Install Command: bun install

Step 4: Add Environment Variables

Before deploying, click Environment Variables and add:

Variable NameValue
TURSO_DATABASE_URLYour database URL from bit2 deploy
TURSO_AUTH_TOKENYour auth token from bit2 deploy

Step 5: Deploy

  1. Click Deploy
  2. Vercel will build and deploy your application
  3. Get instant preview URL
  4. Production URL: https://YOUR_PROJECT.vercel.app

Features You Get

Automatic Deployments - Push to deploy
Preview Environments - Test every branch
Edge Functions - Run code at the edge
Analytics - Real user metrics
Speed Insights - Performance monitoring
Custom Domains - Use your own domain

Next Steps

  • Custom Domain: Settings → Domains → Add
  • Analytics: Enable in project dashboard
  • Speed Insights: Analytics → Speed Insights
  • Environment Variables: Settings → Environment Variables
  • Deploy Hooks: Settings → Git → Deploy Hooks

Automatic Deployments

After initial setup:

  • Production: Push to main branch
  • Preview: Push to any other branch
  • Comments: Get deployment URLs in pull requests

Troubleshooting

Build Fails

  • Check build logs in Vercel dashboard
  • Ensure all environment variables are set
  • Test bun run build locally

Database Connection Issues

  • Verify environment variable values
  • Check for extra spaces or quotes
  • Ensure database is accessible

Slow Initial Load

  • Normal for serverless cold starts
  • Consider enabling Edge Functions
  • Check function region settings

Need Help?

Deploy to Netlify

Deploy to Netlify

Netlify provides powerful deployment features with excellent developer tools and workflow integration.

Prerequisites

  • Netlify account (free at netlify.com)
  • Git repository (GitHub, GitLab, or Bitbucket)
  • Turso database credentials (created by bit2 deploy)

Step 1: Push to Git Repository

If you don’t have a Git remote yet:

  1. Create a repository on GitHub, GitLab, or Bitbucket
  2. Push your code:
git remote add origin <your-repo-url>
git push -u origin main

Step 2: Import to Netlify

  1. Go to app.netlify.com
  2. Click Add new siteImport an existing project
  3. Choose your Git provider
  4. Authenticate if needed
  5. Select your repository

Step 3: Configure Build Settings

Netlify auto-detects Astro! Confirm these settings:

  • Build command: bun run build
  • Publish directory: dist
  • Functions directory: (leave blank)

Step 4: Add Environment Variables

Before deploying, click Show advanced then New variable:

KeyValue
TURSO_DATABASE_URLYour database URL from bit2 deploy
TURSO_AUTH_TOKENYour auth token from bit2 deploy

Step 5: Deploy

  1. Click Deploy site
  2. Netlify will build and deploy your site
  3. Get instant URL: https://RANDOM_NAME.netlify.app
  4. Rename in Site settings → Change site name

Features You Get

Continuous Deployment - Auto-deploy on git push
Deploy Previews - Test every pull request
Split Testing - A/B test deployments
Forms Handling - Built-in form processing
Edge Functions - Run code at the edge
Custom Domains - Use your own domain

Next Steps

  • Custom Domain: Domain settings → Add custom domain
  • Deploy Notifications: Site settings → Notifications
  • Build Hooks: Site settings → Build hooks
  • Access Control: Site settings → Access control
  • Analytics: Enable Netlify Analytics (paid feature)

Automatic Deployments

After setup, deployments are automatic:

  • Production: Push to main branch
  • Deploy Previews: Create pull requests
  • Branch Deploys: Push to any branch

Advanced Configuration

Create netlify.toml in your project root for more control:

[build]
  command = "bun run build"
  publish = "dist"

[build.environment]
  NODE_VERSION = "18"

[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-Content-Type-Options = "nosniff"

Troubleshooting

Build Fails

  • Check deploy logs in Netlify dashboard
  • Verify all environment variables
  • Test bun run build locally

Database Connection Issues

  • Double-check environment variables
  • No extra spaces or quotes in values
  • Verify Turso database is active

Site Not Updating

  • Check deployment status
  • Clear build cache: Deploy settings → Clear cache
  • Trigger manual deploy

Need Help?

🚀 Quick Start

  1. Run bit2 deploy to set up your database and install the right adapter
  2. Push your code to GitHub, GitLab, or Bitbucket
  3. Follow the guide above for your chosen platform