This is a full-stack app developed using Django Rest Framework, Celery, PostgreSQL, RabbitMQ and Vue.js in a master/slave configuration all dockerized.
First select the problem you want to solve and then input as follows:
-
Integrate: a JSON list with the coefficients of the single variable polynomial to integrate (from low to higher order).
For example: [1, 6, 0, 5] is the polynomial 1 + 6x + 5x**3
Returns a string representation of the integration result.
-
Prime factoring: int number
Returns a dict where keys are the prime factors and its value the exponent.
This contains the frontend app, the REST API, PostgreSQL database and the RabbitMQ broker. First you must build the frontend app image:
- cd into frontend_tasks directory
docker build . -t tasks_frontend
Then build up the whole master solution:
- cd into the root directory (tasks_project)
docker-compose run web python /code/manage.py migrate
docker-compose up
.
This is the Celery worker that executes the tasks and sends back the result to the result backend (RabbitMQ).
Set the IP address and exposed RabbitMQ port from the master server on tasks_slave.py
for the broker and backend.
If settings are left as default the exposed port on the master server should be 5673. Otherwise change the docker-compose port bindings.
Then:
- cd into slave_worker directory.
docker build . -t slave_worker
docker run slave_worker celery worker -l info -A tasks_slave
- Unit tests for REST API and Celery worker tasks
- SSL activation for RabbitMQ
- Random problem type/argument generation on frontend