Skip to content

bijancn/justdecide

Repository files navigation

JustDecide

JustDecide is a simple, fast and fun decision-making tool for groups of equals. It combines the fast pace of centralized decision making with the diverse perspectives of a group. Try it at https://justdecide.io

Tech-Stack

  • Frontend:
    • Next.js - a React framework for production.
    • Supabase.js for user management and realtime data syncing.
  • Backend:
    • app.supabase.io: hosted Postgres database with restful API for usage with Supabase.js.

Supabase details

Postgres Row level security

This project uses very high-level Authorization using Postgres' Role Level Security. When you start a Postgres database on Supabase, we populate it with an auth schema, and some helper functions. When a user logs in, they are issued a JWT with the role authenticated and thier UUID. We can use these details to provide fine-grained control over what each user can and cannot do.

This is a trimmed-down schema, with the policies:

create table todos (
  id bigint generated by default as identity primary key,
  user_id uuid references auth.users not null,
  task text check (char_length(task) > 3),
  is_complete boolean default false,
  inserted_at timestamp with time zone default timezone('utc'::text, now()) not null
);

alter table todos enable row level security;

create policy "Individuals can create todos." on todos for
    insert with check (auth.uid() = user_id);

create policy "Individuals can view their own todos. " on todos for
    select using (auth.uid() = user_id);

create policy "Individuals can update their own todos." on todos for
    update using (auth.uid() = user_id);

create policy "Individuals can delete their own todos." on todos for
    delete using (auth.uid() = user_id);

About

Make decisions like humans

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published