Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supersoniko/hono-api-starter
Modern DX friendly starter for Node.js/Hono APIs with the focus on simplicity and robustness.
https://github.com/supersoniko/hono-api-starter
boilerplate honojs monorepo nodejs starter-kit starter-template typescript
Last synced: about 2 months ago
JSON representation
Modern DX friendly starter for Node.js/Hono APIs with the focus on simplicity and robustness.
- Host: GitHub
- URL: https://github.com/supersoniko/hono-api-starter
- Owner: supersoniko
- License: mit
- Created: 2023-08-08T18:32:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-07T19:11:39.000Z (7 months ago)
- Last Synced: 2024-10-25T10:36:53.320Z (about 2 months ago)
- Topics: boilerplate, honojs, monorepo, nodejs, starter-kit, starter-template, typescript
- Language: TypeScript
- Homepage:
- Size: 955 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hono API Starter
π Modern DX friendly starter for Node.js/[Hono](https://github.com/honojs/hono) APIs with the focus on simplicity and robustness.
## Features
- β¨ Node 20
- πΉ TypeScript 5
- β€οΈ Monorepo setup with Turbo and npm workspaces
- π₯ Auto reloading support for monorepo setup
- π Turbo pipeline to run tasks
- β Type and runtime safe environment variables
- π Secure headers by default for APIs
- π‘οΈCORS
- π Robust logger (credits to Practica)
- π Unique request ID (credits to Practica)
- π« Strict linting and type checking rules
- πΆ Husky for Git Hooks
- π Lint git commit with Commitlint
- π¦Ί Unit Testing with native Node.js test runner
- π¦ Optimized esbuild production artifact
- π³ Production ready Dockerfile for deployment## General setup
Manage your Node.js version automatically with [Volta](https://volta.sh)
### Clone the repository
```bash
git clone https://github.com/supersoniko/hono-api-starter.git
```### Install dependencies
```bash
npm i
```### Cat Topia Application
#### Development Server
```
npm run turbo:start:dev:cat-topia
``````bash
open http://localhost:8000
```#### Production simulation
```bash
# Only build JavaScript output
npm run turbo:build:app:cat-topia
# Build and run JavaScript output
npm run turbo:start:app:cat-topia
``````bash
open http://localhost:8000
```#### Production deploy to Fly
This will require [Fly.io CLI](https://fly.io/docs/hands-on/install-flyctl/) to be installed.
```bash
flyctl launch
``````bash
flyctl deploy
```### API Specification
The API specification is written in [RapidAPI/Paw](https://paw.cloud/).
The specification can be be found in the root folder `hono-starter-api-spec.paw`.
### Debugging with VS Code
#### Start any application in `debug` mode
```
npm run turbo:start:debug:cat-topia
```#### Attach debugger in VS Code
Go to the Command Pallete (β§+β+P on macOS), and search for the action "Debug: Attach to Node process".
Choose the node process that looks like this: `node --inspect -r ts-node/register -r tsconfig-paths/register ./src/entry-points/api/server.ts`.
View the [VS Code Debug Actions documentation](https://code.visualstudio.com/Docs/editor/debugging#_debug-actions) for more information regarding the use of their debugger.