Setting Up

  1. Clone the project

git clone https://github.com/IamRash-7/fampay-assignment.git

  1. Activate Virtual Environment
cd fampay-assignment

pip3 install virtualenv

virtualenv my_env

source my_env/bin/activate
  1. Create .env file (All these variables are required)
API_KEYS_STRING=KEY1,KEY2
MONGO_URI=mongodb://{HOST}:{PORT}/
REDIS_URI=redis://{HOST}:{PORT}/0
DATABASE_NAME=DATABASE_NAME
COLLECTION_NAME=COLLECTION_NAME
  1. Install Requirements

pip3 install -r requirements.txt

RUN in DOCKER

  1. docker-compose build
  2. docker-compose up

To Stop

docker-compose down

RUN LOCALLY

NOTE: Change .env file accordingly

  1. python3 app.py
  2. redis-server --port 6379
  3. celery -A src.tasks worker --loglevel=info - Worker
  4. celery -A src.tasks beat --loglevel=info - Scheduler

API ENDPOINTS

NOTE: My Youtube query = football

Test Connection

Get paginated Vidoes

Search Videos

Tech Stack

  • Python
  • Flask
  • MongoDB
  • Celery
  • Redis
  • PyMongo
  • Docker

Workflow

alt text