This is the backend API for the AFCON Challenge project. It is built using Bun, Elysia, Prisma, and PostgreSQL.
Clone the repo:
git clone https://github.com/afcon-challenge/backendYou need to have Docker installed.
Note
You'll need to change the domain in the Caddyfile to your domain name.
Then you can run the following commands:
cp .env.example .env # To create a .env file
docker compose up -d # To get everything up and running
docker compose exec api bunx prisma migrate deploy # Run the database migrationAlso, check useful commands in production.
You need to have Bun installed.
cp .env.example .env # To create a .env file
bun i # To install dependencies
bun start # To start the server
bun dev # To start the development serverCheck logs in real-time:
docker compose logs -fCheck logs of some service, api for example:
docker compose logs api -f Rebuild:
docker compose up --build -d Connect to the database using psql (mydb is the database used by the api):
docker compose exec db psql -U judge0 -d mydbExecute some SQL statement without connection:
docker compose exec db psql -U judge0 -d mydb -c 'SELECT username, verdict, "createdAt" FROM "Submission" ORDER BY "createdAt" DESC;'