Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools used for PoWA-Web development #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions docs/components/powa-web/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,45 @@ Clone the repository:
.. code:: bash

git clone https://github.com/powa-team/powa-web/
cd powa/
make && sudo make install
cd powa-web/

To run the application, use run_powa.py, which will run powa in debug mode.
That means the javascript files will not be minified, and will not be compiled
into one giant source file.
Then, create a Python3 virtualenv and install the project dependencies:

.. code:: bash

python3 -m venv .venv --upgrade-deps
. .venv/bin/activate
pip install -r requirements.txt

In case you want to contribute on the styles, first install the NodeJS dev dependencies:

CSS files are generated using `sass <https://sass-lang.com/>`.
Javascript files are splitted into AMD modules, which are managed by `requirejs
<https://requirejs.org/>` and compiled using `grunt <https://gruntjs.com/>`.
.. code:: bash

These projects depend on NodeJS, and NPM, its package manager, so make sure you are able to install them on your
distribution.
npm ci

Install the development dependencies:
After installing the dependencies, you can start the ViteJS development server with:

.. code:: bash

npm install -g grunt-cli
npm install .
npm run dev

This command launches a local server at http://localhost:5173 with hot module replacement,
enabling real-time updates as you modify the project files.

To run the application, use ``run_powa.py`` in the PoWA-Web project root, which will run PoWa in debug mode.

.. code:: bash

cd powa-web/
./run_powa.py
[I 240718 09:13:07 run_powa:11] Starting powa-web on http://127.0.0.1:8888/

If you don't already have a running instance of PoWA, you can easily deploy an environment
for PoWa web development using `powa-podman <https://github.com/powa-team/powa-podman/tree/master/dev>`_.
This project provides container images and compose files in its dev directory.

Once you have cloned it, you can start the PoWA stack and specify your PoWA-Web development location.

Then, you can run ``grunt`` to update only the css files, or regenerate optimized
javascript builds with ``grunt dist``.
PoWA-Web uses `ViteJS` and `Vue 3` for a more integrated and performant
front-end development experience.