Asset Management & Media CDN (R2)
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Asset Management and Media CDN system in KudosWall is designed to handle high-fidelity customer testimonials, including text, images, and video recordings. The architecture leverages Cloudflare R2 for secure, global storage and delivery of media assets, ensuring sub-100ms loading times via an edge-optimized Content Delivery Network (CDN).
The system prioritizes security and performance by utilizing HMAC-SHA256 tokens for signed media delivery and edge-compatible Next.js proxies. This approach allows KudosWall to bridge the gap between raw web speed and enterprise-grade reliability, specifically for video streaming and avatar profile uploads.
Sources: README.md:21-25, README.md:38-40
Architecture and Data Flow
The media architecture follows a sequence where assets are stored in Cloudflare R2 and accessed via secure, temporary signed paths. When a visitor requests a testimonial page, the system validates the plan status before generating a signed URL.
Media Signing Sequence
The following diagram illustrates the request flow for accessing testimonial media:
This sequence diagram shows the validation and signing process for media assets served from R2.
Sources: README.md:68-87
Component Overview
The asset management system is distributed across the monorepo, utilizing specific packages for environment configuration, database schema, and UI primitives.
| Component | Responsibility | Source File |
|---|---|---|
| Cloudflare R2 | Global storage for video testimonials and large assets. | README.md:78 |
| UploadThing | Third-party provider for general file and asset storage. | apps/web/src/app/(marketing)/privacy/page.tsx:94 |
| Edge Proxy | Lightweight serverless handler routing media requests. | README.md:46-47 |
| Neon Postgres | Stores metadata, plan tiers, and testimonial status. | README.md:73 |
| HMAC-SHA256 | Token-based security for signing R2 media URLs. | README.md:39 |
Sources: README.md:46-50, apps/web/src/app/(marketing)/privacy/page.tsx:82-95
Media Types and Handling
KudosWall manages several distinct types of assets, each with specific processing requirements:
Video Testimonials
Video is the highest form of social proof in the system. The platform allows for native browser-based audio and video recording.
- Storage: Cloudflare R2.
- Security: Temporary signed paths with a 3600s Time-to-Live (TTL).
- Processing: AI-driven transcription and cleanup of raw speech-to-text data.
Image Assets
Images are primarily used for branding and reviewer identification.
- Logos: Project branding logos uploaded by users.
- Avatars: Profile photos for reviewers.
- Favicons: Custom favicon URLs for white-labeled walls.
Sources: README.md:38-40, apps/web/src/app/wall/[slug]/page.tsx:43, apps/web/src/lib/ai/prompts.ts:130-142
Configuration and Environment
Media operations are governed by specific environment variables validated via Zod.
| Variable | Scope | Purpose |
|---|---|---|
R2_SIGNING_SECRET | Server | Seed key for HMAC-SHA256 media signatures. |
NEXT_PUBLIC_ENABLE_VIDEO | Client | Configuration toggle for browser video recording features. |
Sources: README.md:126, README.md:136
Privacy and Compliance
Asset management is integrated into the project's "Privacy by Design" architecture. All media data is encrypted at rest using AES-256 standards. Sub-processors involved in media handling include Vercel (Hosting), Neon (Database), and Cloudflare R2 (Storage).
The flow demonstrates how media requests pass through security layers before reaching storage.
Sources: apps/web/src/app/(marketing)/dpa/page.tsx:69-74, apps/web/src/app/(marketing)/dpa/page.tsx:99-105
AI Integration for Assets
The apps/web/src/lib/ai/prompts.ts file defines an "Advanced Video Suite" which provides transcript refinement. The AI Core can analyze video transcripts for sentiment, enthusiasm scores, and theme detection (e.g., Support, Pricing, UI).
Transcript Cleanup Logic
The system includes a specific prompt for professional transcription editing:
- Remove disfluencies (um, uh, like).
- Fix run-on sentences.
- Preserve industry jargon and personal voice.
Sources: apps/web/src/lib/ai/prompts.ts:13-25, apps/web/src/lib/ai/prompts.ts:130-142
Summary
The KudosWall Asset Management & Media CDN system provides a robust pipeline for capturing and delivering social proof. By combining Cloudflare R2 for storage, HMAC-SHA256 for secure URL signing, and AI for transcript refinement, the platform ensures that video and image testimonials are both highly performant and secure across all user plan tiers.