Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dayblox/bun

Bun starter
https://github.com/dayblox/bun

bun typescript

Last synced: 3 days ago
JSON representation

Bun starter

Awesome Lists containing this project

README

        

# Bun starter

![](../../actions/workflows/ci.yml/badge.svg)

[![](https://railway.app/button.svg)](https://railway.app/template/G3k1Tv?referralCode=bonus)

## Key Features

- [ TypeScript](https://www.typescriptlang.org/)
- [Typed environment variables](src/env.ts#L5)
- [ Bun](https://bun.sh/)
- [Debugging](.vscode/launch.json)
- [ESM & CommonJS compatibility](https://bun.sh/docs/runtime/modules#module-systems)
- [Fast package manager](https://bun.sh/docs/cli/install)
- [Fast runtime](https://bun.sh/docs/cli/run#performance)
- [Fast test runner](https://bun.sh/docs/cli/test#performance)
- [Highly optimized APIs](https://bun.sh/docs/runtime/bun-apis)
- [Hot reloading](https://bun.sh/docs/runtime/hot#hot-mode)
- [TypeScript first class support](https://bun.sh/docs/runtime/typescript)
- [ Biome](https://biomejs.dev/)
- [Fast formatting](https://github.com/biomejs/biome/tree/main/benchmark#formatting)
- [Fast linting](https://github.com/biomejs/biome/tree/main/benchmark#linting)
- [Import sorting](https://biomejs.dev/analyzer/import-sorting/)
- [ GitHub](https://github.com)
- [One click template](https://github.com/dayblox/bun/generate)
- [Continuous Integration](.github/workflows/ci.yml)

## Prerequisites

- [ Bun](https://bun.sh/) `>=1.0.0`
- [All-in-one toolkit](https://bun.sh/docs)
- [JavaScript runtime](https://bun.sh/docs/cli/run)
- [Package manager](https://bun.sh/docs/cli/install)
- [Test runner](https://bun.sh/docs/cli/test)
- [Bundler](https://bun.sh/docs/bundler)

## Getting Started

1. **[Deploy on Railway](https://railway.app/template/G3k1Tv?referralCode=bonus)** or **[use this template](https://github.com/dayblox/bun/generate)**

2. **Clone** the repository

3. **Install** dependencies

```sh
bun i
```

#

_Optionally_ typecheck environment variables

`.env`

```env
PORT=3000
```

`src/env.ts` ([docs](https://elysiajs.com/validation/elysia-type.html))

```ts
const env = t.Object({
PORT: t.Numeric({ minimum: 1024, maximum: 65535 }),
});
```

## Usage

- **Development** mode (**debug**)

`F5`

- Running **tests** (**watch** mode)

```sh
bun test --watch
```

- **Production** mode

```sh
bun start
```