Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .buildkite/pipeline.yml

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

18 changes: 9 additions & 9 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
NEXT_PUBLIC_BASE_URL=http://localhost:3000
PGHOST=
PGPORT=5432
PGUSER=
PGHOST=127.0.0.1
PGPORT=54322
PGUSER=postgres
PGDATABASE=postgres
PGPASSWORD=
PGPASSWORD=postgres
SENTRY_DSN=sentryDsn
SENTRY_ENV=sentryEnv
PUBLIC_S3_BASE_URL=https://test.example.com
S3_ENDPOINT=
S3_ENDPOINT=http://127.0.0.1:54321/storage/v1/s3
S3_REGION=local
S3_ACCESS_KEY_ID=accesskeyneedstobeexactly32chars
S3_ACCESS_KEY_SECRET=12345678
S3_MAPS_BUCKET=paradb-maps-test
MEILISEARCH_HOST=https://
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=123
FLAGS_IMPLEMENTATION=local
FLAGS_EDGE_CONFIG=
FLAGS_EDGE_CONFIG_KEY=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=
SUPABASE_SECRET_KEY=
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave these keys out, they should be supplied by the user

SUPABASE_SECRET_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
AXIOM_API_TOKEN=
AXIOM_DATASET=
NEXT_PUBLIC_AXIOM_API_TOKEN=
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Although you are taking on the persona of an intern developer, your skills are t

This is a website that allows users to host custom maps and songs for a rhythm drumming game called "Paradiddle".
Custom maps consist of a zip file, which contains a .rlrr metadata file along with the audio tracks for the song. The audio tracks can either be the song itself, or the audio stems of the song that can allow the game to play the song without any drum track (as the player will be drumming along themselves).
The codebase uses Docker to run third-party services locally (Meilisearch for search, Minio for a local S3 instance), the local Supabase CLI for running the Supabase database locally, and the standad Next.js dev mode to run the backend and frontend locally.
The codebase uses the local Supabase CLI for running the Supabase database locally (which includes Postgres and Auth), and the standard Next.js dev mode to run the backend and frontend locally. Meilisearch is used for search, and S3 (or MinIO locally) is used for blob storage.

# Tech stack

Expand Down Expand Up @@ -36,9 +36,9 @@ The codebase uses Docker to run third-party services locally (Meilisearch for se

# Commands

- `bun dev` will start local services on Docker
- `bun dev:local` will start Next.js in dev mode with local env
- `bun supabase start` will start Supabase locally
- `bun next dev` will run Next.js in dev mode
- `bun test` will run the test suite
- `bun format` will format the codebase with Prettier
- `bun check` will typecheck and lint

Expand Down
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions Dockerfile.dev

This file was deleted.

25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ git clone https://github.com/bitnimble/paradb.git
cd paradb
bun install

# Install and start postgres
sudo apt install postgresql
sudo service postgresql start
# Start local Supabase (requires Supabase CLI)
bun supabase start

# Create postgres user for yourself
sudo -u postgres createuser --interactive --pwprompt
# Copy the example env file and fill in any missing values
cp .env.test .env.localdev

# Edit .env to fill out your username and password!
# Start the dev server
bun dev:local
```

## Running tests

# Create db and instantiate schema
createdb paradb
db/init.sh
```
# Ensure local Supabase is running
bun supabase start

# Start server
bun dev
# Run tests
bun test
```
47 changes: 0 additions & 47 deletions docker/docker-compose.dev.yml

This file was deleted.

17 changes: 0 additions & 17 deletions docker/docker-compose.test.yml

This file was deleted.

35 changes: 0 additions & 35 deletions docker/docker-compose.yml

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
"dev:local": "dotenv -e .env.localdev -- bun next dev",
"dev:dev": "dotenv -e .env.dev -- bun next dev",
"dev:prod": "dotenv -e .env.prod -- bun next dev",
"build": "sudo docker compose -f docker/docker-compose.yml --env-file .env build",
"start": "sudo docker compose -f docker/docker-compose.yml --env-file .env up --build",
"check": "bun tsc && bun eslint .",
"lint": "eslint .",
"format": "prettier . --write",
"schema": "tools/update_schema.sh",
"test": "sudo docker compose -f docker/docker-compose.test.yml --env-file .env.test up --build --abort-on-container-exit"
"test": "dotenv -e .env.test -- bun jest --runInBand"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.958.0",
Expand Down
6 changes: 3 additions & 3 deletions src/services/jest_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ loadEnvConfig(projectDir);

async function initTestData() {
const { pool } = await getServerContext();
const initialDataSqlPath = path.resolve(__dirname, '../../db/fake_data.sql');
const initialDataSql = await fs.readFile(initialDataSqlPath).then((b) => b.toString());
const seedSqlPath = path.resolve(__dirname, '../../supabase/seed.sql');
Comment thread
bitnimble marked this conversation as resolved.
const seedSql = await fs.readFile(seedSqlPath).then((b) => b.toString());
await pool.query(`
TRUNCATE maps, difficulties, users, favorites CASCADE;
${initialDataSql}
${seedSql}
`);
}

Expand Down
5 changes: 0 additions & 5 deletions tools/docker/start.sh

This file was deleted.

36 changes: 0 additions & 36 deletions tools/docker/test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tools/update_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -euo pipefail

HERE="$(realpath "${0}" | xargs dirname)"

set -a; source "$HERE/../.env.docker"; set +a
set -a; source "$HERE/../.env.localdev"; set +a
bun zapatos
bun supabase gen types typescript --local > "$HERE/../src/services/db/db.types.ts"