Skip to content

VidFlow - An open source content sharing platform (similar to YouTube). This repository contains the backend code.

Notifications You must be signed in to change notification settings

CryptoSingh1337/vidflow-backend

Repository files navigation

VidFlow

An open source content sharing platform (similar to YouTube).

Preview: https://www.youtube.com/watch?v=WJZyM-X8wAo

Frontend repo: https://github.com/CryptoSingh1337/vidflow-client

Issues Closed Issues Open PRs Open Last Commit PRs Welcome wakatime

Features

  • JWT token based user authentication and authorization with refresh token.
  • Used pagination and sorting from server side.
  • Stores videos on Microsoft azure blob storage.
  • User can watch/explore videos without authentication and can upload video with the video metadata like title etc.
  • User can post, edit, delete his/her comment.
  • User can subscribe/unsubscribe to a channel and will receive notifications for videos (if subscribed).
  • User can like/dislike, share a video (copies link to the clipboard).
  • Increase views asynchronously if the user watch that video.

Data model

application-model

Application architecture

vidflow-architecture

Screenshots

Light theme

light-theme

Landing page

landing-page

Landing page after login

landing-page-after-login

Login/Signup page

login/signup

Signup page

signup

Watch video page

watch-video-page

Video footer section

video-footer-section

Upload video page

Upload video

upload-video-page

Add video metadata

image

Channel page

channel-page

History page

history-page

Search page

search-page

Your videos page

your-videos-page

TODO

  • Like/dislike video functionality.
  • Forgot password via email.
  • Notifications functionality using redis as data store.
  • Clear watch history after 21 days using Scheduling Tasks.

Environment variables

Development environment:

AZURE_STORAGE_CONNECTION_STRING
BLOB_CONTAINER_NAME
S3_ACCESS_KEY
S3_SECRET_KEY
CLOUD_FRONT_BASE_URL
AZURE_CDN_BASE_URL

Production environment:

JWT_ACCESS_TOKEN_SECRET
JWT_REFRESH_TOKEN_SECRET
MONGO_URI
AZURE_STORAGE_CONNECTION_STRING
BLOB_CONTAINER_NAME
S3_ACCESS_KEY
S3_SECRET_KEY
CLOUD_FRONT_BASE_URL
AZURE_CDN_BASE_URL

Run Locally

Clone the project

  git clone https://github.com/CryptoSingh1337/vidflow-backend.git

Go to the project directory

  cd vidflow-backend

Run verfiy goal

  ./mvnw clean verify

Run Spring Boot application (default port: 8080 or mentioned in application.properties)

  ./mvnw spring-boot:run

AWS setup

  1. Create a ec2 instance.
  2. Add the following inbound rules in the security group:
Type Protocol Port Source
Custom TCP TCP 27017 0.0.0.0/0
HTTP TCP 80 0.0.0.0/0
HTTPS TCP 443 0.0.0.0/0
  1. Create a target group with the following configuration:
Config Value
Target type Instances
Target group name vidflow
Protocol HTTP
Port 80
Protocol version HTTP1
Health check protocol HTTP
Health check path /index.html
  1. Register target and select the ec2 instance.
  2. Request Certificate in Certificate manager and add the provided record in the advance DNS setting.
  3. Create a load balancer with following configuration:
Config Value
Load balancer type Application
Load balancer name vidflow
Scheme Internet-facing
IP address type IPv4
  1. In Route 53, create a hosted zone with the domain name.
  2. Change the default name server with the aws name server in the domain name provider portal.
  3. Create the following records:
Record name Type Routing Value
[domain-name] A Simple [load-balancer-dns-name]
www.[domain-name] CNAME Simple [domain-name]
  1. Create a bucket with default configuration with the name vidflow.
  2. Create a cloudfront distribution with the following configuration:
Config Value
Origin domain Amazon s3
Enable Origin shield No
Viewer protocol policy Redirect HTTP to HTTPS
Allowed HTTP methods GET, HEAD
Restrict viewer access No

Azure setup

Create a microsoft storage account and copy the connection string.

Tech Stack

  • Client:

    • Typescript
    • Nuxt
    • Vuetify
    • Deployment:
      • Vercel
      • AWS
  • Server:

    • Java
    • Spring Boot
    • Spring Data Mongo
    • Spring Data Redis
    • Spring Security
    • Microsoft Azure Blob Storage
    • AWS Simple Storage Service
    • Deployment:
      • AWS

About

VidFlow - An open source content sharing platform (similar to YouTube). This repository contains the backend code.

Topics

Resources

Stars

Watchers

Forks

Languages