Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/desoga10/ng-chat-v
In this tutorial, we delve into creating a powerful real time Chat application using Angular 17 and Supabase. Here is the link to the tutorial on YouTube: https://www.youtube.com/watch?v=8SRhekaJ5iI
https://github.com/desoga10/ng-chat-v
angular angular17 angular2 supabase supabase-auth supabase-db supabase-functions supabase-storage supabase-trigger
Last synced: 4 months ago
JSON representation
In this tutorial, we delve into creating a powerful real time Chat application using Angular 17 and Supabase. Here is the link to the tutorial on YouTube: https://www.youtube.com/watch?v=8SRhekaJ5iI
- Host: GitHub
- URL: https://github.com/desoga10/ng-chat-v
- Owner: desoga10
- Created: 2024-04-22T01:50:22.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-04-22T01:52:35.000Z (9 months ago)
- Last Synced: 2024-09-26T19:23:51.171Z (4 months ago)
- Topics: angular, angular17, angular2, supabase, supabase-auth, supabase-db, supabase-functions, supabase-storage, supabase-trigger
- Language: TypeScript
- Homepage: https://ng-chat-v.vercel.app
- Size: 479 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## users table
* id (uuid)
* full_name (text)
* avatar_url (text)## Creating a users table
```sql
CREATE TABLE public.users (
id uuid not null references auth.users on delete cascade,
full_name text NULL,
avatar_url text NULL,
primary key (id)
);
```## Enable Row Level Security
```sql
ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;
```## Permit Users Access Their Profile
```sql
CREATE POLICY "Permit Users to Access Their Profile"
ON public.users
FOR SELECT
USING ( auth.uid() = id );
```## Permit Users to Update Their Profile
```sql
CREATE POLICY "Permit Users to Update Their Profile"
ON public.users
FOR UPDATE
USING ( auth.uid() = id );
```## Supabase Functions
```sql
CREATE
OR REPLACE FUNCTION public.user_profile() RETURNS TRIGGER AS $$ BEGIN INSERT INTO public.users (id, full_name,avatar_url)
VALUES
(
NEW.id,
NEW.raw_user_meta_data ->> 'full_name'::TEXT,
NEW.raw_user_meta_data ->> 'avatar_url'::TEXT,
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
```## Supabase Trigger
```sql
CREATE TRIGGER
create_user_trigger
AFTER INSERT ON auth.users
FOR EACH ROW
EXECUTE PROCEDURE
public.user_profile();
```## Chat_Messages table (Real Time)
* id (uuid)
* Created At (date)
* text (text)
* editable (boolean)
* sender (uuid)