Loading repository data…
Loading repository data…
jokerhgs / repository
A minimal, flexible backend boilerplate using Hono, Prisma, TypeScript, and modern development tools like ESLint, Prettier, and Vitest. Designed for scalability and easy integration with various APIs, databases, and authentication methods.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A clean, production-ready boilerplate for building modular monolithic REST APIs with Hono, TypeScript, Drizzle ORM, and Zod validation, designed to be deployed as an AWS Lambda function via Docker.
@hono/node-serversrc/
├── db/
│ ├── index.ts # Drizzle client instantiation
│ └── schema.ts # Drizzle schema definitions
├── lib/
│ ├── logger.ts # Pino logger configuration
│ └── rate-limiter.ts # Hono rate limiter setup
├── modules/
│ └── users/ # Generic starter module
│ ├── users-schema.ts # Zod schemas and types
│ ├── users-repository.ts # Repository Layer (Drizzle queries)
│ ├── users-service.ts # Business logic
│ ├── users-controller.ts # Request handlers
│ ├── users-routes.ts # Route definitions
│ └── users.test.ts # Integration tests
├── index.ts # Core Hono application setup
├── lambda.ts # AWS Lambda handler entry point
├── server.ts # Local development entry point
└── routes.ts # Main API router
drizzle.config.ts # Drizzle Kit config
Dockerfile # Multi-stage Docker config for AWS Lambda
docker-compose.yml # Local Lambda emulator for testing
File: {module}-repository.ts
File: {module}-service.ts
File: {module}-controller.ts
File: {module}-routes.ts
pnpm install
Create .env file (see .env.example):
DATABASE_URL="postgresql://postgres.[ref]:[pass]@aws-0-[region].pooler.supabase.com:5432/postgres"
NODE_ENV="development"
pnpm db:push
# Start development server on port 3000
pnpm dev
# Run tests
pnpm test
# Open Drizzle Studio
pnpm db:studio
The application is bundled into a Docker image using the official AWS Lambda Node.js base image.
docker build -t my-hono-api .
docker-compose up
pnpm docker:lambda-test
Note: This script uses test-event.json as the payload. You can modify this JSON file to test different routes or HTTP methods (GET, POST, etc).
| Method | Endpoint | Description |
|---|---|---|
| GET | /users | Get all users |
| GET | /users/:id | Get user by ID |
| POST | /users | Create new user |
| PATCH | /users/:id | Update user |
| DELETE | /users/:id | Delete user |
When generating new modules, follow the same structure as the users module:
src/db/schema.ts<module>-schema.ts, <module>-repository.ts, <module>-service.ts, <module>-controller.ts, <module>-routes.tssrc/routes.tsTests are written in Vitest and perform local database integrations.
Ensure your DATABASE_URL points to a safe sandbox/test database.
pnpm test # Run all tests
pnpm test --watch # Watch mode
MIT