A modern, production-ready API starter kit built with cutting-edge technologies for rapid development and scalable performance.
- 🔥 Hono - Ultra-fast web framework for the edge
- 🔐 Authentication & Authorization
- JWT token-based authentication
- OAuth2 integration (Google)
- Email OTP verification
- 📊 Database Integration
- Drizzle ORM - Type-safe SQL query builder
- PostgreSQL - Reliable, open-source relational database
- 🗄️ Caching
- Redis for high-performance caching and session management
- 🐳 DevOps Ready
- Docker & Docker Compose for containerization
- 📝 API Documentation
- Auto-generated OpenAPI documentation
- Interactive SwaggerUI interface
Category | Technologies |
---|---|
Framework | Hono |
Authentication | JWT, OAuth2, Email OTP |
Database | PostgreSQL, Drizzle ORM |
Caching | Redis |
Containerization | Docker |
Package Manager | Bun |
Documentation | OpenAPI, SwaggerUI |
- Bun (1.0.0 or later)
- Docker & Docker Compose
-
Clone the repository
git clone https://github.com/SyahrulBhudiF/Hono-Starter-Code cd Hono-Starter-Code
-
Install dependencies
bun install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration
Start the application and all required services (PostgreSQL, Redis) using Docker:
docker compose build
docker compose up
This will launch the development environment with hot reloading enabled.
For production deployment, use the same Docker Compose setup with minor configuration adjustments at Dockerfile and docker-compose.yml.
# Run in production mode
docker compose build --no-cache
docker compose up
Once the application is running, you can access the API documentation at:
- OpenAPI Documentation: http://localhost:3000/doc
- Swagger UI: http://localhost:3000/ui
📦 ROOT
├── 📂 drizzle/ # 🔄 Drizzle ORM migration
├── 📂 src/
│ ├── 📂 config/ # ⚙️ Configuration files
│ ├── 📂 controllers/ # 🎮 Request handlers
│ ├── 📂 middleware/ # 🔌 Custom middleware
│ ├── 📂 models/ # 📊 Database models
│ ├── 📂 routes/ # 🛣️ API routes and Swagger documentation
│ ├── 📂 services/ # 🧩 Business logic
│ ├── 📂 types/ # 📝 Type definitions and Repository abstraction
│ ├── 📂 utils/ # 🔧 Utility functions
│ ├── 📂 validation/ # ✅ Request validation schemas
│ ├── 📄 index.ts # 🚀 App entry point
│ └── 📄 worker.ts # 👷 Worker entry point
├── 📄 .env.example # 🔐 Environment variables example
├── 📄 compose.yml # 🐳 Docker Compose configuration
├── 📄 Dockerfile # 📦 Docker configuration
├── 📄 drizzle.config.ts # 🗃️ Drizzle ORM configuration
└── 📄 package.json # 📋 Dependencies and scripts
Contributions, issues, and feature requests are welcome! See CONTRIBUTING.md for more information.