Rewrite of the MirrorManager application in Flask and SQLAlchemy