To install dependencies:
bun install
To run:
bun dev
or
bun run build && bun start
This project was created using bun init
in bun v1.1.17. Bun is a fast all-in-one JavaScript runtime.
- Create a new repo using this as the repository template
- Change
name
inpackage.json
to your service name - Change
SERVICE_NAME
in.env.development
and.env.test
- Update README.md
- Bun - javascript runtime, package manager, testing framework
- 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.development
and .env.test
, for development and testing environments respectively.
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 "foo" >> .env.pass
- Run
bun 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
bun run env:encrypt
to encrypt the variables with the new password - Commit the encrypted env files