Data model and persistence
The server persistence boundary stores Immich's domain state in PostgreSQL and exposes that state through repositories and typed data objects. It keeps asset records, user and sharing data, metadata, search data, and sync history consistent while keeping database details separate from API and client contracts.
Persistence boundary
The persistence boundary starts when a server worker opens a PostgreSQL connection and ends when a repository returns a domain-shaped result or commits a change. Controllers and services use repositories rather than accessing database tables directly, so validation, access rules, relation loading, and change tracking stay close to the data they protect.
Database connection and bootstrap
The application creates one Kysely database interface from the configured PostgreSQL connection. ConfigRepository reads the validated environment data and turns either a database URL or separate connection settings into runtime database options. It also maps the selected vector extension into the database configuration before the database service uses these values. During the AppBootstrap event, the database service checks the PostgreSQL and vector extension versions, takes a database lock for preparation, runs migrations, checks for schema drift, and prepares search indexes. This makes database readiness a condition of normal server operation rather than a later request-time check. server/…/app.module.ts server/…/database.ts server/…/database.service.ts server/…/config.repository.ts server/…/config.repository.ts
References: server/…/app.module.ts• L55-61 server/…/database.ts• L52-80 server/…/database.service.ts• L54-128 server/…/config.repository.ts• L169-253 server/…/config.repository.ts• L306-310
Domain model
The database model represents a photo library as connected records instead of one large asset record. The asset is the center of the model, and related records add file locations, captured metadata, edits, machine-learning results, organization, sharing, and user context.
Asset records
An asset record identifies the owner, media type, original path and name, checksums, capture dates, visibility, library membership, stack membership, and current state. The record points to one or more asset files and can have one EXIF record, key/value metadata, edits, faces, tags, and search data. The database uses foreign keys and unique rules to keep these links valid and to prevent the same owner from storing a duplicate checksum in the same library scope. server/…/asset.table.ts server/…/asset.table.ts
This boundary stores paths and media facts. It does not make the database the media file store. File records describe where original, preview, encoded, or edited data can be found, while the storage layer manages the files at those paths. The asset repository also compares external library paths with stored records and marks missing external assets offline. Asset organization and discovery build on these records through libraries, albums, tags, people, stacks, and search fields; see Asset organization and discovery. server/…/asset-file.table.ts server/…/asset.repository.ts server/…/asset.repository.ts
References: server/…/asset.table.ts• L23-42 server/…/asset.table.ts• L64-147 server/…/asset-file.table.ts• L16-48 server/…/asset.repository.ts• L1016-1071 server/…/asset.repository.ts• L1084-1130
Relationship and change records
Many product features use small related tables rather than fields added to every asset. EXIF data has a one-to-one asset link, files have a unique type and edited-state per asset, and join records connect assets to albums, tags, memories, and stacks. Audit tables record deletes for data that must later reach a client. Database functions and triggers also maintain update timestamps and update IDs, which give the server a common change order. server/…/index.ts server/…/asset-exif.table.ts server/…/functions.ts server/…/functions.ts
References: server/…/index.ts• L99-192 server/…/asset-exif.table.ts• L15-23 server/…/functions.ts• L38-50 server/…/functions.ts• L110-121
Schema and migrations
The schema is defined in code and changed over time by ordered migrations. The code schema describes tables, columns, keys, indexes, enums, functions, and triggers. Migrations move an existing database from one supported version to the next without requiring a new database.
Code schema
ImmichDatabase is the central model of the PostgreSQL schema. It registers the tables, database functions, and required PostgreSQL extensions. The DB type gives repositories a shared view of the available tables, so a query that uses a missing table or an invalid column fails during development instead of becoming an unknown runtime contract. server/…/index.ts server/…/index.ts
References: server/…/index.ts• L99-193 server/…/index.ts• L201-299
Migration lifecycle
At startup, the database repository runs all pending migrations under a migration lock. It records the applied migration names in the migration table and rejects a database that was changed by a newer server version. The same repository compares the code schema with the live database after migration and reports drift, which helps detect changes made outside the supported migration path. server/…/database.repository.ts server/…/database.repository.ts server/…/database.repository.ts
The first migration also handles the older TypeORM migration state. Later migrations add or change product data and its change records, such as the asset edit sync records. This preserves the data model while the server evolves. server/…/1744910873969-InitialMigration.ts server/…/1771873813973-AssetEditSync.ts
References: server/…/database.repository.ts• L270-295 server/…/database.repository.ts• L383-416 server/…/database.repository.ts• L501-515 server/…/1744910873969-InitialMigration.ts• L11-32 server/…/1771873813973-AssetEditSync.ts• L3-39
Repository and query boundary
Repositories are the server's data access boundary. Each repository owns the reads and writes for a domain area, uses the shared typed database interface, and returns only the data needed by its callers. This keeps SQL rules such as ownership filters, relation joins, upserts, and delete behavior in one place. The repository list is registered as one server data-access surface, including domain records, access checks, configuration, storage, and search. server/…/index.ts server/…/index.ts
Repository responsibilities
The asset repository shows the main pattern. It creates and updates assets, upserts metadata and extracted media facts, loads optional relations, finds assets by stable identity such as checksum or path, and builds filtered timeline and search results. Callers choose the relations they need, so a small operation does not have to load the full asset graph. server/…/asset.repository.ts server/…/asset.repository.ts server/…/asset.repository.ts
Album data uses a parent record with membership and asset-link records. AlbumRepository reads an album with its users and shared links, filters album lists by the current user's membership and role, and keeps asset membership idempotent when records are added in batches. It also derives album counts and keeps the chosen thumbnail tied to a live album asset. server/…/album.repository.ts server/…/album.repository.ts server/…/album.repository.ts server/…/album.repository.ts
Job repositories provide focused read views for background work. AssetJobRepository selects only the asset files, media facts, faces, edits, search data, or job state needed by a task such as thumbnail creation, metadata extraction, duplicate search, OCR, or video conversion. The job layer therefore reads durable asset state without taking ownership of the asset write model. server/…/asset-job.repository.ts server/…/asset-job.repository.ts server/…/asset-job.repository.ts
Other repositories keep related product data close to its rules. Activity and partner repositories load user context with comments, likes, and sharing links. Person and person-user repositories keep face groups, person views, and person sharing aligned. Person listing queries first aggregate visible face counts for the user's owned groups and then join those counts to person groups, which keeps filtering and ordering scoped to relevant data. Shared-link reads combine link access with direct assets or an active album and return the related owner and EXIF data needed by the share. Tag repository operations maintain both tag relationships and their hierarchy. OCR repository operations replace recognized text and its search text together. Memory repository operations keep memory rows and their asset links together, filter assets by owner and visible timeline state, and remove expired unsaved memories. server/…/activity.repository.ts server/…/partner.repository.ts server/…/person.repository.ts server/…/person.repository.ts server/…/person-user.repository.ts server/…/shared-link.repository.ts server/…/shared-link.repository.ts server/…/tag.repository.ts server/…/ocr.repository.ts server/…/memory.repository.ts server/…/memory.repository.ts
Repositories use shared database helpers for common joins and filters. These helpers assemble EXIF, files, faces, tags, owners, libraries, stacks, and access-aware asset searches into one result. Search also supports structured filters, text fields, and vector similarity for assets and faces. Generated SQL files provide a readable record of repository query shapes. The repository code remains the source of query behavior. server/…/database.ts server/…/database.ts server/…/search.repository.ts server/…/search.repository.ts server/…/access.repository.sql server/…/album.repository.sql server/…/shared.link.repository.sql server/…/person.repository.sql
References: server/…/index.ts• L1-15 server/…/index.ts• L58-115 server/…/asset.repository.ts• L126-144 server/…/asset.repository.ts• L447-457 server/…/asset.repository.ts• L572-623 server/…/album.repository.ts• L21-48 server/…/album.repository.ts• L54-186 server/…/album.repository.ts• L238-347 server/…/album.repository.ts• L358-399 server/…/asset-job.repository.ts• L25-49 server/…/asset-job.repository.ts• L63-104 server/…/asset-job.repository.ts• L365-378 server/…/activity.repository.ts• L23-61 server/…/partner.repository.ts• L31-68 server/…/person.repository.ts• L440-540 server/…/person.repository.ts• L729-767 server/…/person-user.repository.ts• L18-83 server/…/shared-link.repository.ts• L29-66 server/…/shared-link.repository.ts• L72-183 server/…/tag.repository.ts• L48-57 server/…/ocr.repository.ts• L59-75 server/…/memory.repository.ts• L29-42 server/…/memory.repository.ts• L190-203 server/…/database.ts• L114-131 server/…/database.ts• L213-353 server/…/search.repository.ts• L228-336 server/…/search.repository.ts• L542-585 server/…/access.repository.sql• L1-366 server/…/album.repository.sql• L1-408 server/…/shared.link.repository.sql• L1-334 server/…/person.repository.sql• L149-313
Workflow records
WorkflowRepository persists saved workflows and their ordered plugin steps as one domain view. A workflow stores its trigger, enabled state, logging choice, and description, while its steps point to plugin methods and keep their order and configuration. Reads join the workflow with its steps and plugin names so callers receive a usable workflow definition rather than separate database rows. server/…/workflow.repository.ts
Workflow creation and updates keep the parent workflow and its step set together in one transaction. Replacing a step set removes the old steps before it stores the new ordered set. Workflow logs remain separate from the definition and support result and time filters; disabling logging also clears the stored logs for that workflow. server/…/workflow.repository.ts server/…/workflow.repository.ts server/…/workflow.repository.ts
References: server/…/workflow.repository.ts• L20-49 server/…/workflow.repository.ts• L96-113 server/…/workflow.repository.ts• L115-145 server/…/workflow.repository.ts• L152-172
MediaRepository is a separate media-processing boundary rather than a database repository. It turns image and video files into decoded images, thumbnails, metadata, video stream and packet information, and transcoded outputs. It can also extract or write embedded image tags. StorageRepository owns file-system access, file discovery, batched walks, and file watching, while MetadataRepository reads and writes embedded file tags and normalizes the values that media flows can persist. Asset and media-processing flows then keep the resulting file paths and media facts in the persistence boundary; see Asset lifecycle and media processing. server/…/media.repository.ts server/…/media.repository.ts server/…/media.repository.ts server/…/media.repository.ts server/…/media.repository.ts server/…/media.repository.ts server/…/storage.repository.ts server/…/storage.repository.ts server/…/metadata.repository.ts server/…/metadata.repository.ts server/…/storage.repository.spec.ts
References: server/…/media.repository.ts• L60-73 server/…/media.repository.ts• L80-151 server/…/media.repository.ts• L153-191 server/…/media.repository.ts• L242-303 server/…/media.repository.ts• L306-395 server/…/media.repository.ts• L397-433 server/…/storage.repository.ts• L52-59 server/…/storage.repository.ts• L227-309 server/…/metadata.repository.ts• L26-49 server/…/metadata.repository.ts• L87-151 server/…/storage.repository.spec.ts• L223-333
Scoped access checks
Access checks are a repository boundary for authorization-sensitive data operations. AccessRepository groups checks by domain area and accepts sets of candidate IDs, then returns only the IDs that the caller may use. This lets services apply one access result to a batch without exposing unrelated rows. server/…/access.repository.ts
Album access distinguishes ownership from shared editor or viewer access and ignores deleted albums. Asset access covers ownership, partner visibility, album membership, and shared links. A shared link can grant access to directly linked assets or to assets in its album. The checks also account for the video side of a live photo so a request for either linked asset receives the same access result. Person access uses ownership or the allowed person-sharing roles. server/…/access.repository.ts server/…/access.repository.ts server/…/access.repository.ts
References: server/…/access.repository.ts• L73-140 server/…/access.repository.ts• L143-290 server/…/access.repository.ts• L531-599 server/…/access.repository.sql• L39-175 server/…/access.repository.sql• L268-313
Query results
The persistence layer has two related result shapes. Database types describe rows and joined records for repository work, while response types describe the safe shape sent to API clients. A result can combine stored columns with nested EXIF, files, tags, people, or stack data, but the caller still receives one domain object rather than raw join rows. server/…/database.ts server/…/database.ts server/…/asset-response.dto.ts
Map queries follow the same boundary for location data. MapRepository keeps imported place and country data in database tables, then joins asset EXIF coordinates to return markers or resolves a coordinate to a city and country. The map data is refreshed when the packaged geodata version changes. server/…/map.repository.ts server/…/map.repository.ts
References: server/…/database.ts• L36-55 server/…/database.ts• L109-163 server/…/asset-response.dto.ts• L121-157 server/…/map.repository.ts• L58-85 server/…/map.repository.ts• L132-210
DTO boundary
A DTO, or data transfer object, is the typed shape used at an external server boundary. The server uses DTO schemas to validate incoming values and to describe outgoing values, while repositories use database types that can contain storage-only fields and database-native values.
Input and output contracts
Asset input DTOs define which changes a caller may request and enforce rules such as valid IDs, rating values, paired coordinates, and metadata object shapes. Asset response DTOs map database values into API values, including dates, encoded checksums, nested relations, and product terms such as favorite, trashed, offline, and edited state. This prevents a database column change from silently becoming an API change.
Person DTOs apply the same boundary to face and sharing data. They validate person changes, require a real update field when a person is changed, and describe role-based person sharing. Their response mappers turn stored dates, person-group IDs, optional relations, and face bounds into client-safe values. Integrity DTOs expose a separate report contract for checksum failures, missing files, and untracked files, with cursor-based report pages. server/…/asset.dto.ts server/…/asset.dto.ts server/…/asset-response.dto.ts server/…/asset-response.dto.ts server/…/person.dto.ts server/…/person.dto.ts server/…/person.dto.ts server/…/integrity.dto.ts
Configuration DTOs expose one validated system configuration through separate admin, logged-in user, and public views. Visibility metadata controls which settings appear in each view, while shared schemas validate values such as URLs, schedules, booleans, and media settings. Mapping prevents private settings from crossing a lower-trust API boundary while keeping the configuration shape consistent. server/…/config.dto.ts server/…/config.dto.ts server/…/config.dto.ts server/…/config.dto.spec.ts
The server version DTO also carries a feature level. This is a server capability number that can change independently of the release version, so clients can compare supported behavior without treating every release-number change as a new feature contract. server/…/server.dto.ts server/…/server.dto.ts
Sync DTOs define versioned records for the durable changes that clients consume. The contract covers domain upserts, delete records, relation changes, acknowledgements, reset signals, and completion signals. The entity map binds each sync type to one response shape, so a stored row can change without making every client interpret raw database fields. server/…/sync.dto.ts server/…/sync.dto.ts server/…/sync.dto.ts server/…/sync.dto.ts
References: server/…/asset.dto.ts• L9-54 server/…/asset.dto.ts• L102-152 server/…/asset-response.dto.ts• L25-49 server/…/asset-response.dto.ts• L61-117 server/…/person.dto.ts• L17-85 server/…/person.dto.ts• L96-138 server/…/person.dto.ts• L291-365 server/…/integrity.dto.ts• L5-41 server/…/server.dto.ts• L61-78 server/…/server.dto.ts• L184-206 server/…/sync.dto.ts• L20-129 server/…/sync.dto.ts• L131-205 server/…/sync.dto.ts• L477-535 server/…/sync.dto.ts• L537-566
Read and write flows
Persistence turns a validated request into a scoped database action and turns the selected rows back into a stable server contract. The repository owns the database part of this flow, while DTO validation and response mapping protect the edges.
Persistence flow
The diagram shows the normal path from an API request to stored domain state and back to a response.
flowchart LR
A[API request] --> B[Input DTO validation]
B --> C[Service or controller]
C --> D[Domain repository]
D --> E[Kysely query]
E --> F[(PostgreSQL)]
F --> D
D --> G[Domain result]
G --> H[Output DTO mapping]
H --> I[API response]
Writes can span the main record and its related records. For example, asset ingestion creates the asset identity, then records file locations and extracted metadata. Updates use targeted changes or upserts, and reads request only the relations needed by the feature. server/…/asset.repository.ts server/…/asset.repository.ts server/…/asset.repository.ts
Album and shared-link writes follow the same parent-and-links rule. Album creation stores the album, its user roles, and its asset links as one returned domain view. Shared-link creation stores the link and optional direct asset links, while reads rebuild the link with live assets and its active album context. server/…/album.repository.ts server/…/shared-link.repository.ts server/…/shared-link.repository.ts
Memory writes show the same rule for a parent and its links. A memory and its asset links are created in one database transaction, while later reads return only live timeline assets that the owner may see. Person updates use owner and person-group identity, and grouped changes move related person and face records together when the group identity changes. server/…/memory.repository.ts server/…/memory.repository.ts server/…/person.repository.ts server/…/person.repository.ts
References: server/…/asset.repository.ts• L189-309 server/…/asset.repository.ts• L389-416 server/…/asset.repository.ts• L1016-1053 server/…/album.repository.ts• L274-320 server/…/shared-link.repository.ts• L146-160 server/…/shared-link.repository.ts• L200-227 server/…/memory.repository.ts• L190-203 server/…/memory.repository.ts• L255-273 server/…/person.repository.ts• L264-284 server/…/person.repository.ts• L797-887
Sync persistence
Sync uses the same domain tables but adds a durable change boundary for clients. Each sync entity exposes ordered updates, delete records, or both, and each client session stores the last acknowledged position for each entity type. See Sync and client state for the client-facing sync flow.
Change cursors and deletes
An update ID is a database-generated cursor value maintained with update timestamps. The sync repository reads live rows before a fixed point and after the client's acknowledged update ID, then streams them in order. Delete audit tables use their own ordered audit-row IDs to preserve the identity of removed records after the main row is gone. This lets the client apply updates and deletes without reading the whole domain table. server/…/functions.ts server/…/sync.repository.ts server/…/sync.repository.ts server/…/sync.repository.ts
The sync repository applies the same contract to assets, metadata, EXIF, edits, faces, albums, memories, people, stacks, users, and their relationships. It filters each stream by the current user's ownership or sharing scope before it returns a row. The DTO layer then assigns each stream a versioned upsert or delete shape. server/…/sync.repository.ts server/…/sync.repository.ts server/…/sync.repository.ts server/…/sync.dto.ts
References: server/…/functions.ts• L38-50 server/…/sync.repository.ts• L101-145 server/…/sync.repository.ts• L390-455 server/…/sync.repository.ts• L551-623 server/…/sync.repository.ts• L148-198 server/…/sync.repository.ts• L390-548 server/…/sync.repository.ts• L723-812 server/…/sync.dto.ts• L477-535
Session checkpoints
A sync checkpoint stores a session ID, sync entity type, and last acknowledged value. The checkpoint repository upserts these values and can clear them for a full reset, so the server can resume a session without making the client download all data after every connection loss. server/…/sync-checkpoint.table.ts server/…/sync-checkpoint.repository.ts server/…/sync.dto.ts
References: server/…/sync-checkpoint.table.ts• L15-34 server/…/sync-checkpoint.repository.ts• L10-49 server/…/sync.dto.ts• L537-566
Change checklist
When these files or sections are changed, remember to consider these:
- A table, column, key, enum, function, or trigger change needs a matching code-schema update in server/…/index.ts, a migration, and any repository selections or writes that use the changed contract.
- A change to
updateId, update triggers, delete triggers, or audit rows must remain compatible with the live-row and audit-row queries in server/…/sync.repository.ts and the checkpoint rules in server/…/sync-checkpoint.repository.ts. - A change to an asset relation must be checked against repository relation options, shared query helpers, response mapping, and Asset organization and discovery.
- A DTO field or type change must stay aligned across validation schemas, response mapping, generated API descriptions, and the versioned sync entity map that exposes the same data to clients. A server version or feature-level change must also stay aligned with the version service and client compatibility checks.
- A configuration visibility or validation change must stay aligned across the shared system schema, admin, user, and public mappings, and the public configuration contract; a setting marked too broadly can expose private server data.
- A PostgreSQL or vector extension change must stay aligned across startup version checks, migration requirements, and index preparation in
DatabaseRepository. - An access rule change must stay aligned between
AccessRepository, the generated access query, the repository query that reads or writes the record, and the share or role data that grants access. - A change to album membership or shared-link membership must preserve the matching nested album, asset, owner, and EXIF result shapes used by album and share reads.
- A change to OCR visibility, tag hierarchy, or person sharing must preserve the related search text, closure rows, or
person_userlinks that make the feature readable to other users. - A memory or person-group change must preserve the parent-to-link transaction and the owner or group identity used by reads, writes, and sync streams.
- A workflow definition change must stay aligned across the workflow, ordered step, plugin-method, workflow-log, and workflow DTO contracts. Replacing steps or disabling logs must keep the intended transaction and log-retention behavior.
- A geodata import or database resource-path change must stay aligned with the packaged geodata version and the map queries that use the imported tables.
- A file metadata or storage change must keep the file-system path contract aligned with the asset-file records; a database row does not create or repair the file it names. Storage and system operations describes the adjacent file-system boundary.
- A change to integrity report types or cursor fields must stay aligned between the report producer, DTO validation, and the client page contract.
- A change to image or video processing output must stay aligned with the asset-file paths and media facts that persistence stores. Media tool failures must remain visible to the caller rather than creating incomplete records.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| PostgreSQL or the required vector extension is missing or outside its supported range | Bootstrap stops before normal workers start | DatabaseService checks versions and extension availability under the database lock |
| A migration fails or a database contains a migration newer than the server | Startup fails and the server does not run against an unknown schema | DatabaseRepository.runMigrations() reports migration errors and rejects missing newer migrations |
| The live database drifts from the code schema | Queries or later migrations can meet unexpected tables, constraints, or functions | Startup compares the code schema with the live schema and reports drift |
| An access query omits an owner, role, share, album state, or visibility condition | A caller can receive data outside its allowed scope or lose data it should see | AccessRepository and domain repositories apply relationship and visibility filters before returning IDs or rows |
| A shared-link query ignores a deleted album or deleted asset | A share can expose stale content or return a link that no longer has usable content | Link reads require an active album where applicable and exclude deleted assets; generated SQL records these filters |
| An album or shared-link write stores a parent without its membership links | Album lists, shared views, or asset membership reads become incomplete | Album and shared-link repositories create or add relation rows with the parent result and use idempotent link inserts where needed |
| An asset repeats an owner-scoped checksum in the same library scope | The asset write violates the uniqueness rule and the new asset is not stored | Asset indexes enforce checksum uniqueness; callers can query by checksum before creating an asset |
| An external asset path is absent or excluded during a library scan | The database can mark the asset offline and hide it from normal reads even though its record remains | Storage crawl and watch rules define supported paths, while the asset repository applies the external-path check |
| OCR visibility, tag closure, or person-sharing rows are changed without their related rows | Search, hierarchy, or shared person views become stale or incomplete | OCR updates its search text with its rows; tag and person repositories update related records through shared operations |
| A workflow update leaves its parent and ordered steps out of sync | A saved workflow can run with missing or stale steps | WorkflowRepository replaces steps inside the same transaction as the workflow update |
| Workflow logging is disabled without clearing or isolating old log data | Workflow history can remain visible after the owner turns logging off | Workflow updates remove that workflow's logs when logging changes to false |
| A memory link is written without a valid memory or asset state | A memory can show missing or hidden assets, or a link write can fail part-way through a create flow | Memory reads filter live timeline assets, and create uses one transaction for the memory and its links |
| Map resource files are missing or have a new version that is not imported | Map markers or reverse geocoding fail or return no place data | MapRepository.init() checks the resource files and refreshes imported tables by geodata version |
| A sync cursor or delete audit record is not available for a client | The client can miss an update or keep a deleted record | Update IDs, audit tables, ordered sync queries, versioned DTOs, and per-session checkpoints form one change contract |
| A configuration field has the wrong visibility or accepts a value outside its contract | A client can receive private settings or a server can persist invalid runtime configuration | Shared configuration schemas derive admin, user, and public views, and visibility tests check the exposed paths |
| An image or video cannot be decoded, probed, or transcoded | A preview, media fact, or derived file is unavailable and a related asset flow may not complete | MediaRepository reports media-tool errors and returns failure to the calling flow instead of treating an invalid output as valid |
Key files
| File | Why to read it |
|---|---|
| server/…/app.module.ts | Shows where the shared PostgreSQL interface enters the server module graph. |
| server/…/config.repository.ts | Shows how validated environment data becomes database connection and vector-extension settings. |
| server/…/database.ts | Defines the PostgreSQL connection setup and the shared query helpers used to load domain relations. |
| server/…/index.ts | Gives the broad code-level model of tables, functions, enums, and extensions. |
| server/…/asset.table.ts | Describes the central asset record and its key identity, ownership, state, and file relationships. |
| server/…/asset-exif.table.ts and server/…/asset-file.table.ts | Show how captured metadata and stored file locations extend an asset without widening the core record. |
| server/…/database.service.ts | Shows the database readiness sequence at application bootstrap. |
| server/…/database.repository.ts | Shows migration, schema drift, extension, and database lock responsibilities. |
| server/…/index.ts | Shows the repository surface registered with the server. |
| server/…/asset.repository.ts | Shows the main read and write boundary for asset data and related records. |
| server/…/asset-job.repository.ts | Shows the focused asset views used by background media and metadata jobs. |
| server/…/access.repository.ts | Shows how ownership, sharing, roles, visibility, album membership, and shared-link membership become batch access decisions. |
| server/…/access.repository.sql | Shows the generated access query shapes for owner, role, partner, album, and shared-link checks. |
| server/…/album.repository.ts and server/…/album.repository.sql | Show how album users, asset links, shared links, summaries, and thumbnails form one album view. |
| server/…/shared-link.repository.ts and server/…/shared.link.repository.sql | Show how direct assets, album context, owners, and EXIF data form a usable shared-link view. |
| server/…/memory.repository.ts | Shows how memories and asset links are stored, filtered, and cleaned up. |
| server/…/person.repository.ts and server/…/person-user.repository.ts | Show how people, faces, person groups, and person sharing are read and changed together. |
| server/…/person.repository.sql | Shows the generated people queries, including scoped face counts and sharing joins. |
| server/…/workflow.repository.ts | Shows how saved workflows, ordered plugin steps, and workflow logs share one persistence boundary. |
| server/…/search.repository.ts | Shows how structured asset search and vector search use persistent metadata and embeddings. |
| server/…/tag.repository.ts and server/…/ocr.repository.ts | Show how hierarchical tags and OCR data keep their related search records in step. |
| server/…/map.repository.ts | Shows how packaged geodata becomes persistent place data used by map and reverse-geocoding queries. |
| server/…/media.repository.ts, server/…/storage.repository.ts, and server/…/metadata.repository.ts | Show the media-processing, file, and embedded-metadata boundaries that feed persistent asset data. |
| server/…/storage.repository.spec.ts | Shows the file discovery and watch contracts that protect the path side of persistence. |
| server/…/asset.dto.ts and server/…/asset-response.dto.ts | Show the separation between validated request data and mapped API responses. |
| server/…/person.dto.ts and server/…/integrity.dto.ts | Show typed contracts for person data, sharing, face data, and integrity reports. |
| server/…/config.dto.ts and server/…/config.dto.spec.ts | Show how one system configuration becomes validated admin, user, and public contracts without exposing private settings. |
| server/…/server.dto.ts | Defines the server version and feature-level response contract used for capability checks. |
| server/…/sync.dto.ts | Defines the versioned upsert, delete, acknowledgement, reset, and completion contracts for clients. |
| server/…/sync.repository.ts and server/…/sync-checkpoint.repository.ts | Show how stored changes and session acknowledgements become resumable client sync. |
server/src/schema/migrations/ | Shows how the supported database schema changes over time. |