EkanntoBangladesh Business OS
CONTROL CENTRE DOCUMENTATION

Admin guide

Secure setup and everyday admin operations for the standalone Ekannto project.

1Configure Supabase

Open config.js and set your Supabase project URL and public anon/publishable key. Do not add the service-role key, R2 access key, or R2 secret key to browser files. Run the complete supabase/schema.sql in the Supabase SQL editor.

2Assign the first admin

Create your account through Supabase Auth, then find its UUID in Authentication → Users. In SQL Editor, run the following after replacing the UUID with the account you verified:

update public.profiles
set role = 'admin'
where id = 'YOUR_AUTH_USER_UUID';

Never promote an unverified account. Founder and Owner roles should only be assigned by a trusted project owner.

3Automatic ID formats

PostgreSQL generates these using atomic counters and unique constraints. Role changes receive a new role-specific user ID; orders are generated server-side on insertion.

4Cloudflare R2 uploads

Use the included Cloudflare Pages Function functions/api/r2-upload.js with an R2 bucket binding. In Cloudflare Pages Settings, add variables SUPABASE_URL, SUPABASE_ANON_KEY, R2_PUBLIC_BASE_URL and secret SUPABASE_SERVICE_ROLE_KEY. Under Settings → Bindings, bind R2 bucket ekannto-media to variable name R2_BUCKET. No Supabase Edge Function or R2 API secret keys are needed by this binding-based upload flow. The function validates the signed-in account role and limits image uploads to 10 MB.

5User and product management

Open /admin.html to sign in, view database counts, review users and update roles. Role changes are passed through the database function admin_set_user_role, which verifies the caller's role. Product upload is available from the storefront's admin upload flow and writes product metadata to Supabase and image objects to R2.

6Important production checklist

Ekannto · Zero To One, One To Infinity