Supabase Core Functionality for Bloom
# Install dependencies
pnpm install
# Configure environment
cp .env.example .env.local
# Edit .env.local with your Parse Server credentials
# Start local development (requires Docker)
pnpm dev
# Run tests
pnpm testTest the fs function:
curl "http://127.0.0.1:54321/functions/v1/fs/harvest/VuebFgcL0R/Ososi.bloompub" -o test.bloompub- pnpm v11+ (pins its own version via
packageManagerand downloads Node.js v22.20.0 viadevEngines.runtimeinpackage.json— no Volta or manual Node install needed) - Deno v2.9+ (runs and tests the edge functions)
- Docker Desktop (local development only)
- Supabase account
Both package resolvers enforce a 7-day cooldown: a version published less than 7 days ago will not be installed (mitigates compromised-package supply-chain attacks).
- npm side (dev tooling):
minimumReleaseAgeinpnpm-workspace.yaml - Deno side (edge function imports):
minimumDependencyAgeindeno.json
Dependencies are pinned to exact versions (savePrefix: "" for pnpm; exact versions in the
deno.json import map), and CI installs with frozen lockfiles. To update deps, run
pnpm update / deno outdated --update — both respect the cooldown — and commit the
lockfile changes.
supabase/functions/
├── _shared/ # Shared utilities
│ ├── BloomParseServer.ts
│ └── utils.ts
├── fs/ # S3 proxy function (streams book files)
│ ├── index.ts
│ ├── BookData.ts
│ └── README.md
└── tests/ # Deno tests
pnpm dev # Start Supabase
pnpm dev:debug # Start with debugger
pnpm test # Run tests
pnpm test:watch # Run tests in watch mode
pnpm run deploy # Deploy to production ("run" needed: deploy is a pnpm built-in)Streams book files from S3 without exposing bucket details.
URL: /functions/v1/fs/{bucket}/{bookid}/{path...}
Example:
# Get thumbnail
curl "http://localhost:54321/functions/v1/fs/dev-harvest/ZWI7FUQnDd/thumbnails/thumbnail-256.png"
# Download book (streams, no buffering)
curl "http://localhost:54321/functions/v1/fs/harvest/VuebFgcL0R/Ososi.bloompub" -o book.bloompub
# Range request
curl -H "Range: bytes=0-1023" "http://localhost:54321/functions/v1/fs/harvest/VuebFgcL0R/Ososi.bloompub"See supabase/functions/fs/README.md for details.
This project uses a staging → production deployment workflow:
develop→ Staging environment (auto-deploy on push)main→ Production environment (auto-deploy on push)feature/*→ Feature branches (PRs todevelop)
- Develop on feature branch
- PR to
develop→ Runs tests - Merge to
develop→ Deploys to staging - Test in staging
- PR from
developtomain→ Runs tests - Merge to
main→ Deploys to production
Actions tab → Choose workflow → Run workflow
See .github/workflows/README.md for complete documentation.