#############################
Development Environment Setup
#############################
It is recommended to set up a local environment when working on code or documentation.
In either case, you start by cloning the repository to you development device.
====
Code
====
You need to have `npm `_ installed to setup the environment for the code.
In the ``bsrap-app`` subdirectory of the repository you install the JavaScript dependencies of our application by executing
.. code:: bash
npm install
Then you can run an development instance of the application by executing
.. code:: bash
npm run dev
The application is accessible under http://localhost:5173/ and is automatically updated whenever the source on disk changes.
If you want to test the production version of the application execute
.. code:: bash
npm run build
npm run preview
The application is then accessible under http://localhost:4173/.
=============
Documentation
=============
You need to have `python `_ installed to setup the environment for the documentation.
You start by creating and activating a virtual python environment in the ``docs`` subdirectory of the repository by executing
.. code:: bash
python -m venv env
source env/bin/activate
With the virtual python environment being active,
you install the software necessary to build the documentation:
.. code:: bash
pip install -r requirements.txt
Then you can run a development instance of the documentation by executing
.. code:: bash
sphinx-autobuild source build
The documentation is accessible under http://localhost:8000/ and is automatically updated whenever the source on disk changes.
If you want to build the documentation run
.. code:: bash
make html
The built documentation is then located in subdirectory ``docs/build/html/`` of the repository.
You can open the documentations home page by running
.. code:: bash
firefox build/html/index.html
in the ``docs`` subdirectory of the repository.