Skip to content

Storage (server-storage)

The Storage service manages file and object storage backed by MinIO (S3-compatible). It provides bucket and file CRUD operations with streaming support.

Running

bash
# Development
npm run dev --workspace=apps/server-storage

# CLI
npm run cli --workspace=apps/server-storage -- start

# Docker
docker run -e ... privateaim/hub storage cli start

Dependencies

  • Database — MySQL, PostgreSQL, or SQLite
  • Authup — OAuth2 identity provider
  • MinIO — S3-compatible object storage (required)
  • RabbitMQ — AMQP message bus

Environment Variables

Service-Specific

VariableDefaultDescription
MINIO_CONNECTION_STRINGhttp://admin:start123@127.0.0.1:9000MinIO connection (required)

Inherited

See Shared Configuration and Database Configuration.

Key Endpoints

MethodEndpointDescription
GET/bucketsList buckets
POST/bucketsCreate bucket
GET/buckets/:idGet bucket
DELETE/buckets/:idDelete bucket
GET/bucket-filesList files
POST/bucket-filesUpload file
GET/bucket-files/:id/streamStream file contents
GET/docsSwagger/OpenAPI documentation

Architecture

  • BucketEntity / BucketFileEntity — TypeORM entities tracking storage metadata
  • MinioModule — creates and registers the S3 client in the DI container
  • BucketComponent — AMQP consumer for asynchronous bucket operations
  • Subscribers — publish domain events on bucket/file changes

Released under the Apache-2.0 License.