Skip to main content

Content Library

The CAFH Platform content library is a rich collection of articles, videos, audio recordings, and documents curated for your spiritual journey.

Content Types

The platform supports multiple content formats:

Articles

Written content with full HTML/Markdown support. Tagged by topic and category.

Resources

Downloadable documents like PDFs, guides, and worksheets.

Videos

Recorded sessions, teachings, and visual content with embedded player.

Audio

Meditation guides, talks, and audio teachings for on-the-go listening.

Content Structure

ContentItem Data Model

Each piece of content in the library follows this structure:
interface ContentItem {
  id: string;              // Unique identifier
  title: string;           // Display title
  type: 'Article' | 'Page' | 'Event' | 'Resource';
  status: 'Published' | 'Draft';
  author: string;          // Content creator
  publishDate: string;     // Publication date
  views: number;           // View count
  tags: string[];          // Interest/topic tags
  imageUrl?: string;       // Thumbnail or cover
  seo?: SEOConfig;         // SEO metadata
}

MediaAsset Data Model

Media files (videos, audio, documents) use this structure:
interface MediaAsset {
  id: string;
  name: string;
  type: 'image' | 'video' | 'document' | 'audio';
  url: string;             // File location
  size: string;            // File size (e.g., "2.4 MB")
  dimensions?: string;     // For images/videos
  uploadedAt: string;      // Upload date
  tags: string[];          // Interest tags
  folderId?: string;       // Organization folder
}

Personalized Recommendations

Your dashboard shows personalized content recommendations based on your profile.

How Recommendations Work

1

Load Your Interests

The system retrieves your interest tags from:
  1. Wizard Profile (if completed) → derivedTags
  2. User Profile (manual selection) → interests
  3. Default Fallback["Meditación", "Bienestar"]
2

Aggregate Content Sources

Combines items from multiple databases:
const contents = db.content.getAll();
const medias = db.media.getAll()
  .filter(m => ['document', 'video', 'audio'].includes(m.type));
3

Tag Matching

Filters content where ANY tag matches YOUR interests:
items.filter(item => 
  item.tags.some(tag => userInterests.includes(tag))
)
4

Display Top Results

Shows the top 6 matched items in your “Tu Biblioteca Personalizada” section.

Tag System

Common content tags include:
  • Meditación - Meditation content
  • Bienestar - Wellness topics
  • Estudio - Study materials
  • Retiro - Retreat information
  • Comunidad - Community events
  • Método - Method teachings
  • Principiante - Beginner-friendly
  • Avanzado - Advanced content
The more specific your interest tags, the more targeted your recommendations will be. Complete the Journey Wizard for the best personalization.

Viewing Content

When you click on a recommended item, the platform opens a full-screen content viewer modal.

Content Viewer Features

For Articles

  • Full-screen reading experience
  • Styled typography for readability
  • Article metadata (author, date)
  • Automatic scroll position persistence

For Videos

<video 
  src={contentUrl} 
  controls 
  autoPlay 
  className="w-full max-h-[60vh] rounded-xl"
/>
  • Native HTML5 video player
  • Autoplay on open
  • Full-screen support
  • Playback controls

For Audio

  • Clean audio player interface
  • Play/pause controls
  • Progress bar
  • Volume control
  • Playback speed options

For Documents (PDFs)

<iframe 
  src={documentUrl} 
  className="w-full h-[60vh] rounded-xl"
  title="Document Viewer"
/>
  • Embedded PDF viewer
  • Zoom and scroll support
  • Download option
  • Page navigation
Click the X button in the top-right corner to close the modal and return to your dashboard.
Click outside the content viewer (on the dark backdrop) to close.
Press the ESC key for quick modal dismissal (if implemented).

Analytics & Tracking

Every time you open content, the platform automatically tracks your interaction.

Consumption Tracking

When you click on content:
db.analytics.trackConsumption({
  assetId: item.originalId,
  assetName: item.title,
  assetType: item.type,
  tags: item.tags
});

What Gets Tracked

1

Content Interaction Created

A ContentInteraction record is created with:
  • Your user ID (if logged in)
  • Asset details (ID, name, type)
  • Timestamp of interaction
  • Content tags
2

View Count Incremented

The content’s views counter increases by 1.
3

History Updated

Your activity history is updated with the interaction for display in the Historial tab.
4

Recommendations Refined

Future recommendations are adjusted based on your consumption patterns.
All tracking is anonymous and used only to improve your experience. View counts help administrators understand popular content.

Content Organization

Content in the library is organized by several attributes:

By Type

  • Articles: Written content for reading
  • Resources: Downloadable materials
  • Videos: Visual content
  • Audio: Audio-only content

By Tags

Content can have multiple tags for cross-categorization:
tags: ["Meditación", "Principiante", "Bienestar"]
This allows one piece of content to appear in multiple recommendation contexts.

By Status

  • Published: Visible to members
  • Draft: Hidden, work in progress
Only content with status: 'Published' appears in member recommendations. Draft content is visible only to administrators.

Content Catalog Integration

The platform also includes a separate Content Catalog system for structured content management:

Catalog Features

  • Detailed metadata (title, description, duration)
  • Profile targeting (content specific to profile types)
  • Access control (public vs. member-only)
  • Featured content highlighting
  • Custom ordering

Catalog Item Structure

interface ContentCatalogItem {
  id: string;
  title: string;
  description: string;
  type: 'PDF' | 'Audio' | 'Video' | 'Article' | 'External';
  mediaAssetId?: string;      // Links to Media Library
  externalUrl?: string;       // For external content
  thumbnailUrl?: string;
  duration?: string;          // "15 min", "1 hour"
  tags: string[];
  targetProfiles: string[];   // Profile type IDs
  isKitItem: boolean;         // Part of welcome kit?
  access: 'public' | 'member';
  featured: boolean;
  order: number;
  publishedAt: string;
  status: 'draft' | 'published';
}

Kit Items

Profile Kit Items are special curated resources automatically recommended to new members based on their wizard profile type.

Search & Discovery

While direct search isn’t visible in the member dashboard UI, the platform includes robust search capabilities:

Content Search Function

db.content.search(query: string, type?: string)
Parameters:
  • query: Text to search in titles and tags
  • type: Optional content type filter
Example:
// Search for meditation content
const results = db.content.search("meditación", "Article");

// Search across all types
const allResults = db.content.search("bienestar");

Media Search Function

db.media.search(query: string, type?: string)
Example:
// Find all meditation videos
const videos = db.media.search("meditación", "video");

// Find audio recordings
const audio = db.media.search("", "audio");
Administrators can expose search functionality in custom pages or build dedicated library browsing interfaces using these search functions.

Offline Access

The platform stores content metadata locally for quick access:
  • Content Index: Cached in localStorage
  • Media Metadata: Available offline
  • Actual Media Files: Require internet connection
While content metadata is available offline, streaming video/audio and viewing documents requires an active internet connection.

Build docs developers (and LLMs) love