Video Platform Development Guide
Video Platform Development Guide
Information Flowchart
Base Channel
Get ChannelBy{ID,UID,Handel}
Channel
Rest of the channel controls
Integrate MongoDB/Mongoos CS Covers integrations with various services like Google Auth,
Create a &
Setup MongoDB
with mongoose
Setup ImageKit
and multer
Setup passport
with google
Setup [Link] and
Integrate Bunny Strea J MongoDB, Bunny Stream, [Link], ImageKit, and Multer.
Express Project Integrate Env Var with
Dotenv
in [Link] in [Link] strategy
routes
Update Channe Bunny (for video services Functions for Middleware and Utilities
Create channel model to
store user login
Check Handel if exist suggest ne Passpor Middleware functions ensure proper database connection,
controller
li
const ChannelSchema = new Schema({
&
Setup Bunny Update Channel model
Get Channel by { Handle, ID, UID Passport Google OAut channel existence, user authentication, and error handling. database.j email: { type: String, trim: true },
Use createUniqueHandle
for user handle
Utility functions include timestamp retrieval, unique ID
Subscribe/Unsubscribe channe Socket.i generation, number formatting, signature creation, and
utils.j
middleware.j
logoURL: { type: String, trim: true },
})
mode: { type: String, enum: ["silent", "notification"], required: true }
lengthGreaterThan, lengthLessThan,
privacySettings, category, title, description,
sortOrder, isShort , page, limit , tag, searchText, Function
uid, notUid Middleware Function
Get Video Thumbnai Check DB Connectio Video Conmments W ebhook
Get/Generate Player Link from bunny securel Check Channel {is channel is created or not
isloggedI
Webhook and Socke asyncHandle
Live Update Upload Statue Create video controller Create Video model
Create Upload/Video
Create Video on DB
Rest of the video controls Create comment controller Create Comment model
Create route /api/
on Bunny (createVideo) updateStatus
Update Video status {isShort, length, category, Utils Function
aspect } with Webhoo getTimestamp {get Timestamp from Date Host or Open Vscode Port
generateID {generate unique id for channel and and get the url to current port
Subscription.j
[Link]
on client side
Tags Comment.j Likes/Dislikes Commen
Tags.j
Reply Commen [Link]
tus
Delete Commen Upload video directly to bunny using TUS via uploadUrl
const { VideoGuid, Status } = [Link] Status values
Get Comment const videoSchema = new Schema({
We need a Tags Model and need to update the videos and channel
model to add tag
Aayush Chouhan videoId: { type: String, required: true },
.createHash("sha256")
if (video) {
const status = {
0: "Queued",
.update(`${BUNNY_LIBRARY_ID}${BUNNY_API_KEY}${expirationTime}${videoId}`)
.digest("hex")
[Link] = status[Status]
1: "Processing...",
Edit Video {sub use of update Video dislikes: [{ type: [Link], ref: "Channel" }],
const headers = {
privacySettings: {
AuthorizationSignature: authorizationSignature,
[Link](video, {
length,
4: "Resolution Sampled",
5: "Failed",
AuthorizationExpire: expirationTime,
likes: [{ type: [Link], ref: 'Channel' }],
type: String,
channels: [{ type: [Link], ref: "Channel" }],
category,
6: "Uploading...",
VideoId: videoId,
dislikes: [{ type: [Link], ref: 'Channel' }],
trim: true,
}) aspect: [Link]((height / width) * 100, 59),
7: "UploadFinished",
LibraryId: BUNNY_LIBRARY_ID,
replies: [{ type: [Link], ref: 'Comment' }]
default: 'private',
isShort: length <= 60 && width <= height
8: "UploadFailed",
})
Aayush Chouhan },
Routes
Project Root
Routes