Dear Gitlab Users, for our upcoming upgrade to Gitlab v14, Gitlab will be unavailable on Thursday, 05.08.2021 from 5:00 pm to approximately 7:00 pm. Note that with v14, certain breaking changes will be introduced (https://about.gitlab.com/blog/2021/06/04/gitlab-moving-to-14-breaking-changes/).

README.rst 4.37 KB
Newer Older
hynek's avatar
hynek committed
1 2 3
Discuss Data
============

4 5
Open Platform for the Interactive Discussion of Research Data Quality
(on the example of area studies on the post-Soviet region)
hynek's avatar
hynek committed
6

7 8 9
The software is provided as a Docker image and can be obtained from the project's own repository ``docker.gitlab.gwdg.de/discuss-data``.
To get the latest image, run:

10
::
11 12 13 14 15 16 17 18 19 20 21

     docker pull docker.gitlab.gwdg.de/discuss-data/discuss-data:latest

Discuss Data is looking forward to your contributions.
To provide feedback, report bugs or propose enhancements, feel free to use our `Issue tracker`_.
For contributions to the source code, see the `documentation on contributions`_.


.. _`Issue tracker`: https://gitlab.gwdg.de/discuss-data/discuss-data/-/issues
.. _`documentation on contributions`: https://discuss-data.pages.gwdg.de/discuss-data/docs/contribution.html

hynek's avatar
hynek committed
22

23 24 25
Documentation
-------------

hynek's avatar
hynek committed
26 27
`General documentation`_

28 29
`Coverage Report`_

hynek's avatar
hynek committed
30
.. _`General documentation`: https://discuss-data.pages.gwdg.de/discuss-data/docs/
31 32
.. _`Coverage Report`: https://discuss-data.pages.gwdg.de/discuss-data/coverage/

hynek's avatar
hynek committed
33 34
Preparing the development environment
-------------------------------------
hynek's avatar
hynek committed
35

36
Provided, you have Docker, Python and Npm installed on your system, prepare your local environment by installing node
37
modules and python dependencies into a virtual environment. Currently, only Docker 19, Node 12 and Python 3.7 are well tested and
38
supported.
hynek's avatar
hynek committed
39

40
::
hynek's avatar
hynek committed
41

hynek's avatar
hynek committed
42
   npm install
43
   python -m venv venv
hynek's avatar
hynek committed
44 45
   . venv/bin/activate
   python -m pip install -U pip
46
   pip install -r requirements/local.txt
47

48
To build the docker stack and install fixtures as well as test data to fill up the database, an init script is provided for your convenience. In its last step it will ask for input on the command line to create a superuser.
49

50
::
hynek's avatar
hynek committed
51

hynek's avatar
hynek committed
52
   ./init
hynek's avatar
hynek committed
53

54

hynek's avatar
hynek committed
55

hynek's avatar
hynek committed
56 57
Settings
--------
58

hynek's avatar
hynek committed
59 60 61
Settings are read from environment configuration files located in ``.envs/``.
Bear in mind that the settings provided ``.envs/.local`` are not meant to be used in a production environment.
To create your own environment settings, read the documentation on `Configuring the Environment`_.
62

hynek's avatar
hynek committed
63
.. _`Configuring the Environment`: https://cookiecutter-django.readthedocs.io/en/latest/developing-locally-docker.html#configuring-the-environment
hynek's avatar
hynek committed
64

hynek's avatar
hynek committed
65 66
Testing
-------
hynek's avatar
hynek committed
67

hynek's avatar
hynek committed
68
Run type checks with mypy:
hynek's avatar
hynek committed
69

70
::
hynek's avatar
hynek committed
71

hynek's avatar
hynek committed
72
  mypy discuss_data
hynek's avatar
hynek committed
73

74
This project is configured to run pytest within a docker container. To run the tests, check your test coverage, and generate an HTML coverage report:
75

76
::
77

78
     docker-compose run --rm django ./run_pytest
79

80

hynek's avatar
hynek committed
81 82
Localization and Internationalization
-------------------------------------
83

hynek's avatar
hynek committed
84
For further information see `Localization`_.
85

hynek's avatar
hynek committed
86
.. _`Localization`: https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#localization-how-to-create-language-files
hynek's avatar
hynek committed
87 88


hynek's avatar
hynek committed
89 90
Email Server
------------
hynek's avatar
hynek committed
91

92
The Compose stack comprises the SMTP server `MailHog`_ with a web interface available under ``http://127.0.0.1:8025``.
93

hynek's avatar
hynek committed
94
.. _mailhog: https://github.com/mailhog/MailHog
95

hynek's avatar
hynek committed
96 97
Search
------
98

hynek's avatar
hynek committed
99
To initialize or rebuild the elasticsearch index run:
100

101
::
102

103
   docker-compose run --rm django python manage.py search_index --rebuild
104

hynek's avatar
hynek committed
105
Print the whole index in development by accessing:
106

hynek's avatar
hynek committed
107
::
108

hynek's avatar
hynek committed
109
   http://localhost:9200/users/_search?pretty
110

hynek's avatar
hynek committed
111 112
Deploy to production
--------------------
113

114 115 116 117 118 119
For building and testing the production image, build the Dockerfile with the ``production`` target.

::

     docker build --target production -f compose/django/Dockerfile .

hynek's avatar
hynek committed
120
For an example on how to actually deploy to a production environment see the `Discuss Data Docker`_ project.
121 122

.. _`Discuss Data Docker`: https://gitlab.gwdg.de/discuss-data/discuss-data-docker
123 124 125



hynek's avatar
hynek committed
126 127
Badges
------
128

hynek's avatar
hynek committed
129 130 131 132 133 134 135 136 137 138 139 140
.. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg
     :target: https://github.com/pydanny/cookiecutter-django/
     :alt: Built with Cookiecutter Django
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
     :target: https://github.com/ambv/black
     :alt: Black code style
.. image:: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
     :target: http://commitizen.github.io/cz-cli/
     :alt: Commitizen friendly
.. image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
     :target: https://github.com/semantic-release/semantic-release
     :alt: semantic-release
141 142 143
.. image:: https://img.shields.io/badge/License-AGPLv3-blue.svg
     :target: https://www.gnu.org/licenses/agpl-3.0
     :alt: License: AGPL v3