inside bar, look carefully at app.py.
the trick is the routes.py file's def init_routes(app): function.
This structure avoids circular imports by:
Defining the db object in models.py
Importing models in app.py and initializing the db with the app object.
(See app.py inside create_app())
Using a function in routes.py that takes the app as a parameter to register routes
To run the application, use run.sh script.