Git Product home page Git Product logo

fampay-project's Introduction

FamTube

About

A project to provide APIs and UI Dashboard to fetch published videos from Youtube Data v3 API

Bonus Feature

  • Support for supplying multiple API keys so that if quota is exhausted on one, it automatically uses the next available key.
  • A dashboard to view the stored videos with filters and sorting options.

Tech Stack

  • UI built on React.js
  • Server built on Node.js
  • Postgres as Database
  • Sequelize as ORM for Database communication
  • Material UI for UI components
  • pgAdmin (Add on)

NOTE: Please put your Youtube Data v3 API Key before running this project in any mode

To build and start the project in production mode with docker

First, replace in docker-compose.yml file with your api key (or list of comma separated api keys)

Run the following cmd from the root of the project dir :

docker-compose up --build -d 

After docker container is up and running, then open: localhost:7000 on your browser. TaDa!

Important: To run the project in any of the below mode (i.e. apart from dockerized), make sure you have a up and running Postgres db

To build and start the project in production mode locally

First, replace in .env file with your api key (or list of comma separated api keys)

Run the following cmd from the root of the project dir :

  1. npm run build then
  2. npm run build:server

To run the project in development mode locally

First, replace in .env file with your api key (or list of comma separated api keys)

Run the following cmd from the root of the project dir :

  1. npm run start

In another terminal, run

  1. npm run dev:server

UI:


More Screenshots present in screenshots dir inside this project

APIs

  • Paginated

  • Filterable on:
    a. title
    b. description

  • Sortable (ASC OR DESC) on:
    a. title
    b. description
    c. thumbnail
    d. pub_datetime

Endpoint:

GET

/api/all?title={TITLE}&description={DESCRIPTION}&orderBy={COLUMN_NAME}&direction={DIRECTION}&page={PAGE_NO}&size={LIMIT}

TITLE : Title String to be searched for
DESCRIPTION : Description String to be searched for
COLUMN_NAME : title | description | thumbnail | pub_datetime

DESCRIPTION : Description String to be searched for
DIRECTION : ASC | DESC (default: DESC)
PAGE_NO : Page no (paginated api, default: 0)
LIMIT : Count per page (paginated api, default: 5)

Sample Request

curl --location --request GET 'localhost:7000/api/all?title=dil&description=moon&orderBy=title&direction=DESC&page=0&size=5' \
--header 'Content-Type: application/json'

Sample Response

{
    "response": {
        "totalItems": 3,
        "videos": [
            {
                "id": "kwhfmFhQ_fc",
                "title": "VOID: Diljit Dosanjh (Official Audio) Intense | Raj Ranjodh | MoonChild Era | Latest Song 2021",
                "description": "Presenting full audio of the song VOID performed by DILJIT DOSANJH from the album MoonChild Era. Watch \"LOVER\" video song: ...",
                "pub_datetime": "2021-08-21T19:43:36.000Z",
                "thumbnail": "https://i.ytimg.com/vi/kwhfmFhQ_fc/default.jpg"
            },
            {
                "id": "bRUvh1me7wQ",
                "title": "HOOPS: Diljit Dosanjh (Official Audio) Intense | Raj Ranjodh | MoonChild Era | Latest Song 2021",
                "description": "Presenting full audio of the song HOOPS performed by DILJIT DOSANJH from the album MoonChild Era. Watch \"LOVER\" video song: ...",
                "pub_datetime": "2021-08-21T20:21:08.000Z",
                "thumbnail": "https://i.ytimg.com/vi/bRUvh1me7wQ/default.jpg"
            },
            {
                "id": "Yyr72jjAIKE",
                "title": "CALI: Diljit Dosanjh (Official Audio) Intense | Raj Ranjodh | MoonChild Era | Latest Song 2021",
                "description": "Presenting full audio of the song CALI performed by DILJIT DOSANJH from the album MoonChild Era. Watch \"LOVER\" video song: ...",
                "pub_datetime": "2021-08-21T20:05:08.000Z",
                "thumbnail": "https://i.ytimg.com/vi/Yyr72jjAIKE/default.jpg"
            }
        ],
        "totalPages": 1,
        "currentPage": 0,
        "limit": 5
    }
}

pgAdmin Portal

You can access the portal at localhost:8080.

Username: [email protected]
Passsword: famtube

To connect you postgres db server in pgAdmin:

  • Enter Host:
    Note: To get the host ip of you postgres container you can use the following cmd: docker inspect postgres | grep IPAddress
  • Port: 5432
  • Username: fp
  • Password: password

fampay-project's People

Contributors

amangupta25 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.