Automated Download Queue for Enterprise to take the best use of Internet bandwidth
Bassa solves the problem of wasting internet bandwidth by queuing a download if it is larger than a given threshold value in high traffic and when the traffic is low, it completes the download of the files. After the files are downloaded, the users can get their files from the local servers which do not require external internet bandwidth.
- Provides an interface for users to add their downloads as links or torrent magnet links
- Provide users with an interface to view and download the files in the local server
- Provide a rating system for users to rate the files residing in local server
- Automatically start and stop downloading in given time frame
- Automatically clean the disks and make room for new downloads
- Notify the users when his/her download is completed
- Mark inappropriate downloads
- Provides admins with an interface to deal with inappropriate files
Bassa is a multi-tier application which can serve users through dedicated Web, Android and iOS clients.
Components
- Bassa API server is implemented as a flask-socketio server written in Python.
- Bassa web client is implemented using Angular written in JavaScript. (Moving to create-react-app very soon)
- Bassa Android and iOS mobile clients are implemented using react native written in JavaScript.
- Bassa uses MySQL 5.X as database server.
- Bassa uses Aria2c RPC server to download files.
- Bassa can be used with Minio file storage server as a file system and also for storing files to Amazon S3 cloud storage.
In order to setup Bassa using docker, install the latest version of docker with docker-compose tool on your machine. Clone the Bassa GitHub repository. Run the below command to move into the root folder.
cd Bassa
We will be using docker-compose tool to build images and finally spin up all our containers and then we can start using Bassa. docker-compose configuration file has configuration for each container and you are free to modify it. You can run the below command.
For development:
docker-compose up -f docker-compose.dev.yml --build
You can access the Bassa Web Client at port 3000 served by Gulp.
For production:
docker-compose up --build
You can access the Bassa Web Client at port 80 served by Nginx.
You can run a specific container using docker-compose tool. You can do that using the service names.
Service | Service Name |
---|---|
API server | api |
Web client | web |
Database server | db |
Aria2c | aria2c |
Usage
docker-compose build [SERVICE NAME]
docker-compose run [SERVICE NAME]
In order to to setup Bassa from the source code, you need a machine with either Linux, MacOS or Windows operating system.
First clone and move to the project repository
git clone https://github.com/scorelab/Bassa.git && cd Bassa
Install Bassa dependencies.
sudo ./setup.sh
Open a new terminal window, move to downloads folder and start Aria2c server.
cd downloads/
aria2c --enable-rpc --rpc-listen-all
Start the MySQL service on your machine and open the MySQL terminal to type the command for creating the Bassa Database.
create database Bassa;
Exit from MySQL terminal and insert the Bassa database schema in to the created database.
cd db_schema/
mysql -u root -p Bassa < Bassa.sql
Configure the Bassa database credentials in components/core/DBCon.py database connector file.
If the environment variables are being used, modify as following :
_db=MySQLdb.connect("db", os.environ.get('YOUR_DB_USERNAME'), os.environ.get('YOUR_DB_PASSWORD'), os.environ.get('Bassa'))
If the environment variables are not configured and hardcoded strings are being used, replace as :
_db=MySQLdb.connect(host="localhost", user="YOUR_DB_USERNAME", passwd="YOUR_DB_PASSWORD",db= "Bassa")
Change directory to API code base and install python modules
cd components/core/
sudo python3 setup.py develop
Start Bassa API server
sudo python3 Main.py
Open a new terminal window, move to UI code base and install node modules.
cd ui/
sudo npm install
sudo npm install --global bower gulp-cli
Start the Bassa Web Client
gulp serve
You can access the Bassa Web Client at port 3000.
First clone and move to the project repository
git clone https://github.com/scorelab/Bassa.git && cd Bassa
Install Bassa dependencies.
sudo ./setup.sh
Open a new terminal window, move to downloads folder and start Aria2c server.
cd downloads/
aria2c --enable-rpc --rpc-listen-all
Start the MySQL service on your machine and open the MySQL terminal to type the command for creating the Bassa Database.
create database Bassa;
Exit from MySQL terminal and insert the Bassa database schema in to the created database.
cd db_schema/
mysql -u root -p Bassa < Bassa.sql
Configure the Bassa database credentials in components/core/DBCon.py database connector file.
If the environment variables are being used, modify as following :
_db=MySQLdb.connect("db", os.environ.get('YOUR_DB_USERNAME'), os.environ.get('YOUR_DB_PASSWORD'), os.environ.get('Bassa'))
If the environment variables are not configured and hardcoded strings are being used, replace as :
_db=MySQLdb.connect(host="localhost", user="YOUR_DB_USERNAME", passwd="YOUR_DB_PASSWORD",db= "Bassa")
Change directory to API code base and install python modules
cd components/core/
sudo python3 setup.py develop
Start Bassa API server
sudo python3 Main.py
Open a new terminal window, move to UI code base and install node modules.
cd ui/
sudo npm install
sudo npm install --global bower gulp-cli
Start the Bassa Web Client
gulp serve
You can access the Bassa Web Client at port 3000.
First clone and move to the project repository
git clone https://github.com/scorelab/Bassa.git && cd Bassa
Install latest python3 on your machine.
Install latest version of Aria2 and add the executable to the PATH variable.
Install the MySQl Server and make sure to check MySQL component and C connectors during installation.
Install Node on your windows machine.\
Open a new CMD window, move to downloads folder and start Aria2c server.
cd downloads/
aria2c --enable-rpc --rpc-listen-all
Open the MySQL command line client to type the command for creating the Bassa Database.
create database Bassa;
Exit from MySQL client and insert the Bassa database schema in to the created database.
cd db_schema/
mysql -u root -p Bassa < Bassa.sql
Configure the Bassa database credentials in components/core/DBCon.py database connector file.
If the environment variables are being used, modify as following :
_db=MySQLdb.connect("db", os.environ.get('YOUR_DB_USERNAME'), os.environ.get('YOUR_DB_PASSWORD'), os.environ.get('Bassa'))
If the environment variables are not configured and hardcoded strings are being used, replace as :
_db=MySQLdb.connect(host="localhost", user="YOUR_DB_USERNAME", passwd="YOUR_DB_PASSWORD",db= "Bassa")
Change directory to API code base and install python modules
cd components/core/
sudo python setup.py develop
Start Bassa API server
sudo python Main.py
Open a new terminal window, move to UI code base and install node modules.
cd ui/
sudo npm install
sudo npm install --global bower gulp-cli
Start the Bassa Web Client
gulp serve
You can access the Bassa Web Client at port 3000.
Please use the mock-up username and password to try and develop Bassa.
Key | Value |
---|---|
user_name | rand |
password | pass |
You can even refer to a Video tutorial on how to use Bassa, available on Youtube
Once developed, Bassa will save internet bandwidth by downloading files when the traffic is low. In the current build, you can log in either as a user or as an admin and add links for files to download. The admin can start the downloads as and when he/she likes or when he/she feels that the traffic on the network is low. After the download, the users can get their files from local servers which does not need internet bandwidth.
- If you’re a new user, you need to sign up first and can only login after the admin has approved your account.
- Only an admin account can access the “Admin” tab in Bassa
- In the admin tab, you have three available processes-
a) Start/Kill downloads- You can start the downloads queued at the time of your liking
b) Sign up Requests- As an admin, you need to approve the accounts of all the new users before they can start using Bassa
c) Usage of top heaviest users- You get access to a graph that shows the usage percentage of the heaviest users
- Once logged in, navigate to the dashboard section. You can add a link to a file or a magnet link in the text field labeled “Add download*”. You can then see the link added under the “Ongoing downloads tab”
- After the admin has approved the download, your file begins to download. It gets saved on the local servers from which you can get your files without the use of external bandwidth
- In the “Completed” section, you can view all the details of downloads that Bassa has completed till now
Bassa is an essential tool for managing downloads and to make the best use of Internet Bandwidth. It is also compatible with Amazon cloud storage.
- Make sure the python server is working and you have an open connection to the database.
- Open the python console in your terminal by running the command
python3
. - In the console that opens, import the test files, like so:
from tests.Bassa_endpoint_test import *
from tests.login_test import *
cd ui
npm test OR yarn test
Incase if you are stuck up with any issues during the setup or usage, look in to the troubleshooting list for help or file a new issue on the project repository.
Feel free to discuss on our Bassa gitter channel. You can also discuss about other projects on SCoRe Lab gitter channel.
Please go through the developer guides in Bassa wiki
This project exists thanks to all the people who contribute.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]