# Lumi2 (LDAP user management interface)

**Lumi2** is a web application for managing users and user groups present on an OpenLDAP server.
It provides a web-interface for administrators to create/read/update/delete organization users and user groups, and to allow basic account self-service for organization members themselves.
Lumi is written in Python, using the [Flask](https://flask.palletsprojects.com/en/latest/) web framework.

The motivation for Lumi is for it to provide a more user-friendly interface than [PhpLdapAdmin](https://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page), however it is not a replacement.

# Documentation

The following frameworks and/or libraries are used:

- Backend:
    - [Flask](https://flask.palletsprojects.com/en/2.2.x/) - a python web framework
        - [WTForms](https://wtforms.readthedocs.io/en/3.0.x/) - a python library for web form handling
        - [FlaskWTF](https://flask-wtf.readthedocs.io/en/1.0.x/) - an extension to WTForms specific to Flask
        - [flask-restful](https://flask-restful.readthedocs.io/en/latest/quickstart.html) - a minimalistic library for Flask to build RESTful web APIs
    - [ldap3](https://ldap3.readthedocs.io/en/latest/) - python bindings for interaction with LDAP servers
    - [pytest](https://docs.pytest.org/en/7.2.x/) - a python testing framework
    - [coverage](https://coverage.readthedocs.io/en/6.5.0/) - test code coverage reporting used in conjunction with pytest
    - [Pillow](https://pillow.readthedocs.io/en/stable/) - a python image manipulation library
- Frontend:
    - [Bootstrap 5](https://getbootstrap.com/docs/5.2/getting-started/introduction/) - a CSS framework
    - [Bootstrap Icons](https://icons.getbootstrap.com/) - an SVG-icon pack used in conjunction with Bootstrap
    - [jQuery](https://api.jquery.com/) - a JavaScript library for DOM manipulation and AJAX routines
    - [jQuery tablesorter plugin](https://mottie.github.io/tablesorter/docs/) - a plugin for jQuery used to make sortable HTML tables

## Compiling SASS

Install a SASS preprocessor:

```bash
npm install -g sass
```

Process the custom SASS files:

```
sass scss/bootstrap.scss lumi2/static/css/bootstrap.css
```

# Testing

Make sure all dependencies listed in `requirements.txt` are installed.
To run all unit tests, simply run the following from within the repository root:

```bash
coverage run -m pytest && coverage report
```

This will run all unit tests and display the test coverage in your terminal.
