Update and enhance documentation (#100)

- Move documentation from README into sphinx docs
- change theme from alabaster to sphinxawsome-theme
- split into technical and user documentation
  - restructure docs/ directories
  - update sphinx refs in user documentation
- extend technical documentation with contributing page
- create seed for more technical documentation (architecture, deployment, testing)

Reviewed-on: #100
Reviewed-by: Christian Merten <christian@merten.dev>
Co-authored-by: Kasimir Uihlein <kuihlein@mailbox.org>
Co-committed-by: Kasimir Uihlein <kuihlein@mailbox.org>
pull/103/head
Kasimir Uihlein 11 months ago committed by Christian Merten
parent afb38c118a
commit 35e565d0bd

@ -1,4 +1,4 @@
# kompass
# jdav Kompass
[![Build Status](https://jenkins.merten.dev/buildStatus/icon?job=gitea%2Fkompass%2Fmain)](https://jenkins.merten.dev/job/gitea/job/kompass/job/main/)
@ -13,94 +13,34 @@ Any form of contribution is appreciated. If you found a bug or have a feature re
[issue](https://git.jdav-hd.merten.dev/digitales/kompass/issues). If you want to help with the documentation or
want to contribute code, please open a [pull request](https://git.jdav-hd.merten.dev/digitales/kompass/pulls).
The following is a short description of the development setup and an explanation of the various
branches.
The following is a short description of where to find the documentation with more information.
## Development setup
The project is run with `docker` and all related files are in the `docker/` subfolder. Besides the actual Kompass
application, a database (postgresql) and a broker (redis) are setup and run in the docker container. No
external services are needed for running the development container.
# Documentation
### Initial installation
Documentation is handled by [sphinx](https://www.sphinx-doc.org/) and located in `docs/`.
A working `docker` setup (with `docker compose` support) is required. For installation instructions see the
[docker manual](https://docs.docker.com/engine/install/).
The sphinx documentation contains information about:
- Development Setup
- Architecture
- Testing
- Production Deployment
- End user documentation
- and much more...
1. Clone the repository and change into the directory of the repository.
> Please add all further documentation also in the sphinx documentation. And not in the readme
2. Fetch submodules
```bash
git submodule update --init
```
## online
Online (latest release version): https://jdav-hd.de/static/docs/
3. Prepare development environment: to allow automatic rebuilding upon changes in the source,
the owner of the `/app/jdav_web` directory in the docker container must agree with
your user. For this, make sure that the output of `echo UID` and `echo UID` is not empty. Then run
```bash
export GID=${GID}
export UID=${UID}
```
## local
To read the documentation build it locally and view it in your browser:
```bash
cd docs/
make html
4. Start docker
```bash
cd docker/development
docker compose up
```
This runs the docker in your current shell, which is useful to see any log output. If you want to run
the development server in the background instead, use `docker compose up -d`.
During the initial run, the container is built and all dependencies are installed which can take a few minutes.
After successful installation, the Kompass initialization runs, which in particular sets up all tables in the
database.
5. Setup admin user: in a separate shell, while the docker container is running, run
```bash
cd docker/development
docker compose exec master bash -c "cd jdav_web && python3 manage.py createsuperuser"
```
This creates an admin user for the administration interface.
### Development
If the initial installation was successful, you can start developing. Changes to files cause an automatic
reload of the development server. If you need to generate and perform database migrations or generate locale files,
use
# MacOS (with firefox)
open -a firefox $(pwd)/docs/build/html/index.html
# Linux (I guess?!?)
firefox ${pwd}/docs/build/html/index.html
```
cd docker/development
docker compose exec master bash
cd jdav_web
```
This starts a shell in the container, where you can execute any django maintenance commands via
`python3 manage.py <command>`. For more information, see the [django documentation](https://docs.djangoproject.com/en/4.0/ref/django-admin).
### Testing
To run the tests, you can use the docker setup under `docker/test`.
### Known Issues
- If the `UID` and `GID` variables are not setup properly, you will encounter the following error message
after running `docker compose up`.
```bash
=> ERROR [master 6/7] RUN groupadd -g fritze && useradd -g -u -m -d /app fritze 0.2s
------
> [master 6/7] RUN groupadd -g fritze && useradd -g -u -m -d /app fritze:
0.141 groupadd: invalid group ID 'fritze'
------
failed to solve: process "/bin/sh -c groupadd -g $GID $USER && useradd -g $GID -u $UID -m -d /app $USER" did not complete successfully: exit code: 3
```
In this case repeat step 3 above.
## Organization and branches
The stable development happens on the `main` branch for which only maintainers have write access. Any pull request
should hence be targeted at `main`. Regularly, the production instances are updated to the latest `main` version,
in particular these are considered to be stable.
If you have standard write access to the repository, feel free to create new branches. To make organization
easier, please indicate your username in the branch name.
The `testing` branch is deployed on the development instances. No development should happen there, this branch
is regularly reset to the `main` branch.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

@ -0,0 +1,20 @@
:orphan: true
.. meta::
:description: Miscellaneous information about the Kompass project
.. vale off
About
=====
.. rst-class:: lead
.. attention::
Die Seite befindet sich noch im Aufbau. -- The page is still under construction.
(Stand: 08.01.2025)
- About the kompass project
- About this documentation

@ -3,15 +3,19 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
from dataclasses import asdict
from sphinxawesome_theme import ThemeOptions
# -- Project information -------------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'Kompass'
copyright = '2024, Christian Merten'
author = 'Christian Merten'
release = '2.0'
author = 'The Kompass Team'
copyright = f'2025, {author}'
# -- General configuration ---------------------------------------------------
# -- General configuration -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = []
@ -21,8 +25,39 @@ exclude_patterns = []
language = 'de'
# -- Options for HTML output -------------------------------------------------
# -- Options for HTML output ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'alabaster'
html_theme = 'sphinxawesome_theme'
html_static_path = ['_static']
# -- Sphinxawsome-theme options ------------------------------------------------
# https://sphinxawesome.xyz/how-to/configure/
html_logo = "_static/favicon2.png"
html_favicon = "_static/favicon2.png"
html_sidebars = {
"about": ["sidebar_main_nav_links.html"],
# "changelog": ["sidebar_main_nav_links.html"],
}
# Code blocks color scheme
pygments_style = "emacs"
pygments_style_dark = "emacs"
# Could be directly in html_theme_options, but this way it has type hints
# from sphinxawesome_theme
theme_options = ThemeOptions(
show_prev_next=True,
show_breadcrumbs=True,
main_nav_links={
"Docs": "index",
"About": "about",
# "Changelog": "changelog"
},
show_scrolltop=True,
)
html_theme_options = asdict(theme_options)

@ -0,0 +1,7 @@
.. _development_manual/architecture:
=================
Architecture
=================
tbd

@ -0,0 +1,85 @@
.. _development_manual/contributing:
============
Contributing
============
Any form of contribution is appreciated. If you found a bug or have a feature request, please file an
`issue <https://git.jdav-hd.merten.dev/digitales/kompass/issues>`_. If you want to help with the documentation or
want to contribute code, please open a `pull request <https://git.jdav-hd.merten.dev/digitales/kompass/pulls>`_.
.. note::
Please read this page carefully before contributing.
Miscellaneous
-------------
- version control with `git <https://git-scm.com/>`_
- own gitea instance at https://git.jdav-hd.merten.dev/
- protected ``main`` branch
Organization and branches
-------------------------
The stable development happens on the ``main``-branch for which only maintainers have write access. Any pull request
should hence be targeted at ``main``. Regularly, the production instances are updated to the latest ``main`` version,
in particular these are considered to be stable.
If you have standard write access to the repository, feel free to create new branches. To make organization
easier, please follow the branch naming convention: ``<username>/<feature>``.
The ``testing``-branch is deployed on the development instances. No development should happen there, this branch
is regularly reset to the ``main``-branch.
Workflow
--------
- request a gitea account from the project maintainers
- decide on an `issue <https://git.jdav-hd.merten.dev/digitales/kompass/issues>`_ to work on or create a new one
- branch out to an own branch (naming convention: ``<username>/<feature>``) from the ``main``-branch
- work on the issue and commit your changes
- create a pull request from your branch to the ``main``-branch
.. _development_manual/contributing/documentation:
Documentation
-------------
If you want to contribute to the documentation, please follow the steps below.
Online (latest release version): https://jdav-hd.de/static/docs/
- This documentation is build `sphinx <https://www.sphinx-doc.org/>`_ and `awsome sphinx theme <https://sphinxawesome.xyz/>`_ the source code is located in ``docs/``.
- All documentation is written in `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_ and uses the `sphinx directives <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`_.
- The directives can vary due to the theme, see the `awesome sphinx theme documentation <https://sphinxawesome.xyz/demo/notes/>`_.
- All technical documentation is written in english, user documentation is written in german.
To read the documentation build it locally and view it in your browser:
.. code-block:: bash
cd docs/
make html
# MacOS (with firefox)
open -a firefox $(pwd)/docs/build/html/index.html
# Linux (I guess?!?)
firefox ${pwd}/docs/build/html/index.html
Code
----
If you want to contribute code, please follow the inital setup steps in the :ref:`development_manual/setup` section. And dont forget to :ref:`document <development_manual/contributing/documentation>` your code properly and write tests.
.. note::
Still open / to decide:
- linting
- (auto) formatting
- reliable tests via ci/cd pipeline

@ -0,0 +1,7 @@
.. _development_manual/deployment:
=====================
Production Deployment
=====================
tbd

@ -0,0 +1,42 @@
.. _development_manual/index:
#########################
Development Documentation
#########################
This part of the documentation describes the development and maintenance of the Kompass project.
.. toctree::
:titlesonly:
contributing
setup
architecture
testing
deployment
Contributing
------------
Any form of contribution is appreciated!
.. seealso::
:ref:`Contributing <development_manual/contributing>`
Documentation
-------------
Structure
- :ref:`Nutzer Dokumentation <user_manual/index>` auf deutsch
- :ref:`Development Documentation <development_manual/index>` auf englisch
.. seealso::
:ref:`Contributing #Documentation <development_manual/contributing/documentation>`

@ -0,0 +1,101 @@
.. _development_manual/setup:
=================
Development Setup
=================
The project is run with ``docker`` and all related files are in the ``docker/`` subfolder. Besides the actual Kompass
application, a database (postgresql) and a broker (redis) are setup and run in the docker container. No
external services are needed for running the development container.
Initial installation
--------------------
A working ``docker`` setup (with ``docker compose``) is required. For installation instructions see the
`docker manual <https://docs.docker.com/engine/install/>`_.
1. Clone the repository and change into the directory of the repository.
2. Fetch submodules
.. code-block:: bash
git submodule update --init
.. _step-3:
3. Prepare development environment: to allow automatic rebuilding upon changes in the source,
the owner of the ``/app/jdav_web`` directory in the Docker container must match your
user. For this, make sure that the output of ``echo UID`` and ``echo UID`` is not empty. Then run
.. code-block:: bash
export GID=${GID}
export UID=${UID}
4. Start docker
.. code-block:: bash
cd docker/development
docker compose up
This runs the docker in your current shell, which is useful to see any log output. If you want to run
the development server in the background instead, use ``docker compose up -d``.
During the initial run, the container is built and all dependencies are installed which can take a few minutes.
After successful installation, the Kompass initialization runs, which in particular sets up all tables in the
database.
If you need to rebuild the container (e.g. after changing the ``requirements.txt``), execute
.. code-block:: bash
docker compose up --build
5. Setup admin user: in a separate shell, while the docker container is running, execute
.. code-block:: bash
cd docker/development
docker compose exec master bash -c "cd jdav_web && python3 manage.py createsuperuser"
This creates an admin user for the administration interface.
Development
-----------
If the initial installation was successful, you can start developing. Changes to files cause an automatic
reload of the development server. If you need to generate and perform database migrations or generate locale files,
use
.. code-block:: bash
cd docker/development
docker compose exec master bash
cd jdav_web
This starts a shell in the container, where you can execute any django maintenance commands via
``python3 manage.py <command>``. For more information, see the https://docs.djangoproject.com/en/4.0/ref/django-admin.
Known Issues
------------
- If the ``UID`` and ``GID`` variables are not setup properly, you will encounter the following error message
after running ``docker compose up``.
.. code-block:: bash
=> ERROR [master 6/7] RUN groupadd -g fritze && useradd -g -u -m -d /app fritze 0.2s
------
> [master 6/7] RUN groupadd -g fritze && useradd -g -u -m -d /app fritze:
0.141 groupadd: invalid group ID 'fritze'
------
failed to solve: process "/bin/sh -c groupadd -g $GID $USER && useradd -g $GID -u $UID -m -d /app $USER" did not complete successfully: exit code: 3
In this case repeat :ref:`step 3 <step-3>` above.

@ -0,0 +1,7 @@
.. _development_manual/testing:
=================
Testing
=================
To run the tests, you can use the docker setup under ``docker/test``.

@ -2,42 +2,41 @@
sphinx-quickstart on Sun Nov 24 18:37:20 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. _index:
=======
Kompass
=======
############
jdav Kompass
############
Der Kompass ist dein Kompass in der Jugendarbeit in deiner JDAV Sektion. Wenn du das
erste mal hier bist, schau doch mal :ref:`first-steps` an.
erste mal hier bist, schau doch mal :ref:`user_manual/getstarted` an.
.. attention::
Die Dokumentation befindet sich noch im Aufbau. -- The documentation is still under construction.
(Stand: 08.01.2025)
Was ist der Kompass?
Nutzer Dokumentation
--------------------
Der Kompass ist eine Verwaltungsplattform für die tägliche Jugendarbeit in der JDAV.
Die wichtigsten Funktionen sind
- auf deutsch
- Hier findest Du als Nutzer alles was Du wissen musst um den Kompass bedienen zu können.
- Verwaltung von Teilnehmer\*innen von Jugendgruppen
- Organisation von Ausfahrten
- Abwicklung von Abrechnungen
- Senden von E-Mails
.. toctree::
:titlesonly:
Neben diesen Funktionen für die tägliche Arbeit, automatisiert der Kompass die
Aufnahme von neuen Mitgliedern und die Pflege der Daten durch
user_manual/index
- Wartelistenverwaltung
- Registrierung neuer Mitglieder
- Rückmeldeverfahren
.. _index:
Development Documentation
-------------------------
Inhaltsverzeichnis
------------------
- auf englisch
- Hier findest Du als Entwickler alles was Du wissen musst um den Kompass entwickeln und zu pflegen.
.. toctree::
:maxdepth: 2
:titlesonly:
development_manual/index
getstarted
members
excursions
waitinglist
finance

@ -1,9 +1,9 @@
.. _excursions:
.. _user_manual/excursions:
Ausfahrten
==========
Neben der :ref:`Teilnehmer\*innenverwaltung <members>` ist das Abwickeln von Ausfahrten
Neben der :ref:`Teilnehmer\*innenverwaltung <user_manual/members>` ist das Abwickeln von Ausfahrten
die zweite wichtige Aufgabe des Kompass. Eine Ausfahrt für die eigene Jugendgruppe
anbieten ist neben der ganzen inhaltlichen Arbeit auch jede Menge bürokratischer Aufwand. Der Kompass
versucht dir von diesem Aufwand so viel wie möglich abzunehmen.
@ -43,6 +43,8 @@ Seminarbericht direkt ein und lass dir den Papierkram vom Kompass erledigen.
SJR Antrag
----------
tbd
Abrechnung
----------

@ -1,3 +1,5 @@
.. _user_manual/finance:
Finanzen
========

@ -1,4 +1,4 @@
.. _first-steps:
.. _user_manual/getstarted:
Erste Schritte
==============
@ -29,7 +29,7 @@ er auf den entsprechenden Eintrag, ändert das Geburtsdatum und klickt auf *Spei
.. note::
Nicht alle Einträge in der `Teilnehmer\*innenanzeige`_ sind klickbar. Das liegt daran,
dass du manche Teilnehmer\*innen zwar sehen, aber nicht ihre Details einsehen kannst.
Manche Einträge wiederum kannst du einsehen, aber nicht bearbeiten. Für mehr Details siehe :ref:`Teilnehmer\*innenverwaltung <members>`
Manche Einträge wiederum kannst du einsehen, aber nicht bearbeiten. Für mehr Details siehe :ref:`Teilnehmer\*innenverwaltung <user_manual/members>`
Probier doch einmal aus deinen eigenen Eintrag zu ändern. Sicherlich gibt es einige
Felder, die nicht ausgefüllt oder nicht mehr aktuell sind. Lade z.B. ein Bild von dir hoch,
@ -70,7 +70,7 @@ Wie geht es weiter?
-------------------
Nun hat Fritz den Bürokratiekram für heute erledigt. Du willst noch mehr wissen? Dann
geh zurück zum :ref:`index`.
geh zurück zur :ref:`user_manual/index`.
.. _Startseite: https://jdav-hd.de/kompass
.. _Teilnehmer\*innenanzeige: https://jdav-hd.de/kompassmembers/member/

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

@ -0,0 +1,50 @@
.. _user_manual/index:
####################
Nutzer Dokumentation
####################
Der Kompass ist dein Kompass in der Jugendarbeit in deiner JDAV Sektion. Wenn du das
erste mal hier bist, schau doch mal :ref:`user_manual/getstarted` an.
.. toctree::
:titlesonly:
getstarted
members
excursions
waitinglist
finance
Was ist der Kompass?
--------------------
Der Kompass ist eine Verwaltungsplattform für die tägliche Jugendarbeit in der JDAV.
Die wichtigsten Funktionen sind
- Verwaltung von Teilnehmer\*innen von Jugendgruppen
- Organisation von Ausfahrten
- Abwicklung von Abrechnungen
- Senden von E-Mails
Neben diesen Funktionen für die tägliche Arbeit, automatisiert der Kompass die
Aufnahme von neuen Mitgliedern und die Pflege der Daten durch
- Wartelistenverwaltung
- Registrierung neuer Mitglieder
- Rückmeldeverfahren
Feedback
--------
Wenn Du Feedback hast, schreibe uns gerne eine E-Mail an: `digitales@jdav-hd.de <mailto:digitales@jdav-hd.de?subject=Kompass Feedback>`_.
Der Kompass lebt davon, dass er genau unsere Probleme löst und nicht nur ein weiteres Tool ist.
Feedback könnte sein:
- Fehler in der Software (bug)
- Verbesserungsvorschläge
- Wünsche für neue Funktionen
- etc. pp.

@ -1,4 +1,4 @@
.. _members:
.. _user_manual/members:
Teilnehmer\*innenverwaltung
===========================
@ -15,12 +15,12 @@ In der Teilnehmer\*innenverwaltung siehst du in der Regel zwei Menüpunkte:
- Teilnehmer\*innenverwaltung: Ausfahrten und *Alle Teilnehmer\*innen*.
In diesem Abschnitt geht es nur um die Teilnehmer\*innen selbst. Wenn du etwas zum Punkt Ausfahrten
lernen möchtest, kannst du zu :ref:`excursions` springen.
lernen möchtest, kannst du zu :ref:`user_manual/excursions` springen.
.. note::
Falls du ein Amt in deiner Sektion ausübst und zum Beispiel für Jugendgruppenkoordination
oder die Verwaltung der Warteliste zuständig ist, siehst du hier noch mehr Punkte. Mehr
Informationen dazu findest du unter :ref:`waitinglist`.
Informationen dazu findest du unter :ref:`user_manual/waitinglist`.
Falls du direkt zu einer von dir geleiteten Jugendgruppe gehen möchtest, findest
du unter `Teilnehmer*innenverwaltung`_ oder auf der `Startseite`_
@ -138,14 +138,14 @@ Der\*die ausgewählte Teilnehmer\*in erhält eine E-Mail mit einem Link. Dieser
Seite auf der die Person ihr Geburtsdatum eingeben muss.
.. note::
Das Geburtsdatumsformat ist TT.MM.JJJJ, also wenn Peter am
1.4.1999 geboren ist, müsste er *01.04.1999* eingeben.
Das Geburtsdatumsformat ist ``TT.MM.JJJJ``, also wenn Peter am
1.4.1999 geboren ist, muss er *01.04.1999* eingeben.
Nach erfolgreich eingegebenem Geburtsdatum, wird die Person auf ein Formular mit ihren Daten weitergeleitet.
Dann einfach prüfen, gegebenenfalls aktualisieren und schließlich speichern. Der Link ist
Dann prüfen, gegebenenfalls aktualisieren und schließlich speichern. Der Link ist
immer 30 Tage lang gültig und kann in dieser Zeit auch beliebig oft benutzt werden.
Klingt alles noch abstrakt? Dann fordere doch mal dich selbst zur Rückmeldung auf und probiere es aus.
Klingt alles noch abstrakt? Dann fordere dich doch mal selbst zur Rückmeldung auf und probiere es aus.
.. _emergency-contacts:
@ -159,7 +159,7 @@ mindestens einen Notfallkontakt angeben.
.. note::
Bei vielen Teilnehmer\*innen sind keine Notfallkontakte eingetragen. Das liegt dann vermutlich daran,
dass die aus einem anderen System migriert wurden und daher nicht verfügbar sind.
dass sie aus einem anderen System migriert wurden und daher nicht verfügbar sind.
Bei der regelmäßigen :ref:`echo` werden die Notfallkontakte ebenfalls abgefragt. Falls
du bei einem deiner Gruppenkinder feststellst, dass die Notfallkontakte fehlen

@ -1,4 +1,4 @@
.. _waitinglist:
.. _user_manual/waitinglist:
Warteliste und neue Mitglieder
==============================
@ -65,7 +65,7 @@ Neues Mitglied in euerer Gruppe
Nach dem ihr ein neues Mitglied in eurer Gruppe habt seid ihr auch vorrangig für die Datenpflege
zuständig. Bitte ruft die Detailansicht des\*der Teilnehmer\*in auf. Öffnet das Anmeldeformular und
Übertragt die Infos in die zugehörigen Felder. Weiteres dazu findet ihr in der
:ref:`Teilnehmer\*innenverwaltung <members>`
:ref:`Teilnehmer\*innenverwaltung <user_manual/members>`
.. _group-registration-password:

@ -1,4 +1,3 @@
alabaster==0.7.16
amqp==5.0.9
asgiref==3.4.1
auditlog3==1.0.1
@ -52,6 +51,7 @@ schwifty==2024.11.0
six==1.16.0
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinxawesome-theme==5.3.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0

Loading…
Cancel
Save