Adds real-time collaboration to an IGV.js view, with share links and saved annotations.
Test it out at https://igv.sandbox.bio/.
- Supabase account with free tier (needed even for local dev unless you setup their open source infra yourself)
- Cloudflare account (not needed for local dev)
After cloning this repo, create a .env
file in the root folder that contains your Supabase database's public URL and anonymous key:
PUBLIC_SUPABASE_URL = "https://YOUR_SUPABASE_PROJECT_ID.supabase.co"
PUBLIC_SUPABASE_KEY_ANON = "YOUR_SUPABASE_ANON_KEY"
SUPABASE_KEY_ADMIN = "YOUR_SUPABASE_ADMIN_KEY"
You'll find that information in your Supabase dashboard under Settings --> API.
Make sure you use the anonymous key for PUBLIC_SUPABASE_KEY_ANON
since it is exposed on the frontend, which is intended.
The SQL needed to create the table that stores information about each IGV session:
create table
public.rooms_stg (
id bigint generated by default as identity not null,
uuid text not null,
name text null,
config jsonb null,
regions jsonb not null default '[]'::jsonb,
time_created timestamp with time zone null default now(),
constraint rooms_pkey primary key (id)
) tablespace pg_default;
In your Cloudflare account's dashboard, set up Cloudflare Pages. In the form:
- Connect your fork of this repo so that it gets deployed every time you push to
main
- For build settings, choose the Svelte Kit preset
- For environment variables, set:
NODE_VERSION=16
PUBLIC_SUPABASE_URL = "https://YOUR_SUPABASE_PROJECT_ID.supabase.co"
PUBLIC_SUPABASE_KEY_ANON = "YOUR_SUPABASE_ANON_KEY"
SUPABASE_KEY_ADMIN = "YOUR_SUPABASE_ADMIN_KEY" # Make sure to click the encrypt icon for this one
npm run dev