एक Cash-on-Delivery स्टोर + एडमिन डैशबोर्ड बनाएँ
Supabase बैकएंड और एडमिन डैशबोर्ड के साथ एक Cash-on-Delivery स्टोर बनाएँ।
रोडमैप और संसाधन
Supabase में ऑर्डर सिस्टम बनाएँ
एक नया Supabase प्रोजेक्ट बनाएँ
Supabase खोलें
https://supabase.com/?utm_source=partner&utm_medium=social&utm_campaign=supasquad&dub_id=faVfKdcLWvKCbYNp
SQL Editor खोलें
SQL Code 1 चलाएँ — Orders टेबल बनाएँ
-- Create orders table create table if not exists public.orders ( id uuid primary key default gen_random_uuid(), customer_name text not null, phone text not null, email text, city text not null, address text not null, country text default 'United States', product_name text not null, product_variant text, quantity int not null default 1, notes text, status text not null default 'pending', -- pending, confirmed, shipped, cancelled created_at timestamptz default now() ); -- Enable RLS alter table public.orders enable row level security;
SQL Code 2 चलाएँ — Profiles टेबल बनाएँ
-- Create profiles table create table if not exists public.profiles ( user_id uuid primary key references auth.users(id) on delete cascade, role text not null default 'user' ); -- Enable RLS alter table public.profiles enable row level security;
Authentication → Users में एक एडमिन उपयोगकर्ता बनाएँ
SQL Code 3 चलाएँ — एडमिन भूमिका असाइन करें
USER_ID को अपने UID से बदलें
insert into public.profiles (user_id, role) values ('PUT_USER_ID_HERE', 'admin');
SQL कोड — सुरक्षा पॉलिसी (RLS)
SQL Code 4 — Profiles पढ़ने की पॉलिसी
-- Profiles are readable by owner create policy "Profiles are readable by owner" on public.profiles for select to authenticated using (auth.uid() = user_id);
SQL Code 5 — सार्वजनिक ऑर्डर Insert पॉलिसी
-- Public can create orders create policy "Public can create orders" on public.orders for insert to anon with check ( status = 'pending' );
SQL Code 6 — एडमिन ऑर्डर देखने की पॉलिसी
-- Admins can view all orders create policy "Admins can view all orders" on public.orders for select to authenticated using ( exists ( select 1 from public.profiles where profiles.user_id = auth.uid() and profiles.role = 'admin' ) );
SQL Code 7 — एडमिन ऑर्डर अपडेट पॉलिसी
-- Admins can update all orders create policy "Admins can update all orders" on public.orders for update to authenticated using ( exists ( select 1 from public.profiles where profiles.user_id = auth.uid() and profiles.role = 'admin' ) ) with check ( exists ( select 1 from public.profiles where profiles.user_id = auth.uid() and profiles.role = 'admin' ) );
Project URL और Publishable Key कॉपी करें
ऑर्डर फ़ॉर्म के साथ स्टोर बनाएँ
चेकलिस्ट
अपनी Supabase Project URL दर्ज करें
अपनी Supabase Publishable Key दर्ज करें
उत्पन्न प्रॉम्प्ट कॉपी करें
Google AI Studio में स्टोर पेज उत्पन्न करें
एक टेस्ट ऑर्डर सबमिट करें
Supabase → Orders टेबल में ऑर्डर सत्यापित करें
इस चरण में उपयोग किया गया प्रॉम्प्ट
Prompt 1 — स्टोर + ऑर्डर फ़ॉर्म उत्पन्न करें
You are building a web app INSIDE this Google AI Studio project. Task: Create a beautiful, premium, light-mode single-page Cash-on-Delivery (COD) store TEMPLATE (one product) that is simple and beginner-friendly to customize. IMPORTANT OUTPUT RULES: - Do NOT paste the full HTML/CSS/JS code in the chat. - Instead, create/update the project files directly. - After you finish, reply with: 1) A short bullet summary of what you built 2) Where beginners should edit the template (the exact variables/sections) Design (Light Mode): - Clean white / soft light gray background with a subtle pastel gradient. - Modern premium SaaS look (Apple/Stripe style). - Elegant spacing, rounded corners, soft shadows. - Looks great on mobile. Template placeholders (make them easy to edit): - STORE_NAME: "YOUR STORE NAME" - PRODUCT_NAME: "YOUR PRODUCT NAME" - PRODUCT_DESCRIPTION: "YOUR PRODUCT DESCRIPTION" - PRICE_PER_UNIT: 49 - CURRENCY: "USD" - Variants: "Variant A", "Variant B", "Variant C" - Default country: "United States" Sections to include (keep it simple): 1) Header (store name + link scroll to “How COD Works”) 2) Hero (product name, description, CTA buttons) 3) Benefits (3 cards) 4) How COD Works (3 steps) 5) Order Form (most important) + Order Summary (price x quantity) 6) FAQ (3 items) 7) Footer Supabase (INSERT only): - Use Supabase JS client. - Use placeholders: SUPABASE_URL = "{{SUPABASE_URL}}" SUPABASE_PUBLISHABLE_KEY = "{{SUPABASE_PUBLISHABLE_KEY}}" - On form submit: INSERT into table "orders" with: customer_name, phone, email, city, address, country, product_name, product_variant, quantity, notes, status="pending" Critical rules: - INSERT only. Do NOT use select/update/delete. - Show success banner on success, generic error banner on failure. - Validate required fields with small inline errors. - Disable the submit button while sending. Now build it inside the project so I can run it immediately.
Supabase Project URL
अपनी Supabase Project URL यहाँ पेस्ट करें
Supabase Publishable Key
अपनी Supabase publishable key यहाँ पेस्ट करें
एडमिन डैशबोर्ड बनाएँ
चेकलिस्ट
अपनी Supabase Project URL दर्ज करें
अपनी Supabase Publishable Key दर्ज करें
उत्पन्न प्रॉम्प्ट कॉपी करें
Google AI Studio में एडमिन डैशबोर्ड उत्पन्न करें
Supabase एडमिन खाते का उपयोग करके लॉग इन करें
इस चरण में उपयोग किया गया प्रॉम्प्ट
Prompt 2 — एडमिन डैशबोर्ड उत्पन्न करें
You are an expert full-stack engineer. Build a modern admin dashboard for managing Cash-on-Delivery (COD) orders using Supabase. Use the following Supabase credentials: SUPABASE_URL = "{{SUPABASE_URL}}" SUPABASE_KEY = "{{SUPABASE_KEY}}" The database contains a table called: orders Fields include: customer_name, email, phone, city, address, product_variant, quantity, status, created_at. The dashboard should allow an admin to: • log in • view order statistics • see recent orders • search and filter orders • update order status • customize the application name in settings Design it as a clean modern SaaS dashboard with a light Apple-style UI. Keep the implementation simple and produce a fully working result.
Supabase Project URL
अपनी Supabase Project URL यहाँ पेस्ट करें
Supabase Publishable Key
अपनी Supabase Publishable Key यहाँ पेस्ट करें
प्रोजेक्ट डिप्लॉय करें
चेकलिस्ट
Google AI Studio से प्रोजेक्ट को GitHub पर सहेजें
Hostinger पर एक Node.js Web App होस्टिंग बनाएँ
GitHub रिपॉज़िटरी इम्पोर्ट करें
लाइव प्रोजेक्ट URL खोलें
इस चरण में उपयोग की गई होस्टिंग
Hostinger पर डिप्लॉय करें
इस प्रोजेक्ट को वीडियो में दिखाए गए उसी सेटअप के साथ पब्लिश करें।
RECOMMENDED
https://www.hostg.xyz/SHJ9M
Upgrade — स्वचालित ईमेल नोटिफिकेशन
यह अपग्रेड स्टोर को अधिक व्यावहारिक बनाता है, जब भी कोई नया ऑर्डर दिया जाता है तो स्वचालित ईमेल भेजकर।
- स्टोर के मालिक को नई ऑर्डर ईमेल मिलती है
- ग्राहक को ऑर्डर पुष्टिकरण ईमेल मिलता है
अपने AI स्टोर को स्वचालित रूप से ईमेल भेजने दें (Supabase ट्यूटोरियल)
ट्यूटोरियल देखें
https://www.youtube.com/watch?v=NK6ztA_-0cE