YT-PROXY [We are a backup for youtube's news videos] hosted here🐁
Checkout hosted server here 🎯
- react ui here
- swagger docs here
- django admin here
- username:
admin
- password:
admin
- username:
- Server calls the YouTube API continuously in background (async) with interval of 10 seconds for fetching the latest videos for a predefined search query.
- A GET API which returns the stored video data in a paginated response sorted in descending order of published datetime.
- 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 filtering and sorting options.
- 9 Unit tests are added for the backend at
ytcore.tests
.
- Clone repository
cd backend
- create
.env
file with
HOSTED_RABBITMQ=<uri-of-rabbitmq>
GGL_API_KEY=<youtube-data-api-key>
SECRET_KEY=<fernet-key checkout https://cryptography.io/en/latest/>
DJANGO_SECRET=<choice-of-django-secret-key>
- Open two terminals
- In terminal 1:
source provision.sh
. This will:- create a virtual env
- install requirements
- run migrations
- fill datbase with sample data
- create an admin user
- start server at http://localhost:5557/
- In terminal 2:
source start-celery.sh
. This will run celery and every 10 seconds fetch youtube data. The task can be located atytcore.tasks.fetch_from_yt
. The celery config is present atserver.celery
. - To run the test suite
python manage.py test
cd frontend
npm install
npm start
- django - web server framework
- drf - facilitates REST API development in django
- celery - to perform async tasks with rabbitmq🐇 as the broker
- cryptography - to crypt sensitive information
- django-celery-beat - to schedule periodic tasks leveraging celery with django admin GUI
- drf-yasg - to create swagger docs [
http://<base-url>/docs/
] - python-decouple - to hide sensitive info in .env file
- django-cors-headers - to enable CORS access to other application
- react.js - choice of web framework [
http://<base-url>/
] - bootstrap 4 - choice of UI library