Skip to content

Base template for a Bun server using Elysia for routing and Prisma as the ORM for a Postgres database

Notifications You must be signed in to change notification settings

cdbrw/bun-elysia-prisma-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy on Railway

Bun with Elysia & Prisma

This is a template repo for the base of a Bun server using Elysia for the API and Prisma as the ORM for a Postgres DB.

You can deploy on Railway or simply create a new repo using this template.

Development

Install dependencies

bun install

Start a Docker container for the Postgres database

docker run --name dev-postgres -p 5432:5432 -e POSTGRES_PASSWORD=12345678 -d postgres

Add the DATABASE_URL env variable to a .env file

DATABASE_URL="postgresql://postgres:12345678@localhost:5432/postgres?schema=public"

To start the development server run:

bun run dev

Open http://localhost:3000/ with your browser to see the result.

Production

  1. Ensure the DATABASE_URL env variable is set to ${{Postgres.DATABASE_URL}}
  2. Set custom build command to bunx prisma migrate deploy in order to run database migrations

About

Base template for a Bun server using Elysia for routing and Prisma as the ORM for a Postgres database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published