Additional project for Advanced Programming course on EITI (WUT). Simple web application for coding and decoding text using LZW (Lempel-Ziv-Welch) algorithm.
Architecture is based on:
- C++, boost.python - calculations,
- Django (Python) - server controller,
- AngularJS + HTML5 - client controller and interface.
Author: Adam Napieralski
View in: [Polish](README.pl.md)
Packages and technologies used:
- g++
- scons
- boost (Boost.Python, Boost.Test)
- python3 / python2
- nodejs >=v10.15
- django >=v1.11
- angularjs >=v1.7
To install all of needed packages, use bash script:
./install.sh
Default version of python for which some packages are installed is 3.x, however, you can change it to python2 with e.g.:
./install.sh python=2.6
You can also manually install all prerequisites following the steps:
sudo apt update && sudo apt upgrade
sudo apt install g++ scons nodejs npm libboost-dev libboost-all-dev
- (for Python3)
sudo apt install python3-dev python3-pip
andsudo pip3 install -r pip_requirements.txt
- (for Python2)
sudo apt install python-dev python-pip
andsudo pip install -r pip_requirements.txt
cd client
npm install
- Install Microsoft Visual Studio.
- Install preferred Python (e.g. Python3.6) in the default path (C:\Python36), add it to the PATH.
- Install pip / pip3 - download get-pip.py then run
python get-pip.py
. pip install --egg scons
pip install -r pip_requirements.txt
- Download and install boost in C:\Boost.
- Install nodejs.
- In
client/
install js node modules withnpm install
.
To build and compile application, use:
scons
The default python version is 3.7. To build with one of other supported versions [2.6, 2.7, 3.6, 3.7, 3.8], set argument:
scons python=2.6
After once defined, it will be stored and used in further scons run, so there will be no need to define it again.
To run unit tests (together with building), use:
scons --test
To run django server on predefined address (127.0.0.1:8000), use:
scons --run
or manually run: python ./build_web/manage.py runserver [ip]:[port]
or python3 ./build_web/manage.py runserver [ip]:[port]
Open your browser and go to defined address, like: http://127.0.0.1:8000/. In the left text area you can type the text to code or code to decode - depending on type set with a switch. You can also define number of bits available to use in code. Run algorithm with RUN button. The reached Compression Rate will be displayed in the middle.