Code Monkey home page Code Monkey logo

personal-yt-api's Introduction

Personal YT API

Functionalities

  • Asynchronously fetch data (videos) using YouTube API after every 5 minutes and store the data in the database. The search query used to fetch data is tech).

  • GET API (/api/videos/) to retrieve paginated response (videos) from the local database.

  • SEARCH API (/api/videos/search/?search=<search_query>) to retrieve paginated response (videos) based on the search query on video title and description. The Search API also supports fuzzy matching/partial matching on video title and description.

  • Support for multiple API keys.

  • Dedicated dashboard for accessing and searching the videos (using the APIs created, called using AJAX). Accessible at http://localhost:8000.

    image

  • Paginated search results on the dashboard.

Setting-up the project

  • Download and install Python 3.8
  • Download and install Git.
  • Clone the repository to your local machine $ git clone https://github.com/garg3133/personal-yt-api.git
  • Change directory $ cd personal-yt-api
  • Install virtualenv $ pip install virtualenv
  • Create a virtual environment $ virtualenv env -p python3.8
  • Activate the env: $ source env/bin/activate (for linux) > ./env/Scripts/activate (for Windows PowerShell)
  • Install the requirements: $ pip install -r requirements.txt
  • Create a new file in the root directory of the repository with name .env and add the following content in it:
    YOUTUBE_DATA_API_KEYS = 'yt-api-key1,yt-api-key2,...'
    
  • Make migrations $ python manage.py makemigrations
  • Migrate the changes to the database $ python manage.py migrate
  • Create admin $ python manage.py createsuperuser
  • Run the server $ python manage.py runserver
  • Install and start Redis on your PC.
  • Run celery worker $ celery -A personal_yt_api worker --pool=solo -l INFO
  • Run celery beat (task scheduler) $ celery -A personal_yt_api beat -l INFO

Setting-up the project in docker

  • Clone the repository to your local machine $ git clone https://github.com/garg3133/personal-yt-api.git
  • Change directory $ cd personal-yt-api
  • Create a new file in the root directory of the repository with name .env and add the following content in it:
    YOUTUBE_DATA_API_KEYS = 'yt-api-key1,yt-api-key2,...'
    
  • Run migrations docker-compose run web python manage.py migrate
  • Build the docker image docker-compose build
  • Run the docker image docker-compose up
  • The server will start at default port (8000), head over to your web browser to test at http://localhost:8000.

personal-yt-api's People

Contributors

garg3133 avatar

Stargazers

Mazhar Ali Baig avatar

Watchers

James Cloos avatar  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.