From f72a2bbc2b58007432bcc7b9fc58f34944dcb808 Mon Sep 17 00:00:00 2001 From: shrav784 Date: Thu, 26 Mar 2026 23:56:47 +0530 Subject: [PATCH 1/5] docs: add Supabase schema and seed instructions --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 07d283d..3fc1cab 100644 --- a/README.md +++ b/README.md @@ -182,21 +182,48 @@ uvicorn main:app --reload To populate the database with initial data, follow these steps: -1. **Open Supabase Dashboard** - - Go to [Supabase](https://supabase.com/) and log in. +1. **Open Supabase Dashboard** + - Go to https://supabase.com/ and log in. - Select your created project. 2. **Access the SQL Editor** - In the left sidebar, click on **SQL Editor**. -3. **Run the SQL Script** +3. **Create Required Tables** + - Run the following SQL in the Supabase SQL Editor: + + ```sql + -- Create Tables (Schema) + CREATE TABLE public.users ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + username TEXT UNIQUE NOT NULL, + email TEXT UNIQUE NOT NULL, + role TEXT, + profile_image TEXT, + bio TEXT, + created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() + ); + + -- Seed Initial Data + INSERT INTO public.users (username, email, role, bio) + VALUES + ('creator1', 'creator1@example.com', 'creator', 'Bio of creator1'), + ('brand1', 'brand1@example.com', 'brand', 'Bio of brand1') + ON CONFLICT (username) DO NOTHING; + ``` + + +4. **Run the SQL Script** - Open the `sql.txt` file in your project. - Copy the SQL queries from the file. - Paste the queries into the SQL Editor and click **Run**. -This will populate the database with the required initial data for the platform. 🚀 + + + + --- From 630bcf72b185154bd8ca78fe63297fe018ea8569 Mon Sep 17 00:00:00 2001 From: shrav784 Date: Fri, 27 Mar 2026 19:07:51 +0530 Subject: [PATCH 2/5] docs: finalize supabase setup instructions --- README.md | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 3fc1cab..3665137 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ To populate the database with initial data, follow these steps: 1. **Open Supabase Dashboard** - - Go to https://supabase.com/ and log in. + - Go to Supabase Dashboard (https://supabase.com/) and log in. - Select your created project. 2. **Access the SQL Editor** @@ -192,38 +192,30 @@ To populate the database with initial data, follow these steps: - In the left sidebar, click on **SQL Editor**. 3. **Create Required Tables** - - Run the following SQL in the Supabase SQL Editor: - - ```sql - -- Create Tables (Schema) - CREATE TABLE public.users ( - id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - username TEXT UNIQUE NOT NULL, - email TEXT UNIQUE NOT NULL, - role TEXT, - profile_image TEXT, - bio TEXT, - created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() - ); - - -- Seed Initial Data - INSERT INTO public.users (username, email, role, bio) - VALUES - ('creator1', 'creator1@example.com', 'creator', 'Bio of creator1'), - ('brand1', 'brand1@example.com', 'brand', 'Bio of brand1') - ON CONFLICT (username) DO NOTHING; - ``` - + - Run the following SQL in the Supabase SQL Editor: +```sql + -- Enable pgcrypto extension for gen_random_uuid() support + CREATE EXTENSION IF NOT EXISTS "pgcrypto"; + + -- Create Tables (Schema) + CREATE TABLE IF NOT EXISTS public.users ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + username TEXT UNIQUE NOT NULL, + email TEXT UNIQUE NOT NULL, + role TEXT NOT NULL, + profile_image TEXT, + bio TEXT, + is_online BOOLEAN DEFAULT FALSE, + last_seen TIMESTAMP WITH TIME ZONE, + created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() + ); +``` 4. **Run the SQL Script** - Open the `sql.txt` file in your project. - Copy the SQL queries from the file. - Paste the queries into the SQL Editor and click **Run**. - - - - - + - The script includes conflict handling to avoid duplicate entries based on unique constraints. --- From 0d9e42f150e860392c6cf95a55320375391cd29f Mon Sep 17 00:00:00 2001 From: shrav784 Date: Sat, 28 Mar 2026 23:35:41 +0530 Subject: [PATCH 3/5] docs: fix schema and onboarding flow based on review --- README.md | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 3665137..defd72e 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ To populate the database with initial data, follow these steps: 1. **Open Supabase Dashboard** - - Go to Supabase Dashboard (https://supabase.com/) and log in. + - Go to https://supabase.com/ and log in. - Select your created project. 2. **Access the SQL Editor** @@ -192,32 +192,28 @@ To populate the database with initial data, follow these steps: - In the left sidebar, click on **SQL Editor**. 3. **Create Required Tables** - - Run the following SQL in the Supabase SQL Editor: + - Paste and run the following SQL in the Supabase SQL Editor: + ```sql - -- Enable pgcrypto extension for gen_random_uuid() support - CREATE EXTENSION IF NOT EXISTS "pgcrypto"; - - -- Create Tables (Schema) - CREATE TABLE IF NOT EXISTS public.users ( - id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - username TEXT UNIQUE NOT NULL, - email TEXT UNIQUE NOT NULL, - role TEXT NOT NULL, - profile_image TEXT, - bio TEXT, - is_online BOOLEAN DEFAULT FALSE, - last_seen TIMESTAMP WITH TIME ZONE, - created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() - ); +CREATE EXTENSION IF NOT EXISTS "pgcrypto"; + +CREATE TABLE IF NOT EXISTS public.users ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + username TEXT UNIQUE NOT NULL, + email TEXT UNIQUE NOT NULL, + role TEXT NOT NULL, + profile_image TEXT, + bio TEXT, + is_online BOOLEAN NOT NULL DEFAULT FALSE, + last_seen TIMESTAMP WITH TIME ZONE, + created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() +); ``` 4. **Run the SQL Script** - Open the `sql.txt` file in your project. - Copy the SQL queries from the file. - - Paste the queries into the SQL Editor and click **Run**. - - The script includes conflict handling to avoid duplicate entries based on unique constraints. - ---- + - Paste into the SQL Editor and click **Run**. ## Contributing From db913a64d8af46bf662362a9c7a26f05b89c2cb1 Mon Sep 17 00:00:00 2001 From: shrav784 Date: Sat, 28 Mar 2026 23:42:04 +0530 Subject: [PATCH 4/5] docs: fix schema and onboarding flow based on review --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index defd72e..eef1921 100644 --- a/README.md +++ b/README.md @@ -210,8 +210,8 @@ CREATE TABLE IF NOT EXISTS public.users ( ); ``` -4. **Run the SQL Script** - - Open the `sql.txt` file in your project. +1. **Run the SQL Script** + - Open `Backend/sql.txt` in your project. - Copy the SQL queries from the file. - Paste into the SQL Editor and click **Run**. From 8dd522748c7d60fa5e9cea3f9ea15f72949fb11f Mon Sep 17 00:00:00 2001 From: shrav784 Date: Sat, 28 Mar 2026 23:51:14 +0530 Subject: [PATCH 5/5] docs: fix schema and onboarding flow based on review --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index eef1921..c12f786 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ CREATE TABLE IF NOT EXISTS public.users ( - Open `Backend/sql.txt` in your project. - Copy the SQL queries from the file. - Paste into the SQL Editor and click **Run**. + - ⚠️ Note: This script contains plain INSERT statements and should be run only once during initial setup. Re-running it may cause duplicate key errors due to unique constraints on username and email. ## Contributing