Clone the repo and install the packages:
git clone https://github.com/Chaxware/backend.git
cd backend
bun install
Next, setup a database (either local, or in the cloud)
- Install the Turso CLI
- Setup local libsql server, and migrate schema:
turso dev --db-file dev.db
bunx drizzle-kit migrate
To host your own database using turso, go to their website,
and create an account. You may create your database during the signup process
(name the database chax
or something).
Then follow the instructions at the quickstart page (upto 2nd step if you have already made a database). Also follow the first step in the TypeScript section.
Create a .env
file in the root directory, and fill it with your URL and token:
DATABASE_URL="<URL (starts with libsql://)>"
DATABASE_TOKEN="<database authentication token>"
Important: You must set the
NODE_ENV
environment variable toproduction
if you need to use the cloud database.
To fill a fresh database with sample data (hubs, channels and messages):
bun bootstrap
Now, you can finally run the server:
bun dev
Note: Whenever you change the schema, run these commands:
bunx drizzle-kit generate
: Generating SQL migration files from Drizzle ORMbunx drizzle-kit migrate
: Push schema changes to database
Fork this repo, and create a project in your vercel account by connecting the forked repo.