For You live streams — mobil ve web
For You feed client entegrasyonu
For You Live Streams - Mobil/Web Endpoint Dokumani
Migration rehberi
Yapılandırma sırası için Migration şablonu. Yeni düzenlemelerde Amaç → Önkoşullar → Endpoint → Request/Response → Hata kodları → Client adımları → İlgili sayfalar bölümlerini tercih edin.
Bu doküman mobil ve web istemcilerinin For You yayin alanlari için kullanacagi endpoint sozlesmesini anlatır. Dokuman UI implementasyonu veya RTK Query kodu anlatmaz; endpointler, query parametreleri, response yapisi ve backend filtre mantigini ozetler.
For You tek bir response değildir. Mobil/web tarafında 3 ayri bolum 3 ayri endpointten beslenir:
- Live
- Scheduled
- Crowdfunding
Genel Backend Mantigi
Backend her istekte JWT token'dan current user'i bulur ve kullanıcının interests alanini okur.
- Kaynak alan:
User.interests - Yayin eslesmesi:
LiveStream.interest in user.interests - Tüm listelerde soft delete edilmis yayinlar haric tutulur:
deletedAt: null - Duplicate interest degerleri backend tarafında tekillestirilir.
- Kullanıcı interest listesi bos ise endpoint bos sayfali liste döner.
- Response içindeki
rolealani istek atan kullanıcıya gore hesaplanır:host,guest,audienceveyanull.
Ortak Bilgiler
Base path:
/api/v1/live-streamAuth:
Authorization: Bearer <JWT>Bu endpointler public değildir. Kullanıcı token'i zorunludur.
Ortak query parametreleri:
| Parametre | Tip | Default | Limit | Aciklama |
|---|---|---|---|---|
page | number | 1 | min 1 | Sayfa numarasi |
limit | number | 10 | max 100 | Sayfa basina yayin sayisi |
Backend page <= 0 değerlerini 1, limit <= 0 değerlerini 10, limit > 100 değerlerini 100 olarak normalize eder.
Base Response
Tüm endpointler global response wrapper ile döner:
type BaseResponseDto<T> = {
isSuccess: boolean;
statusCode: number;
data: T;
errors?: string[];
timestamp: string;
};Bu endpointlerde data tipi her zaman:
type PaginatedResponseDto<T> = {
list: T[];
pagination: PaginationDto;
};
type PaginationDto = {
currentPage: number;
totalPages: number;
totalItems: number;
itemsPerPage: number;
hasNextPage?: boolean;
hasPrevPage?: boolean;
};Live Endpoint
Request
GET /api/v1/live-stream/for-you/live?page=1&limit=10
Authorization: Bearer <JWT>Amac
Kullaniçinin interestlerine uyan aktif yayinlari getirir.
Backend Filtre Mantigi
{
deletedAt: null,
status: 'active',
interest: { $in: currentUser.interests }
}Siralama:
{ startedAt: -1, createdAt: -1 }Response
data: PaginatedResponseDto<LiveStreamResponseDto>
Bu listede beklenen yayinlar:
status = activeinterestkullanıcının interest listesinde- En yeni baslayan yayinlar once
Scheduled Endpoint
Request
GET /api/v1/live-stream/for-you/scheduled?page=1&limit=10
Authorization: Bearer <JWT>Amac
Kullaniçinin interestlerine uyan planli veya hazirlanma durumundaki yayinlari getirir.
Backend Filtre Mantigi
{
deletedAt: null,
status: { $in: ['scheduled', 'preparing'] },
interest: { $in: currentUser.interests },
plannedStartDate: { $ne: null },
$or: [
{ liveStreamType: { $ne: 'duocrowd' } },
{
liveStreamType: 'duocrowd',
$expr: {
$gte: [
{ $ifNull: ['$collectedFunding', 0] },
{ $ifNull: ['$fundingGoal', 0] }
]
}
}
]
}Siralama:
{ plannedStartDate: 1, createdAt: -1 }Response
data: PaginatedResponseDto<LiveStreamResponseDto>
Bu listede beklenen yayinlar:
status = scheduledveyastatus = preparingliveStreamType = soloyayinlarliveStreamType = duoselfyayinlarliveStreamType = duocrowdve funding hedefi tamamlanmis yayinlar
Bu listede beklenmeyen yayinlar:
- Hedefe ulasmamis
duocrowdyayinlar. Bunlar crowdfunding endpointinde döner.
Crowdfunding Endpoint
Request
GET /api/v1/live-stream/for-you/crowdfunding?page=1&limit=10
Authorization: Bearer <JWT>Amac
Kullaniçinin interestlerine uyan, funding hedefine henuz ulasmamis DuoCrowd yayinlari getirir.
Backend Filtre Mantigi
{
deletedAt: null,
status: 'scheduled',
liveStreamType: 'duocrowd',
interest: { $in: currentUser.interests },
plannedStartDate: { $ne: null },
$expr: {
$lt: [
{ $ifNull: ['$collectedFunding', 0] },
{ $ifNull: ['$fundingGoal', 0] }
]
}
}Siralama:
{ plannedStartDate: 1, createdAt: -1 }Response
data: PaginatedResponseDto<LiveStreamResponseDto>
Bu listede beklenen yayinlar:
status = scheduledliveStreamType = duocrowdcollectedFunding < fundingGoalinterestkullanıcının interest listesinde
LiveStreamResponseDto
Endpointlerin list alanindaki item yapisi:
type LiveStreamResponseDto = {
id: string;
title: string;
liveStreamType: 'solo' | 'duocrowd' | 'duoself';
channelName: string;
broadcasters: Array<{
user: string;
role: 'host' | 'guest';
uid?: number | null;
hasJoined: boolean;
}>;
guests: UserSummaryDto[];
creator?: UserSummaryDto | null;
thumbnailUrl?: string | null;
recording: boolean;
recordingUrl?: string | null;
status:
| 'active'
| 'scheduled'
| 'preparing'
| 'ended'
| 'expired'
| 'cancelled_by_host'
| 'cancelled_by_guest';
accessType: 'free' | 'paid';
price?: number;
interest: string;
durationGoal?: number | null;
motivation?: string | null;
startedAt?: string | null;
plannedStartDate?: string | null;
endedAt?: string | null;
plannedEndDate?: string | null;
fundingGoal?: number | null;
collectedFunding?: number | null;
fundingPercentage?: number | null;
role: 'host' | 'guest' | 'audience' | null;
miniCrowdFundings: MiniCrowdFundingResponseDto[];
createdAt: string;
updatedAt: string;
};UserSummaryDto:
type UserSummaryDto = {
_id: string;
username?: string;
name?: string | null;
surname?: string | null;
availabilityStatus?: string;
profilePhoto?: {
_id: string;
url?: string;
type?: string;
variants?: Record<string, string>;
} | null;
};MiniCrowdFundingResponseDto:
type MiniCrowdFundingResponseDto = {
status: string;
duration: number | null;
targetAmount: number;
collectedAmount: number;
startTime?: string | null;
requestedBy?: string | null;
};Ornek Response
{
"isSuccess": true,
"statusCode": 200,
"data": {
"list": [
{
"id": "664f0d9e2e6c8f4d5a123456",
"title": "Muzik sohbeti",
"liveStreamType": "solo",
"channelName": "muzik-sohbeti-abc123",
"broadcasters": [],
"guests": [],
"creator": {
"_id": "664f0d9e2e6c8f4d5a999999",
"username": "creator",
"name": "Creator",
"surname": null,
"availabilityStatus": "available",
"profilePhoto": null
},
"thumbnailUrl": "https://s.allminelive.com/interest-covers/interest-example-1.png",
"recording": false,
"recordingUrl": null,
"status": "active",
"accessType": "free",
"price": 0,
"interest": "music",
"durationGoal": null,
"motivation": null,
"startedAt": "2026-05-11T10:00:00.000Z",
"plannedStartDate": null,
"endedAt": null,
"plannedEndDate": null,
"fundingGoal": null,
"collectedFunding": null,
"fundingPercentage": null,
"role": "audience",
"miniCrowdFundings": [],
"createdAt": "2026-05-11T09:58:00.000Z",
"updatedAt": "2026-05-11T10:00:00.000Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 1,
"totalItems": 1,
"itemsPerPage": 10,
"hasNextPage": false,
"hasPrevPage": false
}
},
"errors": [],
"timestamp": "2026-05-11T10:01:00.000Z"
}Bos Liste Response
Kullaniçinin interestlerine uygun yayin yoksa veya kullanıcının interest listesi bos ise:
{
"isSuccess": true,
"statusCode": 200,
"data": {
"list": [],
"pagination": {
"currentPage": 1,
"totalPages": 0,
"totalItems": 0,
"itemsPerPage": 10,
"hasNextPage": false,
"hasPrevPage": false
}
},
"errors": [],
"timestamp": "2026-05-11T10:01:00.000Z"
}Hata Response'lari
401 Unauthorized
Token yoksa, gecersizse veya suresi dolmussa:
{
"isSuccess": false,
"statusCode": 401,
"data": null,
"errors": ["auth.errors.authentication-required"],
"timestamp": "2026-05-11T10:01:00.000Z"
}403 Forbidden
Kullanıcı role guard'dan gecemezse:
{
"isSuccess": false,
"statusCode": 403,
"data": null,
"errors": ["Insufficient permissions"],
"timestamp": "2026-05-11T10:01:00.000Z"
}404 Not Found
JWT'deki kullanıcı ID'si ile kullanıcı bulunamazsa:
{
"isSuccess": false,
"statusCode": 404,
"data": null,
"errors": ["Kullanıcı bulunamadi"],
"timestamp": "2026-05-11T10:01:00.000Z"
}Mobil/Web Tuketim Notlari
- 3 endpoint paralel cagrilabilir.
- Her endpoint kendi pagination state'ine sahip olmalidir.
LivebolumundestartedAtana zaman alanidir.ScheduledveCrowdfundingbolumlerindeplannedStartDateana zaman alanidir.CrowdfundingkartlarindafundingGoal,collectedFunding,fundingPercentagealanlari kullanılmalıdır.- Bos liste gelirse ilgili bolum gizlenebilir.
- Token yoksa endpointleri çağırmak yerine login/session akisi tetiklenmelidir.
Kabul Kontrolu
Mobil/web entegrasyonunda asagidaki davranislar dogrulanmalidir:
for-you/livesadeceactiveyayinlari listeler.for-you/scheduledhedefe ulasmis DuoCrowd yayinlari scheduled alaninda gösterir.for-you/scheduledhedefe ulasmamis DuoCrowd yayinlari göstermez.for-you/crowdfundingsadece hedefe ulasmamis scheduled DuoCrowd yayinlari listeler.- Tüm listelerde yayin interest'i current user interestlerinden biridir.
- Pagination
hasNextPagetrue ise sonraki sayfa ayni endpointten çekilir.