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

# Storage

> Supabase Storage buckets used by Grouple

## Storage Buckets

Grouple uses 3 Supabase Storage buckets:

### `venue-images` (Public)

Stores venue photos uploaded by merchants during onboarding and venue editing.

* **Access:** Public read, authenticated write
* **Size limit:** 512KB per file
* **Used by:** Merchant onboarding, venue edit pages
* **RLS:** Authenticated users can upload to their own UID folder; public can view

### `Logos` (Public)

Stores merchant/venue logos.

* **Access:** Public read, authenticated write
* **Size limit:** No limit
* **Used by:** Merchant onboarding, profile settings
* **RLS:** Public can view; authenticated users can upload to their own UID folder

### `venue-brochures` (Private)

Stores venue PDFs and menu documents for AI extraction.

* **Access:** Private (merchant-only read/write)
* **Size limit:** No limit
* **Used by:** PDF Extract Worker (OCR), `mistral-ocr` Edge Function, `venue_knowledge` table
* **RLS:** Merchants can only access files in their own venue folder

## Upload Flows

### Venue Images

```
Merchant adds/edits venue
        ↓
Frontend uploads image to venue-images/{uid}/{filename}
        ↓
Returns public URL → stored in venues.venue_image_url
```

### Venue Brochures / Menu PDFs

```
Merchant uploads PDF menu
        ↓
Frontend uploads to venue-brochures/{venue_id}/{filename}
        ↓
DB Trigger: tr_check_menu_pdf_limit (checks plan limit)
        ↓
venue_knowledge record created with file_path
        ↓
PDF Extract Worker (EC2) or mistral-ocr Edge Function processes it
        ↓
Extracted JSON data saved to venue_knowledge.extracted_data
        ↓
Used by AI Proposal Worker for generating proposals
```
