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

https://github.com/runablehq/dbos-starter-template

This is a template app built with DBOS and Hono.
https://github.com/runablehq/dbos-starter-template

Last synced: about 2 months ago
JSON representation

This is a template app built with DBOS and Hono.

Awesome Lists containing this project

README

          

# Welcome to DBOS!

This is a template app built with DBOS and Hono.

## Running Locally

First, install the application dependencies.

```shell
bun install
```

Next, we need to setup a Postgres database.
DBOS stores application execution history in Postgres.

If you have a Postgres database, you can set the `DBOS_SYSTEM_DATABASE_URL` environment variable to the connection string for that database.
You can set this environment variable directly or you can put it in an `.env` file in the root of this project.
The template app includes an `.env.example` file with a dummy connection string you can use as a reference.

If you don't have a Postgres server, you can start one locally using Docker.
The DBOS SDK includes a utility to start and stop a local Postgres Docker container.

```shell
bunx dbos postgres start
bunx dbos postgres stop
```

> Note, DBOS will automatically connect to Postgres running on localhost if `DBOS_SYSTEM_DATABASE_URL` is not specified.
> If you use a local Postgres Docker container, you do not need to set the `DBOS_SYSTEM_DATABASE_URL` environment variable.

Once you have a setup or configured a Postgres database for DBOS, you can launch the application.

```shell
bun run launch
```

Alternatively, you can run the application in development mode
to enable automatic restart when the application changes.

```shell
bun run dev
```

Once the app is running, visit [`http://localhost:4000`](http://localhost:4000) to see your app.
Then, edit `src/main.ts` to start building!

## Deploying to DBOS Cloud

You can also deploy this app to DBOS Cloud via the Cloud CLI.
Install it globally with this command:

```shell
bun add -g @dbos-inc/dbos-cloud@latest
```

Then, run this command to deploy your app:

```shell
dbos-cloud app deploy
```