To install dependencies:
pnpm install
To run:
pnpm dev
or for production
pnpm build && pnpm start
- Create a new repo using this as the repository template
- Change
name
inpackage.json
to your service name - Update
CODEOWNERS
file to include your team - Update README.md
- pnpm - package manager
- nodejs - runtime
- TypeScript / tsc - language / compiler
- vitest - test runner
- Hono - web framework for building APIs
- Winston - structured logging
- Dotenv - managing environment variables
- Biome - linting & code formatting
- Docker - building an image for the service
- senv - encrypting & decrypting env variables
src
- application code
src/api
- api endpoint handlers
src/lib
- main code logic, models, etc
tests
- test files. For unit tests, it ideally follows similar folder structure as src
dist
- application build directory
Env variables are defined in .env
and stored as ecrypted values in .env.encrypted
When first starting out with a repo:
- Create a
.env.pass
file with a password to be used for encryption (foo is default for this template):echo -n "foo" >> .env.pass
- Run
pnpm run env:decrypt
to create .env files - Create a more secure password and save it in
.env.pass
- Save this password in 1password so it's shared with the team
- Run
pnpm run env:encrypt
to encrypt the variables with the new password - Commit the encrypted env files
If you follow the example routes, an OpenAPI spec will be auto-generated for you to be used with Swagger or another UI. The spec can be found at {BASE_URL}/openapi.json
when the app is running.