Sign in with your admin account to enable edit mode
Add Transporter
Transporter Details
Confirm Delete
Are you sure you want to delete this transporter?
Database Setup
1
Create the table & secure it with RLS
Run this once in Supabase → SQL Editor. It creates the table, keeps reads public (so clients can browse), and restricts add/edit/delete to signed-in admins only:
CREATE TABLE IF NOT EXISTS public.transporters (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
name TEXT NOT NULL,
gst TEXT,
contact TEXT,
map TEXT,
places TEXT,
front_photo_url TEXT,
back_photo_url TEXT,
created_at TIMESTAMPTZ DEFAULT now()
);
-- Row Level Security: public can read, only signed-in admins can write
ALTER TABLE public.transporters ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Public read transporters" ON public.transporters
FOR SELECT USING (true);
CREATE POLICY "Admins insert transporters" ON public.transporters
FOR INSERT WITH CHECK (auth.role() = 'authenticated');
CREATE POLICY "Admins update transporters" ON public.transporters
FOR UPDATE USING (auth.role() = 'authenticated');
CREATE POLICY "Admins delete transporters" ON public.transporters
FOR DELETE USING (auth.role() = 'authenticated');
-- Storage buckets for LR photos (front and back are separate buckets)
INSERT INTO storage.buckets (id, name, public)
VALUES ('LR-Front', 'LR-Front', true)
ON CONFLICT (id) DO NOTHING;
INSERT INTO storage.buckets (id, name, public)
VALUES ('LR-Back', 'LR-Back', true)
ON CONFLICT (id) DO NOTHING;
CREATE POLICY "Public read LR-Front" ON storage.objects
FOR SELECT USING (bucket_id = 'LR-Front');
CREATE POLICY "Admins upload LR-Front" ON storage.objects
FOR INSERT WITH CHECK (bucket_id = 'LR-Front' AND auth.role() = 'authenticated');
CREATE POLICY "Admins delete LR-Front" ON storage.objects
FOR DELETE USING (bucket_id = 'LR-Front' AND auth.role() = 'authenticated');
CREATE POLICY "Public read LR-Back" ON storage.objects
FOR SELECT USING (bucket_id = 'LR-Back');
CREATE POLICY "Admins upload LR-Back" ON storage.objects
FOR INSERT WITH CHECK (bucket_id = 'LR-Back' AND auth.role() = 'authenticated');
CREATE POLICY "Admins delete LR-Back" ON storage.objects
FOR DELETE USING (bucket_id = 'LR-Back' AND auth.role() = 'authenticated');
2
Create your admin login
In the Supabase dashboard, go to Authentication → Users → Add user and create an account with the email and password you want admins to sign in with (repeat for each admin). No code changes needed — the app now signs in against these accounts directly.
3
Confirm sign-up emails are off (recommended)
Under Authentication → Providers → Email, you can leave "Confirm email" on if you want, but since you're creating admin users manually from the dashboard, it doesn't block them from signing in.
4
Test the Connection
Click the button below to check that data can be read from your transporters table.