search engine sync service + utilities
This repository contains a bun monorepo for the following workspaces:
-
/packages/sync-service: Bun database sync service, main deployment for this repository. Responsible for syncronizing database rows fromcatalog-prod-> documents added + indexed into the Meilisearch instance. -
/packages/search-utils: Published utility package for usage in client code. This package contains a filter expression builder and exported types for meilisearch responses. -
/packages/dashboard: SvelteKit based admin dashboard for configuring, monitoring and testing the deployed (or locally running) search engine.
catalog-search is a meilisearch based service that encompases the search engine service, our database sync/cdc service, and a companion admin dashboard web application. This service exists to provide fast, responsive search results for things like artist names, albums, etc.
flowchart TD
A[Postgres Trigger] -->|table update| B(Sync Service)
B --> A
B --> C{CRUD op search document}
C -->|Call meilisearch| D[Update document]
The sync service exists to receive and format relevant data from our production postgres database, including flattening relational data into a single record compatible with meilisearch.
In production, catalog-search is deployed on Railway. The meilisearch service instance is deployed via the getmeili/meilisearch docker image, and the sync-service is deployed from this repo.
The admin dashboard is a sveltekit web application and deployed via Vercel.
Setup local doppler env with
doppler setupRun the catalog-prod database locally.
To install dependencies:
bun installTo run:
bun dev:docker:localThis project was created using bun init in bun v1.2.5. Bun is a fast all-in-one JavaScript runtime.