This project is a compressor/decompressor system made with two microservices, a frontend and a reverse proxy. The compression/decompression system uses Huffman algorithm and it is written in C programing language. As the main project lanaguage is Go, was used CGO to make possible go code call the C API. For file storage this project uses pCloud and a link of the pushed file is send by email to the client.
The reverse proxy was made using NGINX server on Docker. It is placed at src/apps/reverseproxy with the .conf file and Dockerfile.
The frontend is a golang server that serves HTML using templates. It is placed at src/apps/frontend with it source file, Dockerfile and tests.
The backend nowadyas is made by two microservices, one to handle frontend requests called inputhandler, and other service worker to compress and decompress files called compressor.
It is placed at src/apps/reverseproxy. It provides a REST API used by the frontend to make compression or decompression for given files. It get the requests from frontend, process the request payload and sends to compressor service by publishing a message into a queue topic using Redis.
It is placed at src/apps/compressor. It reads messages from a queue on a Redis in order to process files given commands: compress or decompress.
First of all, clone this repo:
$ git clone https://github.com/ABuarque/simple-compression-service.git # using HTTPS
Go to the cloned directory and create a .env file on the root filling these values:
[email protected]
PASSWORD=yourpassword
[email protected]
PCLOUD_PASSWORD=yourpcloudpassword
Put all containers up:
$ docker-compose up -d
If everything is ok, all containers should be up:
Open up any brower and go to http://localhost:8080/home and enjoy!
If you get email authentication issue, with Gmail for example, it might be happen due to the "allow less security apps" option is disable for your account.
- This project came from the ideia to make something out of my data structure project for college;
- Feel free to improve and contribuite to this project sending PRs;