https://github.com/jd-apprentice/jd-bun
π§
Template repository for my bun projects
https://github.com/jd-apprentice/jd-bun
bun template
Last synced: 11 months ago
JSON representation
π§ Template repository for my bun projects
- Host: GitHub
- URL: https://github.com/jd-apprentice/jd-bun
- Owner: jd-apprentice
- License: mit
- Created: 2024-06-30T02:27:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-15T03:37:35.000Z (over 1 year ago)
- Last Synced: 2025-03-28T02:51:20.746Z (11 months ago)
- Topics: bun, template
- Language: JavaScript
- Homepage: https://bun-template.jonathan.com.ar
- Size: 182 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# π§
Bun template
[](#contributors)
Sample bun template with Turso DB, eslint, prettier, docker, husky, sonarjs, testing with coverage, and more.
## π Features
- β
[Turso](https://turso.tech)
- β
[Kysely](https://www.kysely.dev/)
- β
[Eslint](https://eslint.org/)
- β
[eslint-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)
- β
[eslint-plugin-security](https://github.com/eslint-community/eslint-plugin-security)
- β
[Prettier](https://prettier.io/)
- β
[Husky](https://typicode.github.io/husky/)
- β
[Esdoc](https://esdoc.org/)
- β
[CodeQL](https://codeql.github.com/)
- β
[Joi](https://joi.dev/)
- β
[Sentry](https://sentry.io/)
- β
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:
```shell
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:
```shell
--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
```
```shell
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:
```bash
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 π§
```bash
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
```bash
bun install
bun test (optional)
bun run build
```
2. Build the image manually
Remember to replace `app_name` with the name of your app.
```bash
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](./CONTRIBUTE.md) file
## β¨ Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):