Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.

2 changes: 0 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ S3_REGION=local
S3_ACCESS_KEY_ID=accesskeyneedstobeexactly32chars
S3_ACCESS_KEY_SECRET=12345678
S3_MAPS_BUCKET=paradb-maps-test
MEILISEARCH_HOST=https://
MEILISEARCH_KEY=123
FLAGS_IMPLEMENTATION=local
FLAGS_EDGE_CONFIG=
FLAGS_EDGE_CONFIG_KEY=
Expand Down
2 changes: 1 addition & 1 deletion 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 Docker to run third-party services locally (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.

# Tech stack

Expand Down
3 changes: 0 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,12 @@ services:
# - S3_MAPS_BUCKET=${S3_MAPS_BUCKET}
# - BASE_URL=${BASE_URL}
# - S3_ENDPOINT=http://localhost:9000
# - MEILISEARCH_HOST=localhost:7700
# - DYNAMIC_CONFIG_ENDPOINT=http://minio:9000
# volumes:
# - ..:/etc/paradb/paradb
# depends_on:
# meilisearch:
# condition: service_healthy
# minio:
# condition: service_healthy
meilisearch:
extends:
file: docker-compose.yml
service: meilisearch
ports:
- 7700:7700
minio:
image: minio/minio:latest
container_name: paradb_minio
Expand Down
4 changes: 0 additions & 4 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ services:
file: docker-compose.dev.yml
service: paradb
entrypoint: ['tools/docker/test.sh']
meilisearch:
extends:
file: docker-compose.dev.yml
service: meilisearch
minio:
extends:
file: docker-compose.dev.yml
Expand Down
19 changes: 0 additions & 19 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,6 @@ services:
- PGUSER=${PGUSER}
- PGDATABASE=${PGDATABASE}
- PGPASSWORD=${PGPASSWORD}
- MEILISEARCH_HOST=meilisearch:7700
ports:
- 3000:3000
restart: unless-stopped
depends_on:
meilisearch:
condition: service_healthy
meilisearch:
image: getmeili/meilisearch:v1.31
container_name: paradb_meilisearch
environment:
- MEILI_MASTER_KEY=${MEILISEARCH_KEY}
volumes:
- ${MEILISEARCH_DATA_DIR}:/meili_data
ports:
- 7700:7700
restart: unless-stopped
healthcheck:
test: set -o pipefail;curl -fsS http://localhost:7700/health | grep -q '{"status":"available"}'
retries: 5
timeout: 60s
start_period: 10s
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"eslint": "^9",
"eslint-config-next": "16.0.3",
"flags": "^4.0.2",
"meilisearch": "^0.54.0",
"mobx": "^6.15.0",
"mobx-react": "^9.2.1",
"mobx-react-lite": "^4.1.1",
Expand Down
76 changes: 0 additions & 76 deletions src/app/api/maps/search/rebuild/route.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/services/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export type EnvVars = {
s3AccessKeyId: string;
s3AccessKeySecret: string;
s3MapsBucket: string;
searchImplementation: string;
meilisearchHost: string;
meilisearchKey: string;
flagsImplementation: string;
flagsEdgeConfig: string;
flagsEdgeConfigKey: string;
Expand Down Expand Up @@ -54,9 +51,6 @@ function createEnvVars(): EnvVars {
s3AccessKeyId: process.env.S3_ACCESS_KEY_ID,
s3AccessKeySecret: process.env.S3_ACCESS_KEY_SECRET,
s3MapsBucket: process.env.S3_MAPS_BUCKET,
searchImplementation: process.env.SEARCH_IMPLEMENTATION || 'meilisearch',
meilisearchHost: process.env.MEILISEARCH_HOST,
meilisearchKey: process.env.MEILISEARCH_KEY,
flagsImplementation: process.env.FLAGS_IMPLEMENTATION,
flagsEdgeConfig: process.env.FLAGS_EDGE_CONFIG,
flagsEdgeConfigKey: process.env.FLAGS_EDGE_CONFIG_KEY,
Expand Down
12 changes: 4 additions & 8 deletions src/services/maps/maps_repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ export class MapsRepo {
const searchResults = response.hits;
const ids = searchResults.map((r) => r.id);

// Note: hidden or invalid maps may be indexed in Meilisearch, but should be filtered out when
// querying further metadata via `findMaps`.
// TODO: look at stripping hidden/invalid maps from Meilisearch as well, but this should be
// good enough for now.
// Note: hidden or invalid maps may be returned by the search index, but should be filtered out
// when querying further metadata via `findMaps`.
const mapsResult = await this.findMaps({ by: 'id', ids }, user);
if (!mapsResult.success) {
return mapsResult;
Expand Down Expand Up @@ -194,10 +192,8 @@ export class MapsRepo {
const searchResults = searchResponse.hits;
const ids = searchResults.map((r) => r.id);

// Note: hidden or invalid maps may be indexed in Meilisearch, but should be filtered out when
// querying further metadata via `findMaps`.
// TODO: look at stripping hidden/invalid maps from Meilisearch as well, but this should be
// good enough for now.
// Note: hidden or invalid maps may be returned by the search index, but should be filtered out
// when querying further metadata via `findMaps`.
// TODO: include user projection for requesting-user-specific metadata
const mapsResult = await this.findMaps({ by: 'id', ids });
if (!mapsResult.success) {
Expand Down
113 changes: 0 additions & 113 deletions src/services/search/meilisearch.ts

This file was deleted.

20 changes: 1 addition & 19 deletions src/services/server_context.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { rebuildMeilisearchIndex } from 'app/api/maps/search/rebuild/route';
import { Pool } from 'pg';
import { getDbPool } from 'services/db/pool';
import { getEnvVars } from 'services/env';
import { MapsRepo } from 'services/maps/maps_repo';
import { createMeilisearchIndex, meilisearchIndexExists } from 'services/search/meilisearch';
import { getSingleton } from 'services/singleton';
import { FavoritesRepo } from 'services/users/favorites_repo';
import { getLog } from './logging/server_logger';
Expand All @@ -20,25 +17,10 @@ type ServerContext = {
async function createServerContext(): Promise<ServerContext> {
const log = getLog(['server_context']);
log.info('Creating server context');
const envVars = getEnvVars();

const pool = await getDbPool();

let searchIndex: SearchIndex;
if (envVars.searchImplementation === 'postgres') {
searchIndex = new PostgresIndex();
} else {
const meilisearchConfig = {
host: envVars.meilisearchHost,
apiKey: envVars.meilisearchKey,
};

if (!(await meilisearchIndexExists(meilisearchConfig, 'maps'))) {
await rebuildMeilisearchIndex();
}
searchIndex = await createMeilisearchIndex(meilisearchConfig, 'maps');
}
log.info(`Using ${envVars.searchImplementation} search index`);
const searchIndex: SearchIndex = new PostgresIndex();
const mapsRepo = new MapsRepo(searchIndex);
const favoritesRepo = new FavoritesRepo(mapsRepo, searchIndex);

Expand Down