🧅 Bun template
Sample bun template with Turso DB, eslint, prettier, docker, husky, sonarjs, testing with coverage, and more.
📚 Features
- ✅ Turso
- ✅ Kysely
- ✅ Eslint
- ✅ eslint-sonarjs
- ✅ eslint-plugin-security
- ✅ Prettier
- ✅ Husky
- ✅ Esdoc
- ✅ CodeQL
- ✅ Joi
- ✅ Sentry
- ✅ Jsconfig with checkjs and strict
- ✅ Docker ready
- ✅ Bun ready
- ✅ Bun testing with coverage
- ✅ Path aliases
- ✅ Types
🧰 Requirements
- Bun (^1.1.13)
- Docker (optional)
💾 Instalation
To install BUN, do the following:
curl -fsSL https://bun.sh/install | bash
Now we are going to do a bun create with this template.
Just in case, here are additiona flags for the bun create command:
--force Overwrite existing files
--no-install Skip installing node_modules & tasks
--no-git Don’t initialize a git repository
--open Start & open in-browser after finish
mkdir your_app
bun create github.com/jd-apprentice/jd-bun your_app
cd your_app
cp .env.example .env
Make sure to complete the .env file with the following information:
| Variable | Description |
|---|---|
| TURSO_URL | Turso url |
| TURSO_DB_TOKEN | Turso db token |
Change the default names with the following script:
bun run replace
$ bash ./scripts/app_name.sh
Enter the new name: sample
Replacement completed. 🚀
This will replace all app_name with sample in the project.
Run with Bun 🧅
make
This will build the app with bunjs and execute the binary.
Run with Docker 🐳
Bun still needs to be installed to build the binary.
- Prepare the binary
bun install
bun test (optional)
bun run build
- Build the image manually
Remember to replace app_name with the name of your app.
docker build -f docker/base-x86_64.Dockerfile -t app_bin .
docker build -f docker/app.Dockerfile -t app_name .
docker compose up -d
🤝 Contribute
- For more information, check the CONTRIBUTE file
✨ Contributors
Thanks goes to these wonderful people (emoji key):
<table>
<tr>
<td align="center">
<sub><b>Jonathan Dyallo</b></sub>
💻 ⚠️ 📖 🚧</td>
</tr>
</table>