Skip to content

Commit

Permalink
Merge 9517cb0 into e839c18
Browse files Browse the repository at this point in the history
  • Loading branch information
jeriox committed Jan 18, 2021
2 parents e839c18 + 9517cb0 commit 580911c
Show file tree
Hide file tree
Showing 12 changed files with 511 additions and 49 deletions.
44 changes: 15 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
![ephios](https://github.com/ephios-dev/ephios/workflows/ephios/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/ephios/badge/?version=latest)](https://docs.ephios.de/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/ephios-dev/ephios/badge.svg?branch=main)](https://coveralls.io/github/ephios-dev/ephios?branch=main)

# ephios

ephios is a tool to manage shifts for medical services.

## Development setup

To set up a development version on your local machine, you need to execute the following steps:
1. Check out repository and cd to it
2. Set up a virtualenv for the project with Python >=3.8 and activate it
3. Install poetry (if not already installed): `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python`
4. Install dependencies with `poetry install`
5. Create env file with `cp .env.example .env`
6. Migrate the database with `python manage.py migrate`
7. Compile translations with `python manage.py compilemessages` and `python manage.py compilejsi18n`
8. Load data for testing with `python manage.py setupdata debug`
9. Start the development server with `python manage.py runserver`
10. Open your web browser, visit `http://localhost:8000` and log in with the default credentials (user `admin@localhost` and password `admin`)

### Tests

Test the code with `pytest`.

### Code style

We recommend installing a pre-commit hook with `pre-commit install`. That will (look at `.pre-commit-config.yaml`) before every commit

* run `autoflake` with a couple of flags to remove unused imports,
* run `isort .` to sort imports,
* run `black .` to format the code. You can also check out the [IDE integration](https://github.com/psf/black#editor-integration)

If you want to do that manually, run `pre-commit run --all-files`. Next to that, we also run `pylint ephios` to check for semantic issues in the code.

Planners can create events for which volunteer help is required (e.g. security/medical services, beach patrols, exercises).
The volunteers can register for the respective events via a clearly arranged web interface.
The planners can then assign personnel and have an overview of the current status.
Different processes can be applied for signup (e.g. a direct confirmation for an event or an "application" that has to be accepted first).
Around this central feature there are further supporting functions like the management of the volunteers and their
qualifications or an overview of the volunteer hours worked. The functions can be extended at any time via plugin,
for example by complete modules (such as stock control) or by further process types for the registration for events.

## Documentation
You can find the documentation for ephios at [Read the Docs](https://docs.ephios.de/en/latest>). This includes
the user guide and installation instructions.

## Contributing
Contributions to ephios are very welcome. You can find information about contributing at our [Contribution page](https://docs.ephios.de/en/latest/development/contributing.html)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions docs/admin/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Administration documentation
============================

This section shows how to install ephios.

.. toctree::
:maxdepth: 2
53 changes: 53 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "ephios"
copyright = "2021, ephios-dev"
author = "ephios-dev"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
51 changes: 51 additions & 0 deletions docs/development/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Contributing
============

Contributions to ephios are welcome. If you want to see what we are currently up to, check the available
`issues <https://github.com/ephios-dev/ephios/issues>`_.

If you have an idea for new feature you should start by deciding whether you want to write a plugin (see :doc:`plugin`)
or to contribute the feature to the ephios core code. A plugin is usually suitable if the feature is very specific to
a small set of users (e.g. a specific signup process only used in your local organisation) or the feature is not related
to the core tasks of ephios (e.g. a system for stock management). If all ephios users could profit from your feature,
you should consider contributing it to the core code. Please start by describing your feature in a new issue in the
GitHub repository to coordinate the extent with us.
When working on existing issues, please assign yourself and create a pull request early on.

Development setup
-----------------

To set up a development version on your local machine, you need to execute the following steps:

#. Check out the `repository <https://github.com/ephios-dev/ephios>`_ and cd to it
#. Set up a virtualenv for the project with Python >=3.8 and activate it
#. Install poetry (if not already installed): `Installation guide <https://python-poetry.org/docs/#installation>`_
#. Install dependencies with ``poetry install``
#. Create env file with ``cp .env.example .env``
#. Migrate the database with ``python manage.py migrate``
#. Compile translations with ``python manage.py compilemessages`` and ``python manage.py compilejsi18n``
#. Load data for testing with ``python manage.py setupdata debug``
#. Start the development server with ``python manage.py runserver``
#. Open your web browser, visit ``http://localhost:8000`` and log in with the default credentials (user ``admin@localhost`` and password ``admin``)

Tests
-----

We are using `pytest <https://docs.pytest.org/en/stable/>`_ along with `django-webtest <https://github.com/django-webtest/django-webtest>`_.
Please write tests for new features or fixed bugs. You can use your IDE integration to run the tests or execute the
whole test suite with ``pytest``.

Code style
----------

We are enforcing a good code style for every pull request. To ensure that you only commit appropriate code, we recommend
installing a pre-commit hook with ``pre-commit install``. You can have a look at ``.pre-commit-config.yaml`` to check
how this works. In short it executes the following steps before every commit:

* run ``autoflake`` with a couple of flags to remove unused imports,
* run ``isort .`` to sort imports,
* run ``black .`` to format the code.

If you want to do that manually, run ``pre-commit run --all-files``.
Next to that, we also run ``pylint ephios`` to check for semantic issues in the code.

10 changes: 10 additions & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Development guide
=================

This section shows how to contribute to ephios and how to develop plugins.

.. toctree::
:maxdepth: 2

contributing
plugin
4 changes: 4 additions & 0 deletions docs/development/plugin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Developing plugins for ephios
=============================

The plugin infrastructure is currently under construction.
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. ephios documentation master file, created by
sphinx-quickstart on Sun Jan 17 23:29:17 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ephios's documentation!
==================================

This documentation explains how to use, install or extend ephios. If you can't find what you're looking for in
the corresponding section, feel free to contact us.

.. toctree::
:maxdepth: 2

user/index
admin/index
development/index
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/user/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
User Guide
==========

This section shows how to use ephios. This includes functionality for volunteers as well as for planners.

.. toctree::
:maxdepth: 2
Loading

0 comments on commit 580911c

Please sign in to comment.