Simple realtime sketching app for collaboration built with Supabase. Showcases realtime feature with Postgrest and annonymous signin
Supa.Sketcher.Kotlin.mp4
Note
This project aims to showcase the usage of the platform and not focus on architecture. So do not follow archiecture practices here. For app archiecture, follow official guide from Android Developers or your own reference
Supabase Postgrest table
Stroke table
create table strokes (
id uuid primary key default uuid_generate_v4(),
session_id text not null,
points jsonb not null,
color bigint not null,
stroke_width real not null,
created_at timestamp with time zone default now()
);
Enable real time for Strokes
alter table strokes replica identity full;
begin;
drop publication if exists supabase_realtime;
create publication supabase_realtime for all tables;
commit;
Session table
create table sessions (
id uuid primary key default uuid_generate_v4(),
name text not null,
created_at timestamp with time zone default now()
);
Enable annonymous RLS for Session
create policy "Allow anonymous select" on sessions for select using (true);
create policy "Allow anonymous insert" on sessions for insert with check (true);
alter table sessions enable row level security;
Enable Anonymoust Sign In in Authentication

In local.properties
file, update these values
supabaseUrl=SUPPLY_THIS
supabaseKey=SUPPLY_THIS