Add MinIO storage + replace Supabase Storage with S3 SDK
- New: src/lib/storage.ts — S3-compatible client, uploadFile/deleteFile/listFiles/publicUrl helpers, bucket constants - New: docker-compose adds minio + minio_init services - Replaced Supabase fetch PUTs in: - src/actions/brand-settings.ts (3 uploaders) - src/actions/products/upload-image.ts - src/actions/communications/import-contacts.ts - src/app/api/water-photo-upload/route.ts - Replaced hardcoded Supabase URLs in: - src/components/storefront/TuxedoVideoHero.tsx - src/components/time-tracking/TimeTrackingFieldClient.tsx - src/app/tuxedo/about/page.tsx - src/lib/email-service.ts (4 occurrences) - Added @aws-sdk/client-s3 + @aws-sdk/s3-request-presigner - .env.example adds MinIO + storage vars - Migration cleanup: deleted BUNDLE_018_042, 4 XXX drafts, 087/145/099-contact storage migrations - Migration patches: 006 STATIC→STABLE, 135 param reordering - Preflight: added pgcrypto extension, removed storage stub - Verified: MinIO upload/list/delete round-trip works against local instance
This commit is contained in:
+25
-6
@@ -1,14 +1,33 @@
|
||||
# --- Self-hosted Postgres (Docker) ---
|
||||
POSTGRES_USER=routecommerce
|
||||
POSTGRES_PASSWORD=change-me-strong-password
|
||||
POSTGRES_PASSWORD=lay7yqM3fHNvwpfjb4tvz7M3kimopyrSHQF24vsuGUM
|
||||
POSTGRES_DB=route_commerce
|
||||
# Used by the app and push-migrations.js to talk to the local DB
|
||||
DATABASE_URL=postgresql://routecommerce:change-me-strong-password@127.0.0.1:5432/route_commerce?schema=public
|
||||
DATABASE_URL=postgresql://routecommerce:lay7yqM3fHNvwpfjb4tvz7M3kimopyrSHQF24vsuGUM@127.0.0.1:5432/route_commerce?schema=public
|
||||
|
||||
# --- Supabase (legacy, can be removed once app is rewired) ---
|
||||
NEXT_PUBLIC_SUPABASE_URL=
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY=
|
||||
SUPABASE_SERVICE_ROLE_KEY=
|
||||
# --- PostgREST (REST API — replaces Supabase REST) ---
|
||||
# Server actions call `${NEXT_PUBLIC_SUPABASE_URL}/rest/v1/rpc/...`
|
||||
# Point that URL at the local PostgREST container. Anon key can be anything
|
||||
# non-empty since we handle auth at the app layer (Better Auth + dev_session).
|
||||
NEXT_PUBLIC_SUPABASE_URL=http://localhost:3001
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY=local-postgrest-anon-key
|
||||
SUPABASE_SERVICE_ROLE_KEY=local-postgrest-service-key
|
||||
|
||||
# --- MinIO (S3-compatible object storage — replaces Supabase Storage) ---
|
||||
MINIO_ROOT_USER=routecommerce
|
||||
MINIO_ROOT_PASSWORD=miniochangeme123
|
||||
STORAGE_ENDPOINT=http://localhost:9000
|
||||
STORAGE_REGION=us-east-1
|
||||
STORAGE_ACCESS_KEY=routecommerce
|
||||
STORAGE_SECRET_KEY=miniochangeme123
|
||||
STORAGE_BUCKET_PREFIX=
|
||||
# Public base URL for image rendering in <img src=...>
|
||||
NEXT_PUBLIC_STORAGE_BASE_URL=http://localhost:9000
|
||||
|
||||
# --- Better Auth ---
|
||||
BETTER_AUTH_SECRET=change-me-32-char-random-string-here-pls-32chars
|
||||
BETTER_AUTH_URL=http://localhost:3000
|
||||
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
|
||||
|
||||
# --- App secrets ---
|
||||
MINIMAX_API_KEY=
|
||||
|
||||
Reference in New Issue
Block a user