Skip to main content

🟠 Release v2.273.0

⭐⭐⭐ Complex • 3 commits • 81 files
v2.273.0 introduces the Asset Library, a centralized image management system for admin panels that eliminates duplicate uploads and streamlines campaign creation. Combined with a UI refinement to reward card scheduling display, this release improves both admin productivity and user experience.Quick Win: Admins can now reuse images across challenges, rewards, achievements, and posts without re-uploading—saving time and reducing Blob storage usage.

What’s New

  • Asset Library Browser – Browse and search existing images in a paginated gallery organized by scope (All, Org-wide, Community)
  • Duplicate Detection – MD5-based hash checking prevents uploading the same image twice, saving Blob storage costs
  • Scoped Asset Visibility – Upload org-wide images available to all campaigns, or community-specific images isolated per community
  • Integrated Image Uploader – All form image fields (challenges, rewards, achievements, posts) now use the asset library instead of direct uploads
  • Improved Reward Card Layout – Scheduled countdown now displays at the bottom of reward cards for better visual clarity

Apps Updated

User App

✓ Updated - 1 change

API

✓ Updated - 6 new asset endpoints

Admin

✓ Updated - Asset Library system

MCP Server

— No changes

Website

— No changes

Games

— No changes

Detailed Changes

Asset Library System

  • New Asset Library UI components: asset-gallery, asset-library-picker, asset-thumbnail, image-cropper-dialog
  • Asset Library Settings tab in Organization settings for managing assets and bulk uploads
  • Updated all image upload fields in challenge, achievement, reward, and post forms to use AssetLibraryPicker
  • Hash-based duplicate detection in image picker to prevent uploading the same file twice
  • Scoped asset filtering: All / Org-wide / Community visibility controls
  • Inline filename editing for asset organization

New Assets Management API

  • GET /assets – Paginated asset listing with community filtering and search support (24 per page)
  • POST /assets – Create new asset with MD5 hash duplicate detection
  • PATCH /assets/{id} – Update asset filename for organization
  • DELETE /assets/{id} – Soft delete assets with referential integrity checks
  • GET /assets/by-hash – Find existing assets by MD5 hash to prevent duplicates
  • New assets tRPC router with full CRUD test coverage
  • Asset store service with MongoDB operations for asset persistence
  • Cache tag invalidation for asset operations

UI Layout Improvements

  • Moved scheduled countdown display from upper section to bottom of textual reward cards
  • Better visual hierarchy for scheduled rewards—countdown now sits with supply/status info at card base

Assets Collection

  • New assets collection for storing uploaded images with hybrid org/community scoping
  • Indexes on location, organisationId, communityId, and contentHash for efficient querying
  • Soft delete support via isActive flag to prevent deletion of referenced assets

Asset Type Definitions

  • AssetDtoModel with full type definitions for org/community scoping, MD5 hash, and metadata
  • Asset store models and mappers for DTO↔store conversion

Technical Architecture

Asset Library Design

The Asset Library solves a critical pain point: admins recreating and re-uploading the same images across challenges, achievements, rewards, and posts. Instead, they now browse a paginated gallery of existing assets, upload new images once, and reuse them across the platform. Key Features:
  • MD5-Based Duplicate Detection – Prevents storing the same image multiple times in Blob storage
  • Hybrid Scoping – Org-wide assets available everywhere; community assets isolated per community
  • Soft Delete – Assets marked as inactive instead of deleted, preserving integrity of references
  • Efficient Querying – MongoDB indexes on location, organisationId, communityId, and contentHash

How It Works

  1. Admin clicks image field → Asset Library modal opens showing paginated gallery (24 items)
  2. Browse existing assets → Filter by scope (All / Org-wide / Community), search by filename
  3. Community-scoped assets → Show community badge indicator in “All” view
  4. Upload new asset (if needed):
    • Client-side crop & compression (same as before)
    • Compute MD5 hash of file content
    • Check /assets/by-hash endpoint—if duplicate exists, reuse
    • If new: upload to Vercel Blob, create Asset record via /assets
    • Auto-select the newly uploaded asset
  5. Select asset → URL populated on form field
  6. Reuse across campaigns → Same asset URL can be selected in multiple forms

API Integration

All asset operations support RBAC and community scoping. The asset store uses MongoDB transactions for atomicity when creating/deleting assets. Cache invalidation ensures asset lists refresh on modifications.

Usage Examples

Reusing an Asset Across Challenges

Scenario: Upload a “Complete Profile” badge once, reuse it in 5 challenges.
1. Open Challenge A form → Image field → Asset Library opens
2. Click "Add New" → Upload badge image
3. System detects MD5 hash → Creates asset if new → Auto-selects badge
4. Save Challenge A
5. Open Challenge B form → Same image field
6. Asset Library shows badge → One click to select (no re-upload)
7. Repeat for Challenges C, D, E, F
Benefit: Same image stored once in Blob, reused 5 times. Save ~4 redundant uploads and storage cost.

Organization vs. Community Assets

Organization Logo (Org-wide):
- Uploaded at organization level
- Available in all communities
- Visible in "All" + "Org-wide" filters

Tier Icons (Community-specific):
- Uploaded within specific community
- Only visible in that community's forms
- Shows community badge in "All" filter

Contributors

jamescockayne@jamescockayne1 commit • +10,359/-63 lines

ZuhayrK00@ZuhayrK001 commit • +3/-4 lines

Release Stats

MetricValue
Total Commits3
Lines Added+10,664
Lines Removed-68
Files Changed81
Release SizeLarge
Complexity⭐⭐⭐

v2.273.0 deployed on April 1, 2026