0% found this document useful (0 votes)
7 views1 page

Video Platform Development Guide

document
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Video Platform Development Guide

document
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DevTube

Information Flowchart

Base Channel

Features Technologies / Librarie Summarized with AI - July 21, 2024

Video platform essentials


Auth and Integration Frontend Video Platform Features Create channel,

Subscribe & Unsubscribe


Google Auth Login/Logou EJS Includes features like authentication, channel management,
video creation, comments, and studio functionalities. Setup Project Structure

Create channel controller Update 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

Integrate Socket.i Socket.i Provides capabilities for video management, tagging,


comments, and studio operations.
Integrate ImageKit Tus Js Clien
Technologies and Libraries
Integrate Multe Utilizes technologies such as EJS, CSS, JS, [Link], controller
Create collection in bunny
Backen Mongoose, Bunny, Passport, Axios, Bcrypt, and [Link]. channelController.j
Channe Express j Libraries like Tus Js Client, Passport Google OAuth, and model
[Link] Update Channel model

Dotenv are also employed for frontend and backend


Create Channe Mongoos operations. &

Update Channe Bunny (for video services Functions for Middleware and Utilities
Create channel model to
store user login

Create Subscription model

Check Handel if exist suggest ne Passpor Middleware functions ensure proper database connection,
controller
li
const ChannelSchema = new Schema({

name: { type: String, required: true, trim: true },

&
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 },

handle: { type: String, required: true, 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 },

Channel Notification Statu Axio handle generation for channels. model


})

Bcrypt j Copy ink


publi
cs
const ChannelSchema = new Schema({

name: { type: String, required: true, trim: true },


const SubscriptionSchema = new Schema({

ImageKi subscriber: { type: [Link], ref: "Channel", required: true },

Vide route uid: { type: String, sparse: true },

email: { type: String, trim: true },


channel: { type: [Link], ref: "Channel", required: true },

Create and Upload Vide Multe view


.env
handle: { type: String, required: true, trim: true, sparse: true },

})
mode: { type: String, enum: ["silent", "notification"], required: true }

description: { type: String, trim: true },  

Edit/Update Vide Dotenv


const handle = await createUniqueHandle([Link][0].[Link]('@')[0])
logoURL: { type: String, trim: true },

Delete Vide bannerImageURL: { type: String, trim: true },

createdDate: { type: Date, default: [Link] },

Like/Dislike Vide collectionId: { type: String, sparse: true },

subscribers: [{ type: [Link], ref: "Channel" }],

Get Video by criteria { channel, Aayush Chouhan })

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

Tags/Hash Tag video UID controller


and give to bunny webhook
Update values in video db
Get Video/Shorts From Tags/Hash Tag formatNumber {give big no in K and M controller
Receive All info from client (thumbnail, videoId, title, etc.) channelController.j
Set Thumbnail for bunny vide videoControlle.j
generateSignature {generate a signature for channelController.j Create video on bunny and retrieve videoI Update video in D commentControlle.j
Comment BunnyCDN
videoControll
model
Create video in D Update Tags and HashTags model Create Commen
Create Upload url for tusupload Channel.j Reply To Commen
Create Commen createUniqueHandle{create unique handle for Channel.j Video.j Delete Commen
webhook will give

Like/Dislike Comment channel}

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 },

const expirationTime = [Link]([Link]() / 1000) + 3600

title: { type: String, required: true },

const authorizationSignature = crypto

Studio Feature filename: { type: String, required: true },

uid: { type: String, required: true, unique: true },

.createHash("sha256")

const video = await [Link]({ videoId: VideoGuid })

if (video) {

const status = {

0: "Queued",

Get all video/shorts of channe description: { type: String, default: '' },

.update(`${BUNNY_LIBRARY_ID}${BUNNY_API_KEY}${expirationTime}${videoId}`)

.digest("hex")

const commentSchema = new Schema({

video: { type: [Link], ref: 'Video', required: true },

[Link] = status[Status]
1: "Processing...",

likes: [{ type: [Link], ref: "Channel" }],


if (Status === 3) {
2: "Encoding...",

Edit Video {sub use of update Video dislikes: [{ type: [Link], ref: "Channel" }],

const headers = {

const tagSchema = new Schema({


channel: { type: [Link], ref: 'Channel', required: true },

text: { type: String, trim: true, required: true },

const { length, width, height, category } = await getBunnyVideo(VideoGuid)


3: "Finished",

name: { type: String, trim: true, required: true, unique: true },

Video Views/Watch Time {sub use of getVideo}


uploadDate: { type: Date },

privacySettings: {

AuthorizationSignature: authorizationSignature,

videos: [{ type: [Link], ref: "Video" }],

postedDate: { type: Date, default: [Link] },

[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",

})

enum: ['public', 'unlisted', 'private']


})
9: "CaptionsGenerated",

Aayush Chouhan },

[Link]({ uploadUrl: `[Link] headers })


}
10: "Title Or Description
viewsEnabled: { type: Boolean, default: true },
await [Link]()
Generated"

status: { type: String, trim: true, default: 'Uploading' },


[Link](VideoGuid, [Link])
}

channel: { type: [Link], ref: "Channel" }


}
}, { timestamps: true })

Routes

Project Root

Routes

Render home on ‘/’

Render home on ‘/search’


with serchquery

[Link] [Link]("/", checkDBConnection, routes) [Link]

You might also like