Skip to content

VuejS webapp that allows search, manage and download torrents. REST API developed with ExpressJS, using a command-line torrent client on Ubuntu server like Transmission.

License

Notifications You must be signed in to change notification settings

daniegarcia254/DownTorrent

Repository files navigation

DownTorrent

DownTorrent is a webapp that simplifies and unifies the process of download a torrent. In the same app you can:

  • Search for a torrent in Rarbg.to
  • Download and manage (delete, pause, resume) the torrent as well as watch the download progress
  • Scan the downloaded torrents with an antivirus if you want to make sure it is free of viruses
  • Upload the torrents to a S3 bucket, and download them anytime you want

Motivation

This project is motived by the need of some relatives to download films, books, etc. from the internet without the difficulty of search for it in the browser (as well to avoid all the advertising these kind of pages produce), know how to add it to a torrent client and use that torrent client. The fact of have it all in the same app, make it easier for them.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. You will need some knowledge about linux administration as well the use of AWS and Docker.

Prerequisites

What do you need to install && run the software.

- Ubuntu/Debian server

You are going to need at least an Ubuntu or Debain machine (you can use your own or one deployed on an AWS EC2 instance for example) for test, develope and deploy the app. Of course you can use any Linux distribution and version you want, but these are the ones where the app has been developed and tested. In your Linux machine, you will need the following programs installed and running.

- Docker

Docker provides a way to run applications securely isolated in a container, packaged with all its dependencies and libraries. You can follow the official tutorial to install it in your system.

You will also need to install Docker-compose.

- AWS S3 bucket

You will need an AWS account in order to configure an S3 bucket where the torrents will be uploaded. This way we will avoid the need of infinite disk space in our system. It is recommend that you create a new user in your AWS IAM with specific permissions to access the S3 bucket, whose keys will be used later in the app configuration.

- Others

  • Transmission is a cross-platform and open source BitTorrent client, designed for easy and powerful use.
  • ClamAV is an open source antivirus engine for detecting trojans, viruses, malware & other malicious threats.

These programs are already installed in the Docker images.

Configuration

Once you have all the pre-requisites ready, the app can be configured in order to get a development or production enviroment running.

Development enviroment

  • development.yml: ports that will be exposed in the docker containers
    • Default server port: 10002
    • Default server port: 10004
    • Default trasmission port: 9090
  • Dockerfile-server.dev: Transmission torrent client port, username and password config
    • Default tranmission port: 9090
    • Default transmission user: trsuer
    • Default transmission user: trpwd

Production enviroment

  • production.yml: ports that will be exposed in the docker containers
    • Default server port: 10003
    • Default server port: 10005 (in this case it will be mapping the container Apache port 80)
    • Default trasmission port: 9090
  • Dockerfile-server.prod: Transmission torrent client port, username and password config
    • Default tranmission port: 9090
    • Default transmission user: trsuer
    • Default transmission user: trpwd

Configuration for both development and production enviroment

  • server/start.config.json: config file that PM2 will use to launch the service
    • APP_PORT: Port where the service will be listening
    • S3_BUCKET: AWS S3 bucket name where the torrents will be uploaded and stored
    • AWS_ACCESS_KEY_ID: AWS Access Key of the user with write access to the S3 bucket
    • AWS_SECRET_ACCESS_KEY: AWS Secret Access Key of the user with write access to the S3 bucket
    • AWS_REGION: AWS Region of the S3 bucket
    • TRANSMISSION_USER: Default user for transmission torrent client
    • TRANSMISSION_PWD: Default password for transmission torrent client
    • TRANSMISSION_HOST: Default host for transmission torrent client
    • TRANSMISSION_PORT: Default port for transmission torrent client
  • client/start.sh: config where the client will communicate with the server
    • DEV_SERVER_PORT: Port where the server will be available (default value: 10002)
    • DEV_URL_CORDOVA: URL for the server when the app is running with cordova
    • PROD_SERVER_PORT: Port where the server will be available (default value: 10002)
    • PROD_URL_CORDOVA: URL for the server when the app is running with cordova

The Transmission torrent client values must mutch those specified in the corresponding Dockerfile-server as well as the server service port.

Deployment

Development enviroment

In order to get running a development enviroment, you just need to execute:

docker-compose -f development.yml up --build

A docker container will be running and every change that you make in the client or server folder will be automatically applied, so you can programme in a hot reload development enviroment.

Production enviroment

In order to get running a prouction enviroment, you just need to execute:

docker-compose -f production.yml up --build

Production scripts

You can make use of various scripts that can be applied to the production running containers. Following a sort description of each script functionality:

  • adduser.sh: it adds a new user to the app, so it can be logged in.
  • removeuser.sh: removes an user from the app, so it can't login again.
  • restart_service.sh: force a restart of server
  • create_apk.sh: creates an unsigned Android APK file to download and install in your mobile device. The file will be available in the Apache server (with the configured port) as "DownTorrent.apk"

Testing

Testing is implemented for the server using Mocha, Chai && Sinon.

Run the tests:

cd server
npm test

Testing coverage can be generated using Istanbul:

cd server
npm run coverage

Roadmap

Some features to implement for improve the app in a near future. Feel free to contribute to the project in order to complete them:

  • Create a Dockerfile to deploy the app in a simpler way and get it running instantly
  • Add real Authentication to the system, no using one based on the Ubuntu system users. Using a database and JSON Web Tokens for example.
  • Review and improve the mobile version. For example: data tables are not loading information properly.
  • Automatically upload the downloaded torrents to the S3 bucket. It can be done with Transmission.
  • As only one instance of the bittorent client is running in the machine, all users can see all downloads. So, it would be ideal if each user only could see and manage its own torrents.
  • Testing

Built With

- Backend

  • PM2 - The Node.js process manager to run and monitor the server
  • ExpressJS - The Node.js framework used for the server
  • Socket.IO - JavaScript library for realtime web applications. It enables realtime, bi-directional communication between the web clients and the server.

- Frontend

  • Quasar Framework - The web framework used for the webapp
  • VueJS - A progressive framework for building user interfaces in which Quasar Framework is based
    • Vue-router - The official router for Vue.js
    • Vuex - Vuex is a state management pattern + library for Vue.js applications.
    • Vue-Socket.io - socket.io implemantation for vuejs
    • Vue-i18n - Internationalization plugin for Vue.js
    • And more VueJS plugins and libraries...
  • Axios - Promise based HTTP client for the browser and node.js

Authors

  • Daniel García - Software developer - Github

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

VuejS webapp that allows search, manage and download torrents. REST API developed with ExpressJS, using a command-line torrent client on Ubuntu server like Transmission.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published