2.3.1 • Published 10 months ago

@bitbons.ai/bit v2.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

∓ bit → your stack sidekick

Version NPM Issues Last Commit

Zero to Full-Stack in Seconds! Create production-ready applications with a single command.

Creating a project with bit

✨ What's in the Box?

Bit sets you up with a modern, battle-tested stack:

  • 🌿 Monorepo - Simple, organized and scalable from day one (apps/pb and apps/web)
  • šŸ‹ Docker - Development environment that "just works"
  • šŸ“¦ PocketBase Backend - Full-featured backend with admin UI
  • ✨ Astro Frontend - Blazing-fast web performance for pages and api endpoints (SSR by default on bit)
  • šŸž Bun - Incredibly fast JavaScript runtime and toolkit for modern web development (powers bit's DX)

šŸš€ Get Started in 30 Seconds

  1. Install Bit:

    npm i -g @bitbons.ai/bit
  2. Create your masterpiece:

    bit new my-awesome-project
    cd my-awesome-project
  3. Start to see logs coming in:

    bit logs # bit is already running both containers for you

That's it! Visit your creation at:

Screenshot of default webapp

šŸŽ® Command Center

During Development

CommandDescription
new [options] <project-name>Create a new project --pb
bit startStart development environment
bit stopStop all services
bit restart [--skip-build] [target]Restart and rebuild services web, pb, empty for all
bit logsView containers logs
bit downDelete all containers and volumes
bit help [command]If you need help remembering how to do it

Ready for the World?

CommandWhat it Does
bit deployShip everything (parallel deployment). Same as bit deploy all
bit deploy webShip frontend
bit deploy pbShip backend
bit deploy --watchWait and verify the deployment is healthy
bit deploy --dry-runShow what would happen without making any changes

If your app doesn't exist in fly.io, it will launch first, then deploy. You can use --watch to verify deployment health.

šŸ“ Project Blueprint

my-project/
ā”œā”€ā”€ .env.development    # Development-only variables (not committed)
ā”œā”€ā”€ apps/
│   ā”œā”€ā”€ web/           # Astro frontend
│   │   ā”œā”€ā”€ src/
│   │   ā”œā”€ā”€ .env      # Public environment variables
│   │   └── fly.toml  # Frontend deploy config
│   └── pb/           # PocketBase backend
│       ā”œā”€ā”€ pb_data/  # Database and storage
│       └── fly.toml  # Backend deploy config
ā”œā”€ā”€ docker-compose.yml # Development environment
└── README.md

šŸŖ„ Power User Features

Auto-Magic Admin Setup

Create ~/.bit.conf to use one email/password for PB's superuser (and to fastrack creation):

{
  "pocketbase": {
    "admin": {
      "email": "pb-admin@your-domain.com",
      "password": "your-secure-password"
    }
  }
}

🚢 Deploy Like a Pro

For now, you can deploy in fly.io automagically:

  1. Get the fly.io CLI:

    curl -L https://fly.io/install.sh | sh
  2. Log in:

    fly auth login
  3. Ship it:

    bit deploy # From your project's root directory, to deploy both web and pb

    or

    bit deploy pb # Deploy PocketBase (db / backend) only
    bit deploy web # Deploy Astro (Frontend / api) only

Deploying PocketBase to fly.io in real time

Deploying to fly.io, real time

!IMPORTANT If you want to point your domain to the web app, Add a CNAME entry for your domain pointing to your fly.io web app, and add a free ssl certificate for the domain. Here's how to do it in details.

šŸ§‘ā€šŸ’» For the Builders

Want to make Bit even better? Here's how:

git clone https://github.com/bitbonsai/bit.git
cd bit
npm install
npm link
bit new test-project # Test your changes

šŸ“‹ Before You Start

Make sure you have:

šŸ†˜ Need Help?

Common hiccups and quick fixes:

  • šŸ‹ Docker not running? Fire up Docker Desktop
  • šŸ”Œ Port conflicts? Check if 4321 or 8090 are free
  • šŸ” Permission issues? Double-check Docker permissions
  • 🫧 Start fresh? Run bun run clean

šŸ¤ Join the Community

Got ideas? Found a bug? We love pull requests!

āš–ļø License

MIT License - go wild! See LICENSE for the fine print.

2.3.1

10 months ago

2.3.0

11 months ago

2.2.2

11 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.1.9

11 months ago

2.1.8

11 months ago

2.1.7

11 months ago