A video repository management system powered by Spark and Elasticsearch.
- Clone this repository:
$ git clone https://github.com/imlegend19/VidSpark.git
- Create a virtual environment:
$ python3 -m venv venv $ source venv/bin/activate
- Install the requirements:
$ pip install -r requirements.txt
- Download & setup elasticsearch:
https://www.elastic.co/downloads/elasticsearch
- Download & setup Apache Spark:
https://spark.apache.org/downloads.html
- Create elasticsearch alias:
$ nano ~/.bashrc
- Paste
alias elasticsearch='$ES_HOME/bin/elasticsearch'
at the end - Run
$ source ~/.bashrc
- Start elasticsearch in Terminal 1:
$ elasticsearch
- Setup Redis:
- Download:
$ wget http://download.redis.io/redis-stable.tar.gz
- Extract:
$ tar xvzf redis-stable.tar.gz
$ cd redis-stable
$ make
- Download:
- Start Redis Server:
$ redis-server
- Check if redis is working:
$ redis-cli ping PONG
$ cd VidSpark
- Start celery in Terminal 2:
$ celery -A VidSpark worker --loglevel=info
- (Optional) Start flower in Terminal 3:
$ celery -A VidSpark flower
- Go to
http://localhost:5555/
to view the background tasks status.
- Go to
- Run migrations:
$ python manage.py makemigrations
$ python manage.py migrate
- Create a superuser:
$ python manage.py createsuperuser
- The superuser is not active by default! Open
drf_user_user
table and setactive=1
for the newly created user.
- Bingo! The setup is now complete.
Start the Django Server: $ python manage.py runserver
Admin Panel: http://localhost:8000
API Documentation: http://localhost:8000/swagger
Note: Some API's need authorization. Send a
POST
request tohttp://localhost:8000/api/token/
. Also, note that only user's registered to the system can get the token.