What You’ll Get
- Backend: Hono web framework
- Runtime: Node.js
- Bundler: Webpack or esbuild
- Performance: Good performance with Node.js
- 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 + Node” 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
Node.js Runtime Benefits
- Ecosystem: Full Node.js package ecosystem
- Compatibility: Works with all Node.js libraries
- Stability: Mature and well-tested runtime
- Tooling: Rich development tooling
- Community: Large community support
Development Commands
| Command | Description |
|---|---|
pnpm run dev | Start all services |
pnpm run build | Build for production |
pnpm run dev:web | Frontend only |
pnpm run dev:server | Backend only |
pnpm run check-types | TypeScript validation |
pnpm run db:push | Update database schema |
pnpm run db:studio | Database management UI |
Bundler Configuration
Webpack Configuration
The project uses webpack for bundling the Hono server:Build Process
Performance Considerations
Node.js vs Bun
| Aspect | Node.js | Bun |
|---|---|---|
| Startup Time | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Memory Usage | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Package Installation | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Ecosystem Compatibility | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
Optimization Tips
-
Use PM2 for Production:
-
Enable Compression:
-
Use Environment-Specific Configs:
Troubleshooting
Common Issues
🔥 “Node.js 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
Migration from Bun
If you’re migrating from Bun to Node.js:-
Update Package Manager:
-
Update Scripts:
-
Install Dependencies:
Next Steps
🎉 Congratulations! Your Hono + Node 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 Railway, DigitalOcean, or your preferred platform
- Add features - Extend with additional integrations