-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
StreamFi currently has no way to search for a specific creator or stream. This is a core discovery feature — without it, new users have no path to finding content they care about.
Search scope
| Query type | Example | Result |
|---|---|---|
| Creator username | alice |
Profile card + live status |
| Stream title | valorant ranked |
Matching live streams |
| Category / tag | gaming |
Streams + creators in category |
API
GET /api/search?q={query}&type={all|users|streams|categories}&limit=10
Requires pg_trgm extension for fuzzy matching:
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE INDEX users_username_trgm ON users USING gin(username gin_trgm_ops);
CREATE INDEX creators_title_trgm ON creators USING gin(stream_title gin_trgm_ops);Users:
SELECT username, avatar, is_live, follower_count, bio
FROM users
WHERE username ILIKE '%' || $1 || '%'
ORDER BY is_live DESC, follower_count DESC
LIMIT $2Live streams:
SELECT u.username, u.avatar, c.stream_title, c.category, c.tags
FROM users u JOIN creators c ON c.user_id = u.id
WHERE u.is_live = true
AND (c.stream_title ILIKE '%' || $1 || '%'
OR c.category ILIKE '%' || $1 || '%'
OR $1 = ANY(c.tags))
LIMIT $2UI
Global search bar
- In main navbar (desktop) and explore page (mobile)
Cmd+K/Ctrl+Kkeyboard shortcut opens overlay- Debounced input (300ms) triggers API call
Search overlay / dropdown
- Sections: "Live Now", "Creators", "Categories"
- Each result: avatar/thumbnail, name, live dot indicator
- Click → navigate to
/{username}or/browse/category/{title} - Empty state: "No results for '{query}'"
- Loading: skeleton rows
Dedicated /search page
- Full results with tabs: All / Creators / Live Streams / Categories
- Shareable URL (
/search?q=alice) - Direct navigation from external links
New components
components/search/SearchBar.tsx— input withCmd+Ksupportcomponents/search/SearchOverlay.tsx— dropdown resultsapp/search/page.tsx— full search results page
Acceptance criteria
-
pg_trgmextension and indexes in migration script - Search API returns users and live streams for a query
- Global search bar in navbar with
Cmd+Kshortcut - Debounced live dropdown with "Live Now" / "Creators" sections
- Dedicated
/searchpage with tabbed results - Query reflected in URL
- Empty state + loading skeleton
- Mobile full-screen overlay
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request