πŸ—οΈ Architecture

File Storage

File storage architecture supporting multiple providers for screenshots, documents, and assets.

Storage Providers

ProviderEnum ValueUse Case
LocalLOCALDevelopment, self-hosted
AWS S3S3Production cloud storage
WasabiWASABIS3-compatible, cost-effective
CloudinaryCLOUDINARYImage optimization & CDN
DigitalOcean SpacesDIGITALOCEANS3-compatible

Configuration

# Storage provider selection
FILE_PROVIDER=LOCAL                  # LOCAL | S3 | WASABI | CLOUDINARY | DIGITALOCEAN

# Local storage
FILE_LOCAL_PATH=./apps/api/assets

# AWS S3
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=us-east-1
AWS_S3_BUCKET=gauzy-files
S3_FORCE_PATH_STYLE=false

# Wasabi (S3-compatible)
WASABI_ACCESS_KEY_ID=your-key
WASABI_SECRET_ACCESS_KEY=your-secret
WASABI_REGION=us-east-1
WASABI_SERVICE_URL=https://s3.wasabisys.com
WASABI_S3_BUCKET=gauzy-files

# Cloudinary
CLOUDINARY_CLOUD_NAME=your-cloud
CLOUDINARY_API_KEY=your-key
CLOUDINARY_API_SECRET=your-secret

# DigitalOcean Spaces
DIGITALOCEAN_ACCESS_KEY_ID=your-key
DIGITALOCEAN_SECRET_ACCESS_KEY=your-secret
DIGITALOCEAN_REGION=nyc3
DIGITALOCEAN_S3_BUCKET=gauzy-files
DIGITALOCEAN_SERVICE_URL=https://nyc3.digitaloceanspaces.com

Architecture

Upload Request
  β”‚
  β”œβ”€β”€ FileStorageFactory
  β”‚     β”œβ”€β”€ Selects provider based on FILE_PROVIDER
  β”‚     └── Returns provider-specific storage instance
  β”‚
  β”œβ”€β”€ Provider Instance
  β”‚     β”œβ”€β”€ upload(file) β†’ URL
  β”‚     β”œβ”€β”€ download(key) β†’ Buffer
  β”‚     β”œβ”€β”€ delete(key) β†’ void
  β”‚     └── getSignedUrl(key) β†’ URL
  β”‚
  └── Response with file URL

Stored File Types

TypeUsageTypical Size
ScreenshotsTime tracking proof50-500 KB
Profile imagesEmployee avatars10-200 KB
DocumentsResumes, contracts100 KB - 10 MB
Invoice PDFsGenerated invoices50-500 KB
ExportsData export files1-100 MB

Edit this page

Copyright Β© 2023-Present Ever Co. LTD.Docs by Sourcey