02. Install And Run¶
Learning Goal¶
Install BrickflowUI, run a local app, and understand which files are needed for a Databricks App.
Install¶
Use:
pip install brickflowui
For local development from this repository:
pip install -e ".[dev]"
For docs work:
pip install -e ".[docs]"
If mkdocs is not recognized on Windows, prefer:
python -m mkdocs serve
Minimal App File¶
Create app.py:
import brickflowui as db
app = db.App(title="Learning App")
@app.page("/", title="Home")
def home():
return db.Text("BrickflowUI is running", variant="h1")
if __name__ == "__main__":
app.run()
Run:
python app.py
Open:
http://127.0.0.1:8050
Databricks App Files¶
A Databricks App normally needs:
app.py
app.yaml
requirements.txt
Example requirements.txt:
brickflowui>=0.1.6
Example app.yaml:
command:
- python
- app.py
env:
- name: BRICKFLOWUI_ENV
value: production
Local Repo Development¶
The Python package serves pre-built frontend files from:
brickflowui/frontend/dist/
If you change files under frontend/src, rebuild:
cd frontend
npm run build
Then commit the updated brickflowui/frontend/dist assets.
Common Mistakes¶
- Installing
brickflowuiin one Python environment and running the app from another. - Editing frontend source but forgetting to rebuild bundled assets.
- Deleting
brickflowui/frontend/distbefore packaging. - Pushing
frontend/node_modulesto git. - Expecting root
dist/orsite/to be source files. They are generated.
Exercise¶
Create a fresh folder with app.py, requirements.txt, and app.yaml.
Run it locally. Then change the title and confirm the browser updates after restart.
Checkpoint¶
You should be able to install BrickflowUI, run a local app, and explain why brickflowui/frontend/dist is part of the package.