Skip to content

[Backend] Add media validation and processing pipeline #309

@Kaylahray

Description

@Kaylahray

Description

The upload route exists, but there is still room for a more complete media pipeline with stronger validation, metadata extraction, and safe handling of user files.

User Story

As a user,
I want to upload media safely,
so that posts and profiles can support rich content without breaking the app.

Requirements and Context

  • Files: app/app/api/uploads/route.ts, app/lib/media-utils.ts, app/lib/image-compression.ts, app/lib/file-validation.ts
  • Enforce file type, size, and extension validation
  • Extract metadata and normalize image uploads consistently
  • Return stable upload responses for both post media and avatar use cases

Suggested Implementation

// MEDIA PIPELINE
// 1. Validate file type and size.
// 2. Normalize and compress supported images.
// 3. Store metadata for downstream consumers.
// 4. Reject unsafe or malformed uploads.

Acceptance Criteria

  • Invalid file types are rejected before processing.
  • Valid media is normalized consistently.
  • The upload response is predictable for the frontend.

Submission Guidelines

  • Branch: feat/media-processing
  • Depends on: upload and media utility modules
  • PR: feat(backend): harden media validation and processing

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions