Skip to content

AlexNguyenz/youtube-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube-sharing

Youtube-sharing is a web application that allows users to share videos from YouTube

Visit https://youtube-sharing.vercel.app/

Features

  • Register - Log in
  • Share videos from YouTube
  • Notification when someone shares a video (When user logged)

Technologies:

Installation

Youtube-sharing requires Node.js v14.20.1+ to run.

Clone repository

git clone https://github.com/AlexNguyenz/youtube-sharing.git

Manual

Install the dependencies and devDependencies and start the server.

Create an atlas account

Install mongoDB compass

Change network access on mongo atlas change network access

Select option connect compass select option connect compass

Copy URI copy uri

Paste URI into mongoDB compass connect db

cd youtube-sharing-be

Create file .env

API_KEY_YOUTUBE=
MONGO_URI=
URL_FE=http://localhost:3000
JWT_SECRET_KEY=
NODE_ENV=development
PORT=8080
Key Value
API_KEY_YOUTUBE create api key youtube
MONGO_URI paste URI from mongo atlas
URL_FE client url on local
JWT_SECRET_KEY random string
NODE_ENV mode env
PORT server port on local

Create init data

npm run seeding

Start server

npm run install
npm run dev

Install the dependencies and devDependencies and start the client.

cd youtube-sharing-fe

Create file .env

BASE_URL_LOCALHOST=http://localhost:8080
MODE=development
Key Value
BASE_URL_LOCALHOST url server on local
MODE mode env
npm run install
npm run dev

Visit: localhost:3000

Docker

Your system needs to have Docker and Docker Composed installed.

Start the whole system including MongoDB, backend, frontend servers and Mongo Compass:

docker-compose up -d

To load initial data to mongodb:

docker-compose exec server node src/seedData.js

In order to view db visit: http://localhost:28081/

username: admin

password: secret

cd youtube-sharing-be

Create file .env

API_KEY_YOUTUBE=
MONGO_URI=mongodb://user:password@youtube-sharing-mongodb/youtube?authSource=admin&authMechanism=SCRAM-SHA-1
URL_FE=http://localhost:3000
JWT_SECRET_KEY=
NODE_ENV=development
PORT=8080
Key Value
API_KEY_YOUTUBE create api key youtube
MONGO_URI keep value
URL_FE client url on local
JWT_SECRET_KEY random string
NODE_ENV mode env
PORT server port on local

Visit: localhost:3000

Usage

  • When you access the website, you will see a list of videos that others have shared before
  • You need to log in, or register (if you don't have an account yet) to receive notifications and be able to share the videos you want with everyone

Note:

  • You can only receive notifications and share videos after logging in to the website
  • When you log out and log back in, the previous notifications will still be retained
  • Notifications are sent only and not stored in the database, so when you refresh the page or log in from a different location, the old notifications will no longer be available

Troubleshooting

Sometimes when you first access the app, it may take 5-10 minutes for the server to start up. After that, please reload to use it normally.

The error occurs because: Within a certain period, if no requests are made, the server will automatically shut down. Then, when a request comes in, it takes about 5-10 minutes to start up. Because I am using a free web service, downtime may occur. I apologize for any inconvenience this may cause.

License

MIT

About

Website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors