From 411eb2a65cf65b6a9b3117f631cf130b2e8b768b Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Sun, 8 Dec 2019 19:20:45 +0100
Subject: [PATCH] Update development setup instructions

---
 docs/dev/01_setup.rst        | 36 ++++++++++++++++++++++++++++++------
 docs/dev/02_install_apps.rst | 10 ++--------
 docs/dev/03_run.rst          | 10 ----------
 3 files changed, 32 insertions(+), 24 deletions(-)
 delete mode 100644 docs/dev/03_run.rst

diff --git a/docs/dev/01_setup.rst b/docs/dev/01_setup.rst
index c036f5c83..8d4cd0d8b 100644
--- a/docs/dev/01_setup.rst
+++ b/docs/dev/01_setup.rst
@@ -9,6 +9,7 @@ Poetry makes a lot of stuff very easy, especially managing a virtual
 environment that contains BiscuIT and everything you need to run the
 framework and selected apps.
 
+Also, `Yarn`_ is needed to resolve JavaScript dependencies.
 
 Get the source tree
 -------------------
@@ -16,7 +17,7 @@ Get the source tree
 To download BiscuIT and all officially bundled apps in their
 development version, use Git like so::
 
-  git clone --recurse-submodules https://edugit.org/Teckids/BiscuIT/BiscuIT-ng
+  git clone --recurse-submodules https://edugit.org/BiscuIT/BiscuIT-ng
 
 If you do not want to download the bundled apps, leave out the
 ``--recurse-submodules`` option.
@@ -45,13 +46,36 @@ installing BiscuIT is a matter of::
   poetry install
 
 
-Running commands in the virtual environment
--------------------------------------------
+Regular tasks
+-------------
 
-To run commands in the virtual environment, use Poetry's ``run``
-command::
+After making changes to the environment, e.g. installing apps or updates,
+some maintenance tasks need to be done:
 
-  poetry run ./manage.py runserver
+1. Download and install JavaScript dependencies
+2. Collect static files
+3. Run database migrations
+
+All three steps can be done with the ``poetry run`` command and
+``manage.py``::
+
+  poetry run ./manage.py yarn install
+  poetry run ./manage.py collectstatic
+  poetry run ./manage.py migrate
+
+(You might need database settings for the `migrate` command; see below.)
+
+Running the development server
+------------------------------
+
+The development server can be started using Django's ``runserver`` command.
+You can either configure BiscuIT like in a production environment, or pass
+basic settings in as environment variable. Here is an example that runs the
+development server against a local PostgreSQL database with password
+`biscuit` (all else remains default) and with the `debug` setting enabled::
+
+  BISCUIT_debug=true BISCUIT_database__password=biscuit poetry run ./manage.py runserver
 
 .. _Poetry: https://poetry.eustace.io/
 .. _Poetry installation methods: https://poetry.eustace.io/docs/#installation
+.. _Yarn: https://yarnpkg.com
diff --git a/docs/dev/02_install_apps.rst b/docs/dev/02_install_apps.rst
index 9ecfcc595..b083baf6c 100644
--- a/docs/dev/02_install_apps.rst
+++ b/docs/dev/02_install_apps.rst
@@ -17,11 +17,5 @@ This will install the Exlibris app (library management) app by using a
 shell for first ``cd``'ing into the app directory and then using
 poetry to install the app.
 
-
-Migrate the database
---------------------
-
-After installing or updating any apps, the database must be updated as
-well by running Django's ``migrate`` command::
-
-  poetry run ./manage.py migrate
+DO not forget to run the maintenance tasks described earlier after
+installign any app.
diff --git a/docs/dev/03_run.rst b/docs/dev/03_run.rst
deleted file mode 100644
index ab28dc471..000000000
--- a/docs/dev/03_run.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Running BiscuIT in development mode
-===================================
-
-Using Django's development server
----------------------------------
-
-After you installed the framework and all desired apps and migrated
-the database, you are ready to run BiscuIT::
-
-  poetry run ./manage.py runserver
-- 
GitLab