What You’ll Get
- Backend: Hono web framework
- Runtime: Bun (fast JavaScript runtime)
- Bundler: Bun’s built-in bundler
- Performance: Excellent startup time and memory usage
- Structure: Separate server and web applications
Prerequisites
Before starting, ensure you have:Step 1: Project Setup
1.1 Access Your Dashboard
-
Visit the Dashboard
- Go to: https://www.builderbox.ai/bought/main
- Log in with your account credentials
-
Create Your Project
- Click “Create Project” on your dashboard
- Select “Hono + Bun” as your backend configuration
- Fill out the project configuration form
- Click “Create Project” to generate your boilerplate
-
Install Your Project
- Run the provided installation command:
- Run the provided installation command:
Step 2: Environment Configuration
2.1 Server Environment Variables
Createapps/server/.env:
2.2 Web Environment Variables
Createapps/web/.env:
2.3 CMS Environment Variables
Createapps/cms/.env:
Step 3: Database Setup
3.1 Run Database Commands
Step 4: Start Development
4.1 Start All Services
- Backend Server (Hono) on port 3000
- Frontend App (Next.js) on port 3001
- CMS on port 3003
4.2 Individual Services (Optional)
If you prefer to run services separately: Terminal 1 - Backend Server:Step 5: Verify Setup
5.1 Check Services
- Frontend: http://localhost:3001
- Backend API: http://localhost:3000
- CMS: http://localhost:3003
5.2 Test API Endpoints
Project Structure
Key Features
Hono Backend Benefits
- Lightweight: Minimal overhead and fast startup
- Type Safety: Full TypeScript support
- Middleware: Rich middleware ecosystem
- Performance: Excellent request handling
- Compatibility: Works with any Node.js-compatible runtime
Bun Runtime Benefits
- Speed: Faster startup and execution
- Memory: Lower memory usage
- Bundler: Built-in bundler for production builds
- Compatibility: Full Node.js compatibility
- Developer Experience: Fast package installation
Development Commands
| Command | Description |
|---|---|
bun dev | Start all services |
bun build | Build for production |
bun dev:web | Frontend only |
bun dev:server | Backend only |
bun check-types | TypeScript validation |
bun db:push | Update database schema |
bun db:studio | Database management UI |
Troubleshooting
Common Issues
🔥 “Bun not found”- Verify your Supabase connection strings
- Ensure your database is running
- Check environment variables
- Verify Google OAuth configuration
- Check BETTER_AUTH_SECRET is set
- Ensure CORS_ORIGIN is correct
Next Steps
🎉 Congratulations! Your Hono + Bun setup is complete. Here’s what you can do next:- Customize the frontend - Edit components in
apps/web/src/components - Add API endpoints - Create new routes in
apps/server/src/routers - Configure CMS - Add content types in
apps/cms/src/collections - Set up production - Deploy to Vercel, Railway, or your preferred platform
- Add features - Extend with additional integrations