Bun monorepo: GraphQL API + data importer for MOHD.
bun install
bun run db:start
bun run db:reset
bun run dev| Command | What |
|---|---|
dev |
Start API locally |
db:start |
Start Postgres |
db:reset |
Import test data |
db:stop |
Stop Postgres |
test:service |
Run local tests |
test:ci |
Run full test suite (CI) |
import |
Run data importer |
deploy:api |
Deploy API to Cloud Run |
deploy:importer |
Deploy importer job |
service/- GraphQL APIimporter/- Data import pipelinemigrations/- Docker setup + test data
Copy .env.example to .env in each package.
Cloud Run needs:
POSTGRES_URL- DB connection stringPOSTGRES_PATH- Cloud SQL socket (optional)
Local access to Cloud SQL:
cloud-sql-proxy PROJECT:REGION:INSTANCE --port=5432Set env:
POSTGRES_URL="postgresql://USER:PASSWORD@localhost:PORT/DATABASE"
bun run import # import all test dataOr manually:
cd importer
bun run src/index.ts --datatype meta --schema public
bun run src/index.ts --datatype rna --schema public
bun run src/index.ts --datatype atac --schema public