Aviary
Recipes

Overview

Task-shaped walkthroughs — the common media jobs (avatars, galleries, browser uploads, serving, multi-disk) and the extension points (custom driver, custom store, testing).

The concepts pages explain the model; these are the jobs people actually sit down to do. Each one is self-contained — start from the closest match and adapt.

Common jobs

RecipeWhat it covers
Single-file avatarone file per owner, replacing the previous one, with a cropped variant
Gallery with thumbnailsan ordered collection, reordering, and lazy thumbnails
Resumable uploads from the browsertus and presigned direct-to-S3, and when each is the right one
Serving filespublic URLs, signed URLs, and streaming through your own controller
Multiple disksrouting collections at different backends, and moving files between them

Files that aren't media

A report, a cache file, a file another library reads: use @nestjs/storage directly (Storage, @InjectDisk(), serveFile(), uploadToDisk()). See File storage in the NestJS docs; nestjs-media adds nothing there.

Extending it

RecipeWhat it covers
Writing a custom disksubclass @nestjs/storage's StorageDisk (NestJS docs), then check it with describeMediaDiskConformance from -testing
Writing a custom storethe MediaStore SPI, plus the optional query methods the dashboard needs
Testing your media codeInMemoryDisk, the in-memory stores and the conformance suites

On this page