alpha-coder13 / FamTask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Youtube Video Fetcher

App's Aim :

To fetch latest sorted videos in reverse chronological order of their publishing dates from youtube for a given query (music) and return the result in a paginated format.

Tasks performed by the app :

  1. Calls the YouTube api continously in background in intervals of two minutes to fetch the latest videos for some predefined search query (currently set to music).
  2. Provides a GET api endpoint to show the stored video data in a paginated response sorted in descending order of published datetime.
  3. Provides a Search api endpoint to search the videos from the database usinging their title and description.
  4. Provides a very Basic dashboard to interact with the stored data using the endpoints implemented as a search bar also has a button that redirects to the youtube link of the thumbnail video.
  5. Provides a mediocre level Optimized search, that is able to query and provide the video even if the search words are jumbled.

Firing up the App

Downloading Docker :

Download docker from the official docker site . The following guidelines are for the Linux OS ( Ubuntu 22.04 LTS Jammy Jellyfish).

Prerequsite to install Docker :

  1. Uninstall the tech preview or beta version of Docker Desktop for Linux. Run:

$ sudo apt remove docker-desktop

  1. For a complete cleanup, remove configuration and data files at $HOME/.docker/desktop, the symlink at /usr/local/bin/com.docker.cli, and purge the remaining systemd service files.

$ rm -r $HOME/.docker/desktop
$ sudo rm /usr/local/bin/com.docker.cli
$ sudo apt purge docker-desktop

  • Additionally, for non-Gnome Desktop environments, gnome-terminal must be installed:

$ sudo apt install gnome-terminal

Installing Docker :

Setting up the repository :

  1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install \
   ca-certificates \
   curl \
   gnupg \
   lsb-release

  1. Add Docker's official GPG key :

$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

  1. Use the following command to set up the repository:

$ echo \
 "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
 $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Installing Docker Engine:

  • Update the apt package index, and install the latest version of Docker Engine, containerd, and Docker Compose, or go to the next step to install a specific version:

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli container.io docker-compose- plugin

Troubleshooting the installation:

Please refer official Docker Docs for detailed procedure and erors faced during the installing and also checkout other methods of installing docker.

Using the App :

  1. Clone the repository into your desktop
  2. Change the directory path to the source folder
  3. Write $ sudo docker compose up in the terminal to execute the docker - image.
  4. Open any javascript enabled web browser type in the location bar http://localhost:5000/
  5. Close the docker compose terminal by pressing ctrl+c.

App snapshots :


Website homepage.

Search Page (search by title).

Search Page (search by description).

JSON response from the backend server (video listing).

JSON response Search Page (search by title).

Common problem avoidance :

Make sure that no other apps or servers are occupying the posrt namely:

- 8000 ( Project's backend runs on this port ).
- 5000 ( The website is hosted on this port ).
- 5432 ( the postgresql database runs on htis port . Important : close any pgSQL instances running on the system ).
  • While searching for specific filter in search bar make sure to not leave any trailing spaces as they are not handled currently



App Stack :

Frontend :

  • HTML (Hyper Text Markup Language)
  • Javascript
  • CSS (Cascading Styling Sheets)

Backend :

  • Node JS . Node JS libraries that are used are : -
    • ExpressJS
    • CORS
    • PG ( for accessing pgSQL from NodeJS )
    • PG - FORMAT ( for formatting pgSQL queries )

Database :

  • PostgreSQL

updating ......

Made with ❤️ by Amardeep Saha (alpha-coder13)

About

License:MIT License


Languages

Language:JavaScript 88.5%Language:HTML 6.2%Language:CSS 3.5%Language:Dockerfile 1.8%