A simple chat app that allows you to chat with people who are online in the same room as you.
This project was built for the Supabase Launch Week X Hackathon.
After successful initial release, the following features are planned:
- End-to-end encryption
- Optional user authentication
- Mobile app
For a detailed information about the roadmap, please refer to the project board.
If you like this project, please support us by leaving a star on this repo!!
The app is built with the following technologies:
There is only one table in the database, room
, which is defined as follows:
create table
public.room (
id uuid not null default gen_random_uuid (),
created_at timestamp with time zone not null default now(),
private boolean not null default true,
online_members uuid[] null,
creator uuid null,
room_code text null,
constraint room_pkey primary key (id)
) tablespace pg_default;
Row Level Security (RLS) is not defined to not allow any direct interactions with the database by the clients. Instead, all interactions are done through the Edge Functions.
All edge functions are defined in the supabase/functions
directory and are hosted on Supabase.
Install the pg_cron extension on Supabase and run the following SQL query to schedule the cron job to clean up old rooms every three hours:
select cron.schedule(
'cleanup-of-old-rooms',
'0 */3 * * *', -- Every three hours
$$ delete from shortlinks where created_at < now() - interval '3 hours' $$
)
This project is licensed under the MIT License - see the LICENSE file for details. The project is fully open source, and we welcome contributions from the community.