Skip to main content

Ubiquitous Language

This document names the major Gallery concepts so discussions can start from product and domain language before dropping into component, file, or table names. Prefer these terms in issues, planning, code review, and debugging notes.

Top-down map

TermDefinitionAliases to avoid
Client surfaceA user-facing entry point that talks to Gallery through generated API clients.Frontend, app thing
API boundaryThe server layer that validates requests, exposes DTOs, and generates OpenAPI contracts for clients.Controller code, route plumbing
Domain serviceServer business logic that enforces rules, access, side effects, jobs, and response shaping.Backend component, handler
Persistence layerTyped database access and schema definitions around Postgres.DB stuff, query code
Job pipelineRedis/BullMQ-backed background work for media processing, ML, cleanup, migration, and notifications.Worker magic, queue stuff
Machine learning serviceThe Python service that hosts ONNX models for CLIP, face recognition, OCR, and pet detection.AI server, model box
Storage layerThe disk/S3 abstraction that writes, reads, serves, deletes, and migrates media files.Filesystem code, S3 code
Realtime layerWebsocket and audit/update-id infrastructure that lets clients react to server-side changes.Socket code, sync code
Generated SDKThe OpenAPI-generated client used by web, mobile, CLI, and tests to call the server.API wrapper, SDK stuff

Codebase areas

TermDefinitionAliases to avoid
Web clientThe SvelteKit client for browsing, filtering, editing, sharing, and administering Gallery.Svelte app, web folder
Mobile clientThe Flutter client with local state and generated API access.App, phone app
CLI clientThe Node CLI used mainly for bulk upload and automation.Command tool
Gallery serverThe NestJS application that handles HTTP, jobs, repositories, permissions, and storage coordination.Backend, API server
Microservices workerThe server process mode that consumes background jobs rather than serving normal UI requests.Worker container
Documentation siteThe Docusaurus site that describes user features, operations, and developer architecture.Docs folder
Fork layerGallery-specific behavior layered on top of upstream Immich while preserving rebase compatibility.Custom code, downstream patch

Content core

TermDefinitionAliases to avoid
AssetA photo or video record owned by a user and backed by one or more media files.Photo, item, media item
Media fileA concrete file or object used by an asset, such as original, preview, thumbnail, encoded video, or sidecar.Blob, path, object
Asset metadataSearchable facts about an asset such as dates, camera data, location, description, rating, OCR, and tags.EXIF only, details
Asset visibilityThe asset-level placement state: timeline, archive, hidden, locked, or trash/deleted state.Status, hidden flag
TimelineA date-grouped asset stream loaded in buckets and rendered as the main browsing surface.Grid, photos page, list
Time bucketA monthly/date bucket that counts and loads timeline assets incrementally.Month row, page chunk
StackA group of related assets represented by one primary asset in normal timeline browsing.Group, pile
Live photoA still asset linked to a motion/video asset.Motion photo pair
LibraryA configured source of assets, usually an external filesystem import owned by one user.Folder, source, personal library
Import pathA filesystem path scanned by an external library.Folder path, mount
Exclusion patternA glob-like rule that prevents matching files from entering a library scan.Ignore rule
Personal timelineThe current user's normal timeline, optionally augmented by partners and timeline-enabled spaces.Global timeline, main grid

Collections and sharing

TermDefinitionAliases to avoid
AlbumA named collection that links assets without copying files.Folder, gallery
Album memberA user with viewer or editor access to an album.Shared user
Partner sharingOne-way library sharing from one user to another.Shared library, partner album
Shared linkA public or key-protected access path to selected assets or an album.Public share, link share
Shared SpaceA collaborative virtual library where members browse and contribute assets under role-based access.Space, shared library
Space memberA user who belongs to a Shared Space with an Owner, Editor, or Viewer role.Participant, collaborator
Space roleThe permission tier for a Space member: Owner, Editor, or Viewer.Space permission
Space assetAn asset visible inside a Shared Space, either directly linked or included through a linked library.Space photo
Direct space assetAn asset explicitly linked into a Shared Space through the space-asset join.Added photo
Library-linked space assetAn asset included in a Shared Space because its library is linked to that space.Auto-added photo
Linked libraryA library connected to a Shared Space so all current and future library assets appear there.Connected library
Timeline inclusionA member's per-space choice to merge that space's assets into their personal timeline.Show on timeline toggle
Space coverThe asset and crop position used as the visual cover for a Shared Space.Thumbnail, hero image
Space activityAn auditable event inside a Shared Space, such as asset add/remove, member change, cover change, or person merge.Feed item, log row
ContributionA member's added-asset history inside a Shared Space.Activity count
New since last visitSpace asset count and contributor data calculated from a member's last viewed timestamp.Badge count, recency

People and recognition

TermDefinitionAliases to avoid
FaceA detected region on an asset that may be assigned to a person cluster.Detection, face box
Personal PersonA user-owned person or pet cluster in the personal people catalog.Global Person, owner person
Space PersonA Shared Space-level person or pet cluster made from faces on assets in that space.Shared person, space face
Representative faceThe face used as the display image source for a person cluster.Thumbnail face
Person thumbnailThe rendered thumbnail for a Personal Person or Space Person, normally derived from a representative face.Avatar, headshot
Hidden personA person cluster excluded from normal people lists and filters until explicitly requested.Invisible person
Favorite personA Personal Person pinned ahead of other personal people.Pinned person
Person aliasA member-specific display override for a Space Person.Nickname
Person name overrideThe Space Person name that supersedes the linked Personal Person name inside that Shared Space.Space name, renamed person
Pet personA person-like cluster whose type is pet and whose faces come from pet detection.Pet, animal tag
Face matchingThe process that assigns faces to existing people or creates new people.Recognition, clustering
Space face matchingThe Shared Space process that maps already-assigned personal faces into Space People and bridges across owners.Space recognition
Person dedup passA background pass that merges duplicate person clusters when embeddings indicate the same real-world subject.Merge job

Search and filtering

TermDefinitionAliases to avoid
Search PaletteThe Cmd/Ctrl-K command and destination search surface that searches providers across photos, people, places, tags, albums, spaces, commands, and navigation.Global search, command modal
Page searchURL-backed free-text search scoped to the current searchable page.Search bar, query chip
Smart SearchCLIP-based semantic asset search using image/video embeddings.AI search, natural search
Metadata SearchAsset search by filename, description, OCR, checksum, EXIF, or other non-semantic fields.Basic search
Search providerA source queried by the Search Palette, such as photos, people, places, tags, albums, spaces, commands, or navigation.Section backend
Search scopeA boundary that changes what a query means, such as all results, people, tags, collections, navigation, page, album, map, or space.Context, mode
Filter SurfaceThe reusable left-side filter experience for timeline-like views.FilterPanel, sidebar
Filter stateThe active selected values for timeline, people, location, camera, tags, rating, media type, favorites, and sort.Filter object
Filter sectionOne filter category within the Filter Surface.Panel, accordion
Faceted suggestionsFilter options recalculated from all active filters except the option's own category.Dynamic suggestions
Orphaned selectionA selected filter value that no longer appears in the current suggestion set but remains visible so it can be cleared.Stale option
Active filter chipA removable summary of one active filter or search query.Chip, pill
Timeline filterA date or month/year selection that limits the asset stream and narrows suggestions.Temporal filter
Space-scoped filterA Filter Surface state interpreted against Space assets and Space People.Space filter panel
Global-scoped filterA Filter Surface state interpreted against the personal timeline and Personal People.Global filter panel
Map scopeA spatial browsing boundary where filter results become map markers instead of timeline buckets.Map filter context

Intelligence pipeline

TermDefinitionAliases to avoid
EmbeddingA vector representation of asset content, text, or face identity used for similarity search.Vector, ML blob
Smart Search indexThe persisted asset embedding data used by semantic search and duplicate detection.CLIP table
OCR textText extracted from images and stored for search.Image text
Auto classificationA configurable ML process that compares asset embeddings to prompts and optionally tags or archives matching assets.Auto tagging
Auto tagA tag created or applied by auto classification, usually under an Auto/ hierarchy.Generated tag
Duplicate groupA set of visually similar assets presented for keep/trash resolution.Duplicate set
Duplicate tombstoneA preserved checksum mapping that prevents resolved duplicate files from being uploaded again.Checksum tombstone
MemoryA user-owned generated or saved collection surfaced at a meaningful date.Memory lane item
Rule memoryA memory produced by a named rule such as birthdays or recent trips.Generated memory
On-this-day memoryA memory based on assets from the same day in prior years.Anniversary memory

Storage and operations

TermDefinitionAliases to avoid
Storage backendA target that implements the shared storage interface, currently disk or S3-compatible object storage.File backend
Write backendThe backend chosen for new files.Active storage
Serve strategyThe chosen way to return media to a client: local file, redirect, or stream.Download method
Storage keyA relative object path used to identify S3-backed media.S3 path
Disk pathAn absolute filesystem path used to identify disk-backed media.Local key
Storage migrationA resumable job process that moves stored media between disk and S3 and updates database paths.File migration
Migration batchA group id for one storage migration run, used for rollback.Batch id
System configPersisted server configuration that controls features, ML settings, jobs, storage, and admin behavior.Settings
JobA named unit of background work.Task
QueueA BullMQ work lane that executes related jobs.Worker queue
WorkerA running server process that handles jobs or API traffic depending on mode.Service process
Audit rowA database record emitted by triggers to capture changes for sync or history.Change log
Sync markerA create/update id column used to detect rows that need to re-emit to clients.Version id

Relationships

  • A User owns zero or more Assets, Libraries, Albums, Personal People, Memories, Tags, and Workflows.
  • An Asset belongs to exactly one owning User and may belong to one Library.
  • An Album contains zero or more Assets by reference; adding to an album does not copy files.
  • A Shared Space has one or more Space Members and contains Space Assets by direct links, linked libraries, or both.
  • A Space Member has exactly one Space Role per Shared Space.
  • A Linked Library makes every eligible Asset in that Library visible as a Library-linked space asset.
  • A Personal Person belongs to one User; a Space Person belongs to one Shared Space.
  • A Face belongs to one Asset, may point to one Personal Person, and may be linked into one or more Space People through space-person face links.
  • A Space Person may display its own Person name override, fall back to the linked Personal Person name, and expose a member-specific Person alias.
  • A Filter Surface owns one Filter state; the page scope decides whether selected personIds mean Personal People or Space People.
  • A Search Palette query fans out to multiple Search providers; a Page search query stays inside one Search scope.
  • A Smart Search result depends on the Smart Search index; a Metadata Search result depends on persisted asset fields.
  • A Storage migration creates a Migration batch and many per-file Jobs; rollback changes database paths but does not recreate deleted source files.
  • A Duplicate group resolution may copy metadata, tags, album membership, and editable space membership to kept Assets before trashing the rest.
  • Say "Does this affect Personal People or Space People?" before discussing person IDs.
  • Say "Which Search scope is this in?" before discussing search or filtering bugs.
  • Say "Is this a Direct space asset or Library-linked space asset?" before debugging Shared Space counts or permissions.
  • Say "Is this about Timeline inclusion or Space membership?" before debugging why space assets appear on Photos.
  • Say "Which Storage backend owns this path?" before debugging media serving or deletion.
  • Say "Is this a Page search, Search Palette provider, or Filter Surface issue?" before opening web search code.

Implementation anchors

AreaPrimary anchors
ArchitectureCLAUDE.md, docs/docs/developer/architecture.mdx, docs/docs/developer/directories.md
Assets and timelineserver/src/schema/tables/asset.table.ts, server/src/services/timeline.service.ts, server/src/repositories/asset.repository.ts, web/src/lib/managers/timeline-manager/
Filter Surfaceweb/src/lib/components/filter-panel/filter-panel.ts, web/src/lib/components/filter-panel/filter-panel.svelte, server/src/services/search.service.ts, server/src/repositories/search.repository.ts
Search Paletteweb/src/lib/managers/global-search-manager.svelte.ts, web/src/lib/components/global-search/, docs/docs/features/search-palette.md
Shared Spacesserver/src/services/shared-space.service.ts, server/src/repositories/shared-space.repository.ts, server/src/schema/tables/shared-space*.ts, web/src/routes/(user)/spaces/, web/src/lib/components/spaces/
Peopleserver/src/schema/tables/person.table.ts, server/src/schema/tables/asset-face.table.ts, server/src/schema/tables/shared-space-person*.ts, web/src/routes/(user)/people/, docs/docs/features/facial-recognition.md
ML featuresserver/src/services/smart-info.service.ts, server/src/services/classification.service.ts, server/src/services/pet-detection.service.ts, machine-learning/, docs/docs/features/searching.md
Duplicatesserver/src/services/duplicate.service.ts, server/src/schema/tables/asset-duplicate-checksum.table.ts, docs/docs/features/duplicates-utility.md, docs/docs/features/video-duplicate-detection.md
Storageserver/src/services/storage.service.ts, server/src/repositories/storage.repository.ts, server/src/backends/, docs/docs/features/s3-storage.md, docs/docs/features/storage-migration.md
Permissionsserver/src/middleware/auth.guard.ts, server/src/repositories/access.repository.ts, server/src/enum.ts

Example dialogue

Dev: "The people filter works on Photos but not inside a Shared Space. Are these the same people IDs?"

Domain expert: "No. On Photos the Filter Surface selects Personal People. In a Shared Space, the same UI state is translated into Space People before the timeline query runs."

Dev: "So a Space member clicking Alice in the people strip should filter by the Space Person, not the owner's Personal Person?"

Domain expert: "Correct. The Space Person can fall back to a Personal Person name and thumbnail, but access and filtering stay inside the Shared Space."

Dev: "If the count is wrong, should I inspect Timeline inclusion or the space detail query?"

Domain expert: "Start with the Search scope. Photos with withSharedSpaces uses a member's Timeline inclusion spaces, while a space detail page uses one explicit Shared Space boundary."

Flagged ambiguities

  • "People" is overloaded. Use Personal People for the user-owned people catalog and Space People for Shared Space people.
  • "Global people" appears in tests and comments, but it is not system-global; it usually means Personal People outside a space scope.
  • "Space photos" is too vague. Use Direct space assets for assets explicitly added to a space and Library-linked space assets for assets included through a linked library.
  • "Library" can mean a user-facing external library, a personal photo collection, or a virtual shared collection. Use Library, Personal timeline, Album, or Shared Space depending on the boundary.
  • "Search" is overloaded. Use Search Palette, Page search, Smart Search, Metadata Search, or Faceted suggestions.
  • "Filter" is overloaded. Use Filter Surface for the UI, Filter state for selected values, and Faceted suggestions for dynamic option lists.
  • "Visibility" is overloaded. Asset visibility is timeline/archive/hidden/locked; Hidden person is a people-list flag; Timeline inclusion is a per-member Shared Space setting.
  • "Owner" is context-sensitive. Use asset owner, album owner, library owner, or space owner.
  • "Member" is context-sensitive. Use Space member or Album member.
  • "Favorite" is context-sensitive. An asset can be favorite, and a Personal Person can be favorite; a Space Person uses visibility/name/alias instead.
  • "Thumbnail" is context-sensitive. Use Person thumbnail, Space cover, Album cover, or Asset thumbnail.
  • "Shared" is not a single model. Gallery has Partner sharing, Album members, Shared links, and Shared Spaces, each with different permissions and access paths.