Skip to main content

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:
  • Node.js v18+ installed
  • Git for version control
  • Access to your Builder Box dashboard

Step 1: Project Setup

1.1 Access Your Dashboard

  1. Visit the Dashboard
  2. 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
  3. Install Your Project
    • Run the provided installation command:

Step 2: Environment Configuration

2.1 Server Environment Variables

Create apps/server/.env:

2.2 Web Environment Variables

Create apps/web/.env:

2.3 CMS Environment Variables

Create apps/cms/.env:

Step 3: Database Setup

3.1 Run Database Commands


Step 4: Start Development

4.1 Start All Services

This will start:
  • 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:
Terminal 2 - Frontend App:
Terminal 3 - CMS:

Step 5: Verify Setup

5.1 Check Services

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


Bundler Configuration

Webpack Configuration

The project uses webpack for bundling the Hono server:

Build Process


Performance Considerations

Node.js vs Bun

Optimization Tips

  1. Use PM2 for Production:
  2. Enable Compression:
  3. Use Environment-Specific Configs:

Troubleshooting

Common Issues

🔥 “Node.js not found”
🔥 “Port already in use”
🔥 “Database connection failed”
  • Verify your Supabase connection strings
  • Ensure your database is running
  • Check environment variables
🔥 “Authentication not working”
  • Verify Google OAuth configuration
  • Check BETTER_AUTH_SECRET is set
  • Ensure CORS_ORIGIN is correct
🔥 “Build errors”

Migration from Bun

If you’re migrating from Bun to Node.js:
  1. Update Package Manager:
  2. Update Scripts:
  3. Install Dependencies:

Next Steps

🎉 Congratulations! Your Hono + Node setup is complete. Here’s what you can do next:
  1. Customize the frontend - Edit components in apps/web/src/components
  2. Add API endpoints - Create new routes in apps/server/src/routers
  3. Configure CMS - Add content types in apps/cms/src/collections
  4. Set up production - Deploy to Railway, DigitalOcean, or your preferred platform
  5. Add features - Extend with additional integrations
Happy building! 🚀