Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 6 min read How-to mediumAdept

Self-host Maps with Protomaps and Supabase Storage

Protomaps lets you serve a self-hosted vector basemap as a single static PMTiles file, and Supabase Storage supports the HTTP Range Requests needed to read it directly from a public bucket. The walkthrough extracts a bounding box with the pmtiles CLI, uploads it, and renders it with MapLibre GL via the pmtiles protocol. Because public bucket CORS can't be configured, a Deno Edge Function can proxy range requests to a private bucket using the service role key and enforce an origin allowlist. Optionally, Expo's experimental 'use dom' components can run react-map-gl in React Native, since maplibre-react-native lacks custom protocol support.

Assumes: HTTP range requestsCORS basicsJavaScript web mapping

Related posts

  • Generate Vector Tiles with PostGIS

    Supabase mediumAdept

    PostGIS can generate Mapbox Vector Tiles on demand from Postgres rows, so a MapLibre GL client can render large point datasets while transferring only the data for the current viewport and zoom level. The pipeline downloads Overture Maps places as GeoJSON, converts them to SQL with GDAL ogr2ogr, and imports them into Supabase with psql. A plpgsql `mvt(z,x,y)` function then uses ST_TileEnvelope, ST_AsMVTGeom and ST_AsMVT to return base64-encoded tiles. A custom MapLibre `addProtocol` handler calls that function through supabase-js RPC. Payloads stay small because names and ids are included only above zoom 13, and detailed metadata is fetched on click instead of being encoded in the tiles.

  • Supabase Storage now in Beta

    Supabase mediumAdept

    Supabase Storage moves to Beta with range-request streaming for audio/video, whole-bucket public visibility (private by default, to avoid S3-style per-object exposure), directory uploads via the File and Directory Entries API, an RLS policy editor with SQL templates, and a local-filesystem backend so self-hosted setups need no S3. To keep supabase-js small and universal without a FormData polyfill or separate Node/browser bundles, the server now accepts raw binary bodies, letting clients upload Buffers, Blobs and Node streams. The dashboard emulates filesystem semantics on S3: move becomes copy-then-delete, and placeholder files keep empty directories from disappearing. Upsert support and list virtualization for large buckets are also added.

  • Supabase Edge Runtime: Self-hosted Deno Functions

    Supabase mediumAdept

    Supabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes. A hyper HTTP server forwards requests to a Main Worker V8 isolate, which can create sandboxed User Worker isolates with restricted APIs and configurable memory (default 150 MB) and wall-clock (default 60s) limits. It also powers `supabase functions serve` for serving all functions locally with hot reload and Deno Deploy API parity, and a Fly.io walkthrough shows how to deploy it. Planned uses include replacing Kong as an API gateway, scheduled functions, and custom platform globals.

  • Edge Functions are now available in Supabase

    Supabase easyNovice

    Supabase Edge Functions run TypeScript globally on the Deno runtime via Deno Deploy across 30+ data centers. Supabase chose functions-as-a-service over containers for simpler developer experience and faster start-ups, and global deployment over a single region, with Postgres-colocated Database Functions covering DB-heavy work. Requests pass through a Relay gateway that verifies JWTs, rate-limits and logs, then maps function metadata to a Deno Deploy deployment ID. Cold starts fetch code and secrets from Supabase, and logs flow through Logflare into the dashboard. Functions are POST-only, and static hosting is ruled out after phishing abuse on Supabase Storage got the domain denylisted.

  • Edge Functions: Node and native npm compatibility

    Supabase mediumAdept

    Supabase Edge Functions now natively support npm modules (via `npm:` imports) and Node built-in APIs, so existing Node apps using Express, node-postgres and Drizzle can migrate with minimal changes. Under the hood, the open-source Deno-based Supabase Edge Runtime serializes each function's module graph into a single eszip at deploy time and loads all modules from it in the hosted, local and self-hosted environments alike. This avoids fetch latency, dependency conflicts with locally installed packages, and bugs such as failures when a deno.lock file is present. The release also adds regional invocation via an `x-region` header, CPU/memory and status-code metrics in the dashboard, and error tracking through Sentry's Deno SDK.

The quest for software engineering knowledge.

Look:
Layout: