Mr. Pinner's Pinning Lab

This little web app is for uploading and pinning images in IPFS.It uses in the backend for all IPFS operations.

This little web app is for uploading and pinning images in IPFS.
It uses in the backend for all IPFS operations.

I originally wrote it to keep my Flask skills sharp and to integrate the script from the previous post.  I love the way it turned out.  This is the first time that I've used Bulma instead of Bootstrap and am growing quite fond of it. It is a pretty easy CSS framework to use.  I did have to put some JavaScript in unfortunately, as the burger menu and notification delete required it.  

I will probably not move forward with actually hosting a Mr. Pinner Pinning Lab, but the code is ready for a first crack at it.


+ Flask app Setup for expansion
+ Default site pages controlled with Flask Blueprints [app/home folder etc]
+ Authentication built in with Flask-Login [app/auth folder]
+ IPFS Upload and Pinning [app/lab folder]
+ Database controlled by SQLAlchemy [SQLite by default]
+ Monitored with New Relic

From the in the Repo, how to set up the web app and get it running locally with Docker


Clone the repo

GitHub - ephergent/mr_pinners_pinning_lab
Contribute to ephergent/mr_pinners_pinning_lab development by creating an account on GitHub.

Containers need a local .env file [see the example below]

source .env

Currently the DB needs to be initialized via the Python script in app directory.

Create a virtualenv, then source it, then pip install the requirements

cd app
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt

Then run the script to create the default tables

python --create_db

This will create pinning_lab.db

You are now ready to cd .. back to the main folder and run the docker-compose command

Now Built with Docker!

Run Docker compose

docker-compose up --build -d

This will build four containers.

docker ps

CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS          PORTS                    NAMES
9c54a05016d7   nginx:latest                       "/docker-entrypoint.…"   9 seconds ago    Up 6 seconds>80/tcp       mr_pinners_pinning_lab_nginx_1
97ac194ad7e0   mr_pinners_pinning_lab_celery      "celery -A pinning_l…"   13 seconds ago   Up 10 seconds   5000/tcp                 mr_pinners_pinning_lab_celery_1
5121745d8b1b   mr_pinners_pinning_lab_flask_app   "gunicorn --bind 0.0…"   13 seconds ago   Up 9 seconds>5000/tcp   flask_app
53adb4eda3f3   redis:latest                       "docker-entrypoint.s…"   15 seconds ago   Up 12 seconds   6379/tcp                 redis

Once built and running go to http://localhost to signup and login

EXAMPLE local .env file

export DOCKER_BUILD_NUM='latest'
export FLASK_DEBUG=1
export FLASK_ENV=development

# Misc ENV vars
export TOKEN_SALT='token'

# Blockfrost API

# New Relic
# Change out env based on environment
export NEW_RELIC_ENVIRONMENT='development'
export NEW_RELIC_LABELS='Application:MrPinnersPinningLab;Geo:World;Team:DEAFMICE;Environment:development'

Docker tear down and destroy

Stop the containers

docker container stop $(docker container list -q)

Prune the left over chaff

docker system prune -a -f