feat(storage): add MinIO local storage and @manacore/shared-storage package

- Add MinIO service to docker-compose.dev.yml with auto-bucket initialization
- Create @manacore/shared-storage package with S3-compatible client
- Add factory functions for each project (Picture, Chat, ManaDeck, etc.)
- Include file utilities (generateFileKey, getContentType, validators)
- Update environment variables for S3/MinIO configuration
- Document storage architecture in CLAUDE.md

Local dev uses MinIO, production will use Hetzner Object Storage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Wuesteon 2025-12-02 01:00:42 +01:00
parent eb173217c1
commit 2cfa09c84d
13 changed files with 1195 additions and 130 deletions

View file

@ -28,6 +28,14 @@ REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=devpassword
# MinIO Object Storage (local S3-compatible storage)
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
S3_ENDPOINT=http://localhost:9000
S3_REGION=us-east-1
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
# ============================================
# MANA-CORE-AUTH SERVICE
# ============================================
@ -124,17 +132,9 @@ PICTURE_BACKEND_PORT=3006
PICTURE_BACKEND_URL=http://localhost:3006
PICTURE_DATABASE_URL=postgresql://picture:picturepassword@localhost:5434/picture
# Storage Configuration (local for dev, s3 for production with Hetzner Object Storage)
PICTURE_STORAGE_MODE=local
PICTURE_LOCAL_STORAGE_PATH=./uploads
# S3/Hetzner Object Storage (for production)
# PICTURE_S3_ENDPOINT=fsn1.your-objectstorage.com
# PICTURE_S3_REGION=eu-central-1
# PICTURE_S3_ACCESS_KEY=your-access-key
# PICTURE_S3_SECRET_KEY=your-secret-key
# PICTURE_S3_BUCKET=picture-uploads
# PICTURE_STORAGE_PUBLIC_URL=https://picture-uploads.fsn1.your-objectstorage.com
# Storage Configuration (uses MinIO locally, Hetzner in production)
# Uses shared S3_* variables from above - no project-specific override needed for local dev
PICTURE_STORAGE_PUBLIC_URL=http://localhost:9000/picture-images
# OAuth (optional - leave empty to disable)
PICTURE_GOOGLE_CLIENT_ID=
@ -149,13 +149,8 @@ NUTRIPHI_DATABASE_URL=postgresql://nutriphi:nutriphi_dev_password@localhost:5435
NUTRIPHI_APP_ID=nutriphi
NUTRIPHI_GEMINI_API_KEY=your-gemini-api-key-here
# S3 Storage (Hetzner Object Storage)
NUTRIPHI_S3_ENDPOINT=https://fsn1.your-objectstorage.com
NUTRIPHI_S3_ACCESS_KEY_ID=your-access-key-id
NUTRIPHI_S3_SECRET_ACCESS_KEY=your-secret-access-key
NUTRIPHI_S3_BUCKET_NAME=nutriphi-meals
NUTRIPHI_S3_REGION=fsn1
NUTRIPHI_S3_PUBLIC_URL=https://nutriphi-meals.fsn1.your-objectstorage.com
# S3 Storage (uses MinIO locally via shared S3_* variables, Hetzner in production)
NUTRIPHI_S3_PUBLIC_URL=http://localhost:9000/nutriphi-meals
# ============================================
# ZITARE PROJECT