Image Storage Backend
Component Detail
Infrastructure
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Supabase Storage bucket configuration and access-policy layer for receipt images. Enforces row-level security so that only the owning user and their organisation's coordinators can read receipt objects. Provides signed URLs for secure image retrieval and defines lifecycle or size policies for cost management.
image-storage-backend
Responsibilities
- Configure Supabase Storage bucket with appropriate RLS bucket policies
- Provide authenticated upload URLs for client-side direct upload
- Generate signed read URLs restricted to owning user and coordinator roles
- Enforce maximum file size and accepted MIME type constraints
Interfaces
getUploadUrl(userId, expenseItemId)
getSignedReadUrl(storagePath, expirySeconds)
deleteObject(storagePath)
listObjectsForUser(userId)
applyBucketPolicy(policy)
validateFileConstraints(file)