Overview
The Knowledge Base is a training video library that supports both global and auction-scoped content. It provides two content types: regular Videos for in-depth training and Shorts for bite-sized vertical content. Global videos are accessible to all authenticated users and managed by super admins. Auction-scoped videos are visible only to members of a specific auction and managed by the auction’s owner or admin. Progress is automatically tracked as users watch videos, with completion detected at 90% viewed for videos and on first play for Shorts.Video Browser
YouTube Shorts
Progress Tracking
Auction-Scoped Videos
Access Levels
| Capability | Auction Members | Auction Owner/Admin | Super Admins |
|---|---|---|---|
| Browse global published videos and Shorts | Yes | Yes | Yes |
| Browse auction-scoped published videos | Own auction | Own auction | Yes |
| Watch videos and Shorts | Yes | Yes | Yes |
| Track progress | Yes | Yes | Yes |
| View continue watching | Yes | Yes | Yes |
| Access global management interface | No | No | Yes |
| Create/edit/delete categories | No | No | Yes |
| Add/edit/delete global videos | No | No | Yes |
| Add/edit/delete global Shorts | No | No | Yes |
| Add/edit/delete auction-scoped videos | No | Own auction | Yes |
| Toggle video/Short publishing | No | Own auction | Yes |
| Reorder categories and videos | No | No | Yes |
| Create/edit/delete global tags | No | No | Yes |
| Create/edit/delete auction-scoped tags | No | Own auction | Yes |
| Assign tags to videos and Shorts | No | Own auction | Yes |
- Global videos — Accessible to all authenticated users regardless of auction membership. Managed by super admins via Settings > Knowledge Base.
- Auction-scoped videos — Visible only to members of a specific auction. Managed by the auction’s owner or admin from the auction’s Knowledge Base tab.
Accessing the Knowledge Base
Global Knowledge Base
Navigate to Knowledge Base
Browse the Video Library
Auction-Scoped Knowledge Base
Open Knowledge Base Tab
Video Browser
The video browser is the main Knowledge Base page at/knowledge-base. It displays all published videos with filtering, search, and progress tracking.
Progress Summary
At the top of the page, a progress card shows your overall completion status:- Completed count — Number of videos you have finished watching
- Total count — Total number of published videos
- Percentage — Your completion percentage displayed as text and a progress bar
Continue Watching
Below the progress summary, a “Continue Watching” section displays up to 5 videos you have started but not yet completed, ordered by most recently watched. Each card shows:- Video thumbnail with progress bar overlay
- Video title
- Time watched vs. total duration with percentage
Search and Filter
The video browser provides three ways to find content:Search
Search
Category Filter
Category Filter
Tag Filter
Tag Filter
Video Grid
Videos display in a responsive grid (2 columns on small screens, 3 on large). Each video card shows:| Element | Description |
|---|---|
| Thumbnail | YouTube thumbnail image or placeholder icon |
| Completion badge | Green checkmark overlay when video is completed |
| Duration | Badge showing video length in MM:SS format |
| Progress bar | Bottom bar showing watched percentage (hidden when completed) |
| Category | Badge showing the video’s category name |
| Tags | Colored tag badges showing assigned tags |
| Title | Video title (up to 2 lines) |
| Description | Video description excerpt (up to 2 lines) |
Video Detail Page
The video detail page at/knowledge-base/[videoId] provides a full viewing experience for a single video.
Video Player
The player uses the YouTube IFrame API to embed videos directly in the page:- 16:9 aspect ratio container for consistent display
- Resume playback — Automatically resumes from where you left off
- Progress tracking — Saves your watch position every 10 seconds during playback
- Auto-completion — Marks the video as completed when you reach 90% of the duration
- Page unload save — Saves progress when you navigate away or close the tab
Video Metadata
Below the player, the detail page displays:- Title — Full video title
- Completion status — Green “Completed” indicator when finished
- Duration — Total video length
- Category — Category badge linking to the category
- Description — Full video description in a bordered section
Management Interface
The management interface at/knowledge-base/manage is restricted to super admins. It provides three tabs for organizing content.
Categories Tab
The Categories tab displays all categories in a sortable list with drag-and-drop reordering.Viewing Categories
Each category row shows:| Element | Description |
|---|---|
| Drag handle | Grip icon for drag-and-drop reordering |
| Name | Category name with folder icon |
| Description | Category description (truncated) |
| Video count | Badge showing number of videos in the category |
| Actions | Edit and Delete buttons |
Adding a Category
Enter Category Details
Editing a Category
Deleting a Category
Confirm Deletion
Reordering Categories
Drag categories using the grip handle to reorder them. The new display order is saved automatically when you drop the item. Keyboard users can reorder using Tab to focus the handle, Space to pick up, arrow keys to move, and Space to drop.Tags Tab
The Tags tab lets you create colored tags to classify and filter videos. Tags are separate from categories and provide an additional dimension of organization.Tag Scoping
Tags follow the same scoping rules as videos:- Global tags — Created by super admins in the global Knowledge Base management interface. Can be assigned to any video.
- Auction-scoped tags — Created by auction owners/admins. Only visible to auction members and assignable to videos in the same auction.
Viewing Tags
Each tag row shows:| Element | Description |
|---|---|
| Drag handle | Grip icon for drag-and-drop reordering |
| Tag badge | Colored pill showing the tag name and color |
| Video count | Number of videos using this tag |
| Actions | Edit and Delete buttons |
Adding a Tag
Enter Tag Name
Select a Color
Editing a Tag
Modify Name or Color
Deleting a Tag
Review Warning
Reordering Tags
Drag tags using the grip handle to reorder them. The new display order is saved automatically. Tags appear in this order in the mobile tag filter sheet and on video cards.Assigning Tags to Videos and Shorts
Tags are assigned to videos and Shorts through their respective edit modals:Videos Tab
The Videos tab displays all videos grouped by category, with drag-and-drop reordering within groups. A search and filter toolbar helps you quickly find specific videos to manage.Search and Filter
The Videos tab provides three ways to find content within the management interface:Search
Search
Category Filter
Category Filter
Tag Filter
Tag Filter
Viewing Videos
Videos are organized under collapsible category headers. Each video row shows:| Element | Description |
|---|---|
| Drag handle | Grip icon for reordering within the category |
| Thumbnail | Small preview image (120×68px) or placeholder |
| Duration | Overlay badge on the thumbnail |
| Title | Video title |
| Description | Video description (truncated) |
| Published status | Badge showing “Published” or “Draft” with toggle switch |
| Actions | Edit and Delete buttons |
Adding a Video
Enter YouTube URL
Review Auto-Fetched Metadata
Complete Optional Fields
Editing a Video
Modify Details
Deleting a Video
Review Warning
Publishing and Unpublishing
Toggle the switch on any video row to change its published state:- Published — Video is visible to all users in the video browser
- Draft — Video is hidden from regular users but visible to super admins in the management interface
Reordering Videos
Drag videos within a category group to reorder them. The new display order is saved when you drop the item. Videos can only be reordered within their current category.Shorts Tab
The Shorts tab manages YouTube Shorts — short-form vertical videos designed for quick, bite-sized training content. Shorts are displayed in a dedicated swipe feed on the mobile app.Viewing Shorts
Shorts are organized under collapsible category headers, similar to videos. Each Short row shows the same elements as regular videos (thumbnail, title, description, published status, and action buttons).content_type field. The same categories can contain both videos and Shorts, but they are managed separately in the interface.Adding a Short
Enter YouTube Shorts URL
Review Auto-Fetched Metadata
Complete Optional Fields
Editing a Short
Modify Details
Assign Tags
Deleting a Short
Review Warning
Shorts vs. Videos
| Aspect | Videos | Shorts |
|---|---|---|
| Format | Horizontal (16:9) | Vertical (9:16) |
| Playback | Detail page with controls | Full-screen swipe feed |
| Progress | Seconds watched, 90% auto-complete | Binary viewed/not-viewed |
| Looping | No | Yes, loops continuously |
| Controls | Standard YouTube controls | No visible controls |
| Orientation | Supports landscape fullscreen | Locked to portrait |
| Tags | Assignable via edit modal | Assignable via edit modal |
Auction-Scoped Video Management
Auction owners and admins can manage training videos scoped to their specific auction. These videos appear in the auction’s Knowledge Base tab alongside global videos but are only visible to members of that auction.How Auction-Scoped Videos Work
- Scoped visibility — Auction videos are only visible to members of the auction they belong to
- Combined view — When viewing an auction’s Knowledge Base, members see both global videos and auction-specific videos in one unified list
- Shared categories — Auction videos use the same global category taxonomy managed by super admins
- Independent management — Auction owners/admins manage their videos independently without affecting global content
- Same progress tracking — Progress is tracked identically for both global and auction-scoped videos
Managing Auction Videos
Open Knowledge Base
Add a Video
Global vs. Auction-Scoped Videos
| Aspect | Global Videos | Auction-Scoped Videos |
|---|---|---|
| Visibility | All authenticated users | Auction members only |
| Managed by | Super admins | Auction owner/admin |
| Admin location | Settings > Knowledge Base > Manage | Auction > Knowledge Base |
| Categories | Global shared categories | Same global categories |
| Progress tracking | Per user | Per user (identical) |
| Shorts support | Yes | Yes |
| Tags | Global tags | Global tags + auction-scoped tags |
| Deletion cascade | Deleting the video removes progress | Same, plus deleted if auction is deleted |
Progress Tracking Details
The Knowledge Base automatically tracks viewing progress for each user. Here is how progress tracking works under the hood.How Progress Is Saved
Periodic Saves
Periodic Saves
Pause and State Change Saves
Pause and State Change Saves
Page Unload Save
Page Unload Save
beforeunload event.Auto-Completion
Auto-Completion
watched_seconds reaches 90% or more of the video’s duration_seconds, the video is automatically marked as completed with a timestamp.Progress Data
Each progress record tracks:| Field | Description |
|---|---|
| watched_seconds | Total seconds the user has watched |
| completed | Whether the video is marked as completed |
| completed_at | Timestamp when the video was completed (null if not completed) |
| last_watched_at | Timestamp of the most recent watch session |
Database Schema
The Knowledge Base uses five database tables. Categories are global, videos support both global and auction-scoped content, progress is tracked per user, and tags provide additional classification with many-to-many video associations.knowledge_base_categories
Stores video categories for organizing content. Categories are global and shared across all scopes.| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
name | TEXT | Category name (required) |
description | TEXT | Optional description |
display_order | INT | Sort order for display (default: 0) |
created_at | TIMESTAMPTZ | Creation timestamp |
updated_at | TIMESTAMPTZ | Last update timestamp (auto-managed) |
knowledge_base_videos
Stores video and Shorts entries with YouTube metadata. Supports both global and auction-scoped content via theauction_id column.
| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
auction_id | UUID | Foreign key to auctions (nullable, CASCADE on delete). NULL = global video, set = auction-scoped |
category_id | UUID | Foreign key to categories (nullable, SET NULL on delete) |
title | TEXT | Video title (required) |
description | TEXT | Optional description |
youtube_url | TEXT | Full YouTube URL (required) |
youtube_video_id | TEXT | Extracted YouTube video ID (required) |
thumbnail_url | TEXT | Custom or YouTube thumbnail URL |
duration_seconds | INT | Video duration in seconds |
display_order | INT | Sort order within category (default: 0) |
is_published | BOOLEAN | Whether visible to users (default: true) |
content_type | TEXT | Content type: video (default) or short |
created_at | TIMESTAMPTZ | Creation timestamp |
updated_at | TIMESTAMPTZ | Last update timestamp (auto-managed) |
auction_id column determines video scope:NULL— Global video, visible to all users, managed by super admins- UUID — Auction-scoped video, visible to auction members, managed by auction owner/admin
- When an auction is deleted, all its scoped videos are automatically removed via
CASCADE
user_video_progress
Tracks per-user viewing progress for each video. Progress works identically for both global and auction-scoped videos.| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
user_id | UUID | Foreign key to auth.users (CASCADE on delete) |
video_id | UUID | Foreign key to videos (CASCADE on delete) |
watched_seconds | INT | Seconds watched (default: 0) |
completed | BOOLEAN | Whether completed (default: false) |
completed_at | TIMESTAMPTZ | Completion timestamp (nullable) |
last_watched_at | TIMESTAMPTZ | Last watch session timestamp |
UNIQUE(user_id, video_id) — One progress record per user per video.
knowledge_base_tags
Colored tags for classifying knowledge base videos. Supports both global and auction-scoped tags.| Column | Type | Description |
|---|---|---|
id | UUID | Primary key |
auction_id | UUID | Foreign key to auctions (nullable, CASCADE on delete). NULL = global tag, set = auction-scoped |
name | TEXT | Tag display name (required, unique within scope) |
color | TEXT | Hex color code for visual display (default: #6B7280) |
display_order | INT | Sort order for display (default: 0) |
created_at | TIMESTAMPTZ | Creation timestamp |
updated_at | TIMESTAMPTZ | Last update timestamp (auto-managed) |
knowledge_base_video_tags
Junction table linking videos to tags (many-to-many). A database trigger enforces scope consistency — auction-scoped tags can only be assigned to videos in the same auction.| Column | Type | Description |
|---|---|---|
video_id | UUID | Foreign key to knowledge_base_videos (CASCADE on delete) |
tag_id | UUID | Foreign key to knowledge_base_tags (CASCADE on delete) |
created_at | TIMESTAMPTZ | Assignment timestamp |
PRIMARY KEY(video_id, tag_id) — One assignment per video-tag pair.
Row-Level Security
Categories RLS
Categories RLS
- SELECT: All authenticated users can view categories
- INSERT/UPDATE/DELETE: Requires
is_any_auction_admin_or_above()— user must be a super admin or an admin/owner of any auction
Videos RLS
Videos RLS
auction_id IS NULL):- SELECT: All authenticated users see published global videos; super admins and auction admins see unpublished global videos
- INSERT/UPDATE/DELETE: Requires
is_super_admin()
auction_id IS NOT NULL):- SELECT: Auction members see published videos; auction owner/admin see all videos (published and unpublished) for their auction
- INSERT/UPDATE/DELETE: Requires
is_auction_admin_or_above(auction_id)— user must be the owner or an admin of the specific auction
Tags RLS
Tags RLS
Video Tags (junction) RLS
Video Tags (junction) RLS
Progress RLS
Progress RLS
- SELECT/INSERT/UPDATE/DELETE: Users can only access their own progress records (
user_id = auth.uid()) - Progress policies are unchanged — they apply equally to global and auction-scoped videos
Key Components
The admin Knowledge Base feature is built from the following components:Viewer Components
| Component | Purpose |
|---|---|
KnowledgeBaseViewer | Main video browser with search, filter, and progress |
VideoDetail | Single video page with player and metadata |
VideoPlayer | YouTube IFrame API player with progress tracking |
VideoCard | Video thumbnail card for the grid |
ProgressSummary | Overall completion progress bar |
ContinueWatching | Horizontal list of in-progress videos |
KnowledgeBaseSearch | Debounced search input with accessibility |
CategoryFilter | Category chip filter with keyboard navigation |
Management Components
| Component | Purpose |
|---|---|
KnowledgeBaseManageTabs | Tab container for Categories, Tags, Videos, and Shorts |
CategoriesManagement | Category list with CRUD operations |
CategoriesList | Drag-and-drop sortable category list |
AddCategoryModal | Form dialog for creating categories |
EditCategoryModal | Form dialog for editing categories |
DeleteCategoryDialog | Confirmation dialog for category deletion |
VideosManagement | Video list with CRUD, grouping, search, tag filter, and category filter |
VideosList | Drag-and-drop sortable video list by category |
AddVideoModal | Form dialog for adding videos with YouTube fetch |
EditVideoModal | Form dialog for editing video metadata |
DeleteVideoDialog | Confirmation dialog for video deletion |
ShortsManagement | Shorts list with CRUD and category grouping |
AddShortModal | Form dialog for adding Shorts with vertical thumbnail preview |
EditShortModal | Form dialog for editing Short metadata and assigning tags |
TagsManagement | Tag list with CRUD operations and drag-and-drop reordering |
TagsList | Drag-and-drop sortable tag list |
CreateTagDialog | Form dialog for creating tags with color picker and live preview |
EditTagDialog | Form dialog for editing tag name and color |
DeleteTagDialog | Confirmation dialog for tag deletion with usage count |
VideoTagPicker | Multi-select dropdown for assigning tags to videos and Shorts, with search for large tag sets |
Troubleshooting
Video not playing
Video not playing
Progress not saving
Progress not saving
Video not appearing in browser
Video not appearing in browser
Cannot access management interface
Cannot access management interface
/knowledge-base/manage requires super admin access. If you are redirected, contact a super admin to verify your permissions.Category deletion impact
Category deletion impact
Auto-fetched title is wrong
Auto-fetched title is wrong
Drag-and-drop not working
Drag-and-drop not working
Video completion not triggering
Video completion not triggering
duration_seconds is not set (null), auto-completion cannot be calculated. Re-add the video or update the duration in the database if needed.Auction video not visible to members
Auction video not visible to members
Cannot manage auction videos
Cannot manage auction videos
Best Practices
Content Organization
Content Organization
- Create clear category names that reflect training topics
- Keep category descriptions concise and informative
- Order categories by importance or learning sequence using drag-and-drop
- Limit categories to a manageable number (5–15 recommended)
Video Management
Video Management
- Use descriptive titles that clearly indicate the video content
- Add descriptions to provide context about what users will learn
- Set videos as draft while preparing content, then publish when ready
- Order videos within categories to create a logical learning path
Publishing Workflow
Publishing Workflow
- Add videos as drafts first to review metadata before publishing
- Verify the YouTube video is publicly accessible before publishing
- Use the published/draft toggle to temporarily hide videos without deleting them
- Review the video browser as a regular user to verify the experience
Progress Monitoring
Progress Monitoring
- Each user’s progress is private and independent
- The 90% completion threshold accounts for users who skip intros or outros
- Progress persists across sessions — users can resume where they left off
- Deleting a video permanently removes all user progress for that video
Auction-Scoped Content
Auction-Scoped Content
- Use global videos for training that applies to all auctions (company-wide policies, general procedures)
- Use auction-scoped videos for content specific to a particular auction (site-specific procedures, local training)
- Auction-scoped videos are automatically deleted when an auction is removed
- Members see auction videos alongside global ones — avoid duplicate content across scopes