You will need Node 16+, Python 3.7+ and entr.
Clone this repository and install dependencies:
git clone https://github.com/h2oai/nitro.git
cd nitro
make setup
Build everything (front-end, wheel, docs):
make
Quickstart. Run any app at localhost:5000
, then run make dev-web
and go to https://localhost:3000.
Long version:
Most of the time, you'll be editing the front-end sources in web/
while running a Nitro app in parallel, like the Nitro interactive docs (docs/docs.py
).
The docs.py
file is generated from py/pkg/docs/*.py
, which is what you'll be editing.
- Open
web/
in Visual Studio Code. - Open
py/pkg
in PyCharm. If you're prompted to select an interpreter, use the one inpy/pkg/venv
. - Run
make dev-guide
in a new terminal window. This will rebuilddocs.py
wheneverpy/pkg/docs/*.py
is changed. - Run
make dev-py
in a new terminal window. This willdocs.py
with auto-reload enabled. - Run
make dev-web
in a new terminal window. This will automatically launch the front-end at http://localhost:3000 with auto-reload enabled.
In general, as long as the backend is running at http://localhost:5000, the development version of the front-end can interact with it. This way, you can always interact with apps at http://localhost:3000, and switch backends at http://localhost:5000.
Tip. To preview the project website during development, also run make serve-docs
, which will run mkdocs
live.
Happy hacking!