Skip to main content

Document Storage and Metadata Management in Axvero

Overview

Axvero separates document metadata from file content for scalable and maintainable document management. The API and data model are designed to store document metadata in the application database, while the actual file content is managed by an external storage provider (e.g., cloud object storage, self-hosted storage, etc.).

How It Works

  1. File Upload:

    • The user uploads a file using the Axvero API.
    • The backend receives the file and uploads it to the configured storage provider (e.g., S3, MinIO, local disk).
    • The storage provider returns a public URL or storage key for the file.
    • The backend creates a Document record in the database, storing metadata (name, owner, etc.) and the fileUrl (the storage reference).
  2. File Download:

    • The user requests to download a document.
    • The backend looks up the Document record, retrieves the fileUrl, and fetches the file from the storage provider.
    • The file is streamed or returned to the user.
  3. Document Metadata Management:

    • All metadata (name, ownerUserId, ownerTeamId, tags, status, fileUrl, etc.) is stored in the application database as defined in the Document model.
    • The actual file content is stored and managed by the storage provider, not in the database.

Implementation Flexibility

  • The storage provider (e.g., Supabase Storage, AWS S3, MinIO, local disk) is implementation-specific and can be changed without affecting the API contract or data model.
  • The API documentation and OpenAPI schema should refer to the fileUrl as a generic storage reference, not tied to any specific provider.

Example Document Model

Document:
id: string
ownerUserId: string
ownerTeamId: string | null
name: string
description: string
fileUrl: string # Storage provider reference (public URL or key)
status: string # active, archived, deleted
tags: string[]
createdAt: string
updatedAt: string

Notes

  • The backend implementation is responsible for integrating with the chosen storage provider and managing file uploads/downloads.
  • The API and data model remain agnostic to the storage provider.
  • This approach is recommended for scalable, secure, and maintainable document management in Axvero.