https://github.com/cryptosingh1337/vidflow-backend
VidFlow - An open source content sharing platform (similar to YouTube). This repository contains the backend code.
https://github.com/cryptosingh1337/vidflow-backend
aws azure jwt mongodb mysql redis spring-boot spring-security
Last synced: about 1 year ago
JSON representation
VidFlow - An open source content sharing platform (similar to YouTube). This repository contains the backend code.
- Host: GitHub
- URL: https://github.com/cryptosingh1337/vidflow-backend
- Owner: CryptoSingh1337
- Created: 2021-09-20T10:33:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-13T19:15:11.000Z (about 3 years ago)
- Last Synced: 2025-05-08T00:02:30.138Z (about 1 year ago)
- Topics: aws, azure, jwt, mongodb, mysql, redis, spring-boot, spring-security
- Language: Java
- Homepage:
- Size: 351 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README

# VidFlow
An open source content sharing platform (similar to YouTube).
Preview: [https://www.youtube.com/watch?v=WJZyM-X8wAo](https://www.youtube.com/watch?v=WJZyM-X8wAo)
Frontend repo: [https://github.com/CryptoSingh1337/vidflow-client](https://github.com/CryptoSingh1337/vidflow-client)
[](https://github.com/CryptoSingh1337/vidflow-backend/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/CryptoSingh1337/vidflow-backend/issues)
[](https://github.com/CryptoSingh1337/vidflow-backend/pulls)


[](https://wakatime.com/badge/github/CryptoSingh1337/vidflow-backend)
## 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 architecture

## Screenshots
#### Light theme

#### Landing page

#### Landing page after login

#### Login/Signup page

#### Signup page

#### Watch video page

#### Video footer section

#### Upload video page
##### Upload video

##### Add video metadata

#### Channel page

#### History page

#### Search page

#### Your videos page

## TODO
- [x] 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:
```bash
AZURE_STORAGE_CONNECTION_STRING
BLOB_CONTAINER_NAME
S3_ACCESS_KEY
S3_SECRET_KEY
CLOUD_FRONT_BASE_URL
AZURE_CDN_BASE_URL
```
Production environment:
```bash
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
```bash
git clone https://github.com/CryptoSingh1337/vidflow-backend.git
```
Go to the project directory
```bash
cd vidflow-backend
```
Run verfiy goal
```bash
./mvnw clean verify
```
Run Spring Boot application (default port: 8080 or mentioned in `application.properties`)
```bash
./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 |
3. 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 |
4. Register target and select the ec2 instance.
5. Request Certificate in Certificate manager and add the provided record in the advance DNS setting.
6. Create a load balancer with following configuration:
| Config | Value |
|--------------------|------------------|
| Load balancer type | Application |
| Load balancer name | vidflow |
| Scheme | Internet-facing |
| IP address type | IPv4 |
7. In Route 53, create a hosted zone with the domain name.
8. Change the default name server with the aws name server in the domain name provider portal.
9. Create the following records:
| Record name | Type | Routing | Value |
|-------------------|:------:|---------|--------------------------|
| [domain-name] | A | Simple | [load-balancer-dns-name] |
| www.[domain-name] | CNAME | Simple | [domain-name] |
10. Create a bucket with default configuration with the name `vidflow`.
11. 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