Skip to content

jd-apprentice/jd-bun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§… Bun template

All Contributors

Sample bun template with Turso DB, eslint, prettier, docker, husky, sonarjs, testing with coverage, and more.

πŸ“š Features

🧰 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.

  1. Prepare the binary
bun install
bun test (optional)
bun run build
  1. 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

✨ Contributors

Thanks goes to these wonderful people (emoji key):


Jonathan Dyallo

πŸ’» ⚠️ πŸ“– 🚧