Skip to content

svc-media-gallery

NovaTrek Media Gallery Service  |  Support  |  v1.0.2  |  NovaTrek Digital Experience Team

Manages trip photos, videos, and media content captured during NovaTrek adventures.

Swagger UI Download OpenAPI Spec


Integration Context

svc-media-gallery C4 context diagram

Data Store

Overview

Property Detail
Engine PostgreSQL 15 + S3-Compatible Object Store
Schema media
Tables media_items, share_links, albums
Estimated Volume ~500 uploads/day peak season
Connection Pool min 3 / max 15 / idle timeout 10min
Backup Strategy Daily pg_dump, S3 cross-region replication

Key Features

  • S3-compatible storage for photos and videos
  • Presigned URLs for secure direct upload and download
  • Automatic thumbnail generation on upload

Table Reference

media_items

Metadata for uploaded photos and videos (binary stored in S3)

Column Type Constraints
media_id UUID PK
guest_id UUID NOT NULL
trip_id UUID NULL
media_type VARCHAR(20) NOT NULL (photo/video)
s3_key VARCHAR(512) NOT NULL
thumbnail_key VARCHAR(512) NULL
file_size_bytes BIGINT NOT NULL
width INTEGER NULL
height INTEGER NULL
gps_lat DECIMAL(9,6) NULL
gps_lng DECIMAL(9,6) NULL
uploaded_at TIMESTAMPTZ NOT NULL

Indexes:

  • idx_media_guest on guest_id, uploaded_at DESC
  • idx_media_trip on trip_id

Shareable links for media items with expiry

Column Type Constraints
link_id UUID PK
media_id UUID NOT NULL, FK -> media_items
token VARCHAR(128) NOT NULL, UNIQUE
expires_at TIMESTAMPTZ NOT NULL
created_at TIMESTAMPTZ NOT NULL

Indexes:

  • idx_share_token on token (UNIQUE)
  • idx_share_expiry on expires_at

albums

Guest-created photo albums grouping media items

Column Type Constraints
album_id UUID PK
guest_id UUID NOT NULL
name VARCHAR(200) NOT NULL
cover_media_id UUID NULL, FK -> media_items
created_at TIMESTAMPTZ NOT NULL

Indexes:

  • idx_album_guest on guest_id

Endpoints (5 total)


GET /media -- List media by reservation or trip

View in Swagger UI

GET /media sequence diagram

POST /media -- Upload a media item

Uploads a new photo, video, or panorama. The media is associated with a

View in Swagger UI

POST /media sequence diagram

GET /media/{media_id} -- Get media item details

View in Swagger UI

GET /media/{media_id} sequence diagram

DELETE /media/{media_id} -- Delete a media item

Soft-deletes the media item. Underlying storage is purged after 30 days.

View in Swagger UI

DELETE /media/{media_id} sequence diagram

POST /media/{media_id}/share -- Create a shareable link for a media item

Generates a time-limited, tokenized URL for sharing with non-authenticated users.

View in Swagger UI

POST /media/{media_id}/share sequence diagram

Consuming Applications

Application Screens Using This Service
Guest Portal Trip Browser, Trip Gallery
Adventure App Photo Upload