This is a template app built with DBOS and Hono.
First, install the application dependencies.
bun installNext, 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.
bunx dbos postgres start
bunx dbos postgres stopNote, DBOS will automatically connect to Postgres running on localhost if
DBOS_SYSTEM_DATABASE_URLis not specified. If you use a local Postgres Docker container, you do not need to set theDBOS_SYSTEM_DATABASE_URLenvironment variable.
Once you have a setup or configured a Postgres database for DBOS, you can launch the application.
bun run launchAlternatively, you can run the application in development mode to enable automatic restart when the application changes.
bun run devOnce the app is running, visit http://localhost:4000 to see your app.
Then, edit src/main.ts to start building!
You can also deploy this app to DBOS Cloud via the Cloud CLI. Install it globally with this command:
bun add -g @dbos-inc/dbos-cloud@latestThen, run this command to deploy your app:
dbos-cloud app deploy