> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mypopup.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase Integration

> Backend database and authentication setup

## Project Setup

1. Create project at [supabase.com](https://supabase.com)
2. Copy project credentials
3. Add to `.env.local`:

```bash theme={null}
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGci...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGci...
```

## Database Schema

Key tables:

* `stores` - Store information
* `products` - Product catalog
* `orders` - Order data
* `users` - Authentication

## Row-Level Security

All tables use RLS policies for multi-tenant isolation.

## Storage

Buckets:

* `product-images` - Product photos
* `payment-proofs` - UPI screenshots
* `store-logos` - Brand logos

<Card title="Local Setup" href="/local-setup">
  Run Supabase locally for development
</Card>
