Story tạm thời hiển thị 24 giờ rồi tự ẩn, giống Instagram/Facebook Stories. Hỗ trợ ảnh, video ngắn, text overlay.
| # | Task | Chi tiết | Status |
|---|---|---|---|
| 01 | Prisma: model Story | Story { id, userId, mediaUrl, mediaType (IMAGE/VIDEO), text, expiresAt, viewCount, createdAt }. Index on (userId, expiresAt). | todo |
| 02 | Prisma: model StoryView | StoryView { id, storyId, viewerId, viewedAt }. Unique (storyId, viewerId) — mỗi user chỉ count 1 view. | todo |
| 03 | POST /stories | Upload media trước (reuse Upload module) → tạo Story với expiresAt = now() + 24h. | todo |
| 04 | GET /stories/feed | Lấy stories từ following users. Group by user. Sort: chưa xem trước, mới nhất trước. Bao gồm isViewed boolean. | todo |
| 05 | POST /stories/:id/view | Record view: INSERT StoryView (upsert, idempotent). Increment viewCount. Trả danh sách viewers cho chủ story. | todo |
| 06 | Cron: cleanup expired | BullMQ repeatable job mỗi 1h. Soft delete stories quá 24h. Sau 30 ngày hard delete + xóa media từ S3. | todo |
Nhóm chung sở thích. Thành viên có thể đăng bài, thảo luận trong nhóm. Admin nhóm quản lý thành viên và nội dung.
Circle, CircleMember, CircleInvitation trong Prisma. Có thể mở rộng thành Group/Community.description, coverImage, isPublic, memberCount. Thêm GroupPost (bài viết trong group).POST /groups — tạo groupGET /groups/:id — chi tiết groupPOST /groups/:id/join — tham giaPOST /groups/:id/posts — đăng bài trong groupGET /groups/:id/feed — feed groupGET /groups/discover — gợi ý group
RoleMembership đã có trong Prisma.| # | Task | Chi tiết | Status |
|---|---|---|---|
| 01 | Mở rộng Circle → Group | Thêm description, coverImage, isPublic, category. Migration Prisma. Reuse CircleMember, CircleInvitation. | todo |
| 02 | Group Post | Bài viết gắn groupId. Hiển thị trong group feed. Visibility mặc định = GROUP (chỉ member thấy). | todo |
| 03 | Group moderation | Admin group có thể: xóa bài, kick member, approve join request (nếu private group). | todo |
| 04 | Discover groups | Gợi ý group phổ biến, hoặc dựa trên topics user quan tâm (link với AI Recommendation). | todo |
Phát sóng trực tiếp video. Viewer có thể comment realtime, gửi reaction. Tự động lưu replay sau khi kết thúc.
Dùng HLS Live (đã có integration). Broadcaster push RTMP → HLS transcode → HLS playback. Chat overlay qua Pusher. Replay tự động lưu.
HLSWebhookFlow đã có. Thêm event types: video.live_stream.active, video.live_stream.idle, video.asset.live_stream_completed.