This app gives you ability to create different images of fractals.
What is a fractal? It is a picture produced my mathematical expression which have recursive nature with unlimited zooming capabilities.
As image generation controlled by expression, changing the expression even in the slighest manner will result in a sometimes complete different image.
See Wikipedia page for more introduction.
This example is a Julia set generated with base complex number c = -0.37 + 0.6*i
Julia set is a subset of well-known Mandelbrot set.
This app requires MongoDB instance available (running in the docker or in the cloud) by setting MONGO_URI environment variable:
MONGO_URI=mongodb://localhost/test
You need to have Python 3.7 installed.
pip install pipenv
pipenv install
MONGO_URI=mongodb://localhost/test FLASK_SECRET_KEY=123 GITHUB_OAUTH_CLIENT_ID= GITHUB_OAUTH_CLIENT_SECRET= CACHE_BUCKET= pipenv run python -m app
Your app will be available at http://localhost:8080
This project uses chamber CLI, AWS, MongoDB Atlas and Serverless framework to deploy to the cloud. This result in a highly available, cost-effective, secure and environment to host and serve hobby projects.
Create MongoDB instance using cloud service (for example MongoDB atlas).
You will get URL in the form of:
mongodb+srv://username:[email protected]/db
The way this app uses AWS services, hosting this app will cost you 0.1$ monthly or less, depending on the traffic. Make sure you are protecting your AWS account as the malicious actions of other parties or mistakes can result in a large bill. Read more here about getting started in AWS.
To run successfully full fledged version of the app, number of parameters needs to be set using AWS Parameter Store as /veresk/NAME_OF_VARIABLE
key. Encrypt using default key (do not use custom KMS key).
- MONGO_URI - URL to previously configured MongoDB instance
- FLASK_SECRET_KEY - Private key for your Flask app
- GITHUB_OAUTH_CLIENT_ID - Credentials for GitHub login (create app in Developer settings)
- GITHUB_OAUTH_CLIENT_SECRET - Credentials for GitHub login
- CACHE_BUCKET - Create and give access to S3 bucket to store image cache
You need to have NodeJS 11+, python 3.7+, pipenv and NPM installed.
npm install
pip install pipenv
pipenv install
pipenv run deploy
- See LICENSE.md, with the exception of:
app/plot.py
,def julia
: (C) Tom Roelandts, https://tomroelandts.com/articles/how-to-compute-colorful-fractals-using-numpy-and-matplotlibapp/static/icon.svg
: fractal by Bohdan Burmich from the Noun Project (see https://thenounproject.com/term/fractal/224056/)
- https://flask.palletsprojects.com/en/1.1.x/tutorial/layout/
- https://numpy.org/doc/stable/user/quickstart.html
- https://stackoverflow.com/questions/50728328/python-how-to-show-matplotlib-in-flask
- https://github.com/lovasoa/mandelbrot
- https://tomroelandts.com/articles/how-to-compute-colorful-fractals-using-numpy-and-matplotlib
- https://www.researchgate.net/publication/242295595_Visualising_Infinity_on_a_Mobile_Device#pf2
- https://en.wikipedia.org/wiki/Julia_set