-
Create your own
.env
file in the root, setting the following variables:NODE_ENV
, should be one ofdevelopment
orproduction
DISCORD_CLIENT_ID
, same as the application IDDISCORD_TOKEN
- The below keys can be found in the ORM section of the "Connect to your project" modal
DATABASE_URL
, recommended to append?pgbouncer=true
to the end for a better prisma CLI experienceDIRECT_URL
, for running migrations
The DB should already be set up, but incase you are using a different one to our shared supabase testbench, run:
npx prisma db push
If you edit the schema, apply your edit as a migration with this command (it will also push the update to the backend):
npx prisma migrate <ENV> --name <useful_migration_comment>
-
Install pnpm globally via npm:
npm install -g pnpm
-
Install tsx globally:
pnpm install -g tsx
-
Install project dependancies:
pnpm install
-
Start the bot on your local machine using:
pnpm run start
or
pnpm run start:watch
(restarts upon file changes)
The robot can be run within a docker container using docker-compose
. This includes either building the CI
pipeline container for running tests or the deploy
container for running the robot that is the same of what is used on the server.\
-
Ensure you have docker installed and running first.
-
To run a robot, build and run it:
docker-compose build <ci/deploy>
docker-compose run <ci/deploy>
You will know you did everything right when your robot will be connected to discord and running! ๐