Metadata-Version: 2.2
Name: dlunch
Version: 3.5.0
Summary: The ultimate web app for a well organized lunch.
Author-email: Michele Alberti <michele.alberti90@gmail.com>
License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Project-URL: Homepage, https://github.com/Michele-Alberti/data-lunch
Project-URL: Issues, https://github.com/Michele-Alberti/data-lunch/issues
Keywords: python,webapp,lunch
Classifier: Programming Language :: Python :: 3
Classifier: License :: Free for non-commercial use
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: setuptools==70.3.0
Requires-Dist: click==8.1.8
Requires-Dist: cryptography==43.0.1
Requires-Dist: ipykernel==6.29.5
Requires-Dist: ipywidgets==8.1.5
Requires-Dist: openpyxl==3.1.5
Requires-Dist: pandas==2.2.3
Requires-Dist: passlib==1.7.4
Requires-Dist: tenacity==8.5.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: panel==1.4.5
Requires-Dist: sqlalchemy==2.0.37
Requires-Dist: psycopg==3.2.3
Requires-Dist: hydra-core==1.3.2
Requires-Dist: google-cloud-storage==2.19.0
Requires-Dist: pytesseract==0.3.13
Provides-Extra: dev
Requires-Dist: jupyterlab==4.3.4; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs==1.6.1; extra == "docs"
Requires-Dist: mkdocstrings==0.27.0; extra == "docs"
Requires-Dist: mkdocstrings-python==1.13.0; extra == "docs"
Requires-Dist: mkdocs-material==9.5.49; extra == "docs"
Requires-Dist: mkdocs-gen-files==0.4.0; extra == "docs"
Requires-Dist: mkdocs-literate-nav==0.6.1; extra == "docs"
Requires-Dist: mkdocs-section-index==0.3.9; extra == "docs"
Requires-Dist: mkdocs-github-admonitions-plugin==0.0.3; extra == "docs"
Requires-Dist: mike==2.1.3; extra == "docs"
Requires-Dist: black==24.10.0; extra == "docs"

# Data Lunch <!-- omit in toc -->

The ultimate web app for a well organized lunch.

## Table of contents

- [Table of contents](#table-of-contents)
- [Development environment setup](#development-environment-setup)
  - [Miniconda](#miniconda)
  - [Setup the development environment](#setup-the-development-environment)
  - [Environment variables](#environment-variables)
    - [General](#general)
    - [Docker and Google Cloud Platform](#docker-and-google-cloud-platform)
    - [TLS/SSL Certificate](#tlsssl-certificate)
    - [Encryption and Authorization](#encryption-and-authorization)
  - [Manually install the development environment](#manually-install-the-development-environment)
  - [Manually install data-lunch CLI](#manually-install-data-lunch-cli)
  - [Running the docker-compose system](#running-the-docker-compose-system)
  - [Running a single container](#running-a-single-container)
  - [Running locally](#running-locally)
- [Additional installations before contributing](#additional-installations-before-contributing)
  - [Pre-commit hooks](#pre-commit-hooks)
  - [Commitizen](#commitizen)
- [Release strategy from `development` to `main` branch](#release-strategy-from-development-to-main-branch)
- [Google Cloud Platform utilities](#google-cloud-platform-utilities)

<!-- DO NOT REMOVE THIS ANCHOR -->
<!-- Used by MkDocs generate_getting_started.py -->
<a id="doc-start"></a>

## Introduction

_Data-Lunch_ is a web app to help people managing lunch orders.  
The interface make possible to upload a menu as an Excel file or as an image. The menu is copied inside the app and people are then able to place orders at preset lunch times.  
Users can flag an order as a takeway one, and, if something change, they can move an order to another lunch time (or change its takeaway status).

The systems handle _guests_ users by giving them a limited ability to interact with the app (they can in fact just place an order).

Once all order are placed it is possible to stop new orders from being placed and download an Excel files with every order, grouped by lunch time and takeaway status.

The idea behind this app is to simplify data collection at lunch time, so that a single person can book a restaurant and place orders for a group of people (friends, colleagues, etc.).

> [!IMPORTANT]
> This section is a work in progress, the app has a lot of configurations, not yet described in this documentation.  
> Authentication and guest management are just examples of what is missing from this documentation. 


## Installation

Install commitizen using `pip`:

```
 pip install dlunch
```

For the program to work properly you need the following system dipendencies:

  - [SQLite](https://www.sqlite.org/): used if you set the database to `sqlite`.
  - [Tesseract](https://github.com/tesseract-ocr/tesseract): used to convert images with menu to text.

If you need help on how to install those system preferences on linux (_Debian_) you can check the file `docker/web/Dockerfile.web`.  
It shows how to install them with `apt`.

## Usage

Before starting you need the following environment variables to avoid errors on _Data-Lunch_ startup.

### Environment variables

> [!IMPORTANT]
> `DATA_LUNCH_COOKIE_SECRET` and `DATA_LUNCH_OAUTH_ENC_KEY` are required even if `server=no_auth` is set.

> [!TIP]
> Use the command `data-lunch utils generate-secrets` to generate a valid secret.

| Variable | Type | Required | Description |
|----------|:----:|:--------:|-------------|
`PANEL_ENV` | _str_ | ✔️ | Environment, e.g. _development_, _quality_, _production_, affects app configuration (_Hydra_)
`PORT` | _int_ | ❌ | Port used by the web app (or the container), default to _5000_; affects app configuration (it is used by _Hydra_)
`DATA_LUNCH_COOKIE_SECRET` | _str_ | ✔️ | _Secret_ used for securing the authentication cookie (use `data-lunch utils generate-secrets` to generate a valid secret); leave it as an empty variable if no authentication is set
`DATA_LUNCH_OAUTH_ENC_KEY` | _str_ | ✔️ | _Encription key_ used by the OAuth algorithm for encryption (use `data-lunch utils generate-secrets` to generate a valid secret); leave it as an empty variable if no authentication is set

> [!NOTE]
> The following variables are just a small part of the total. See [here][environment-variables] for more details.

### Launch command
Use the following command to start the server with default configuration (_SQLite_ database, no authentication):

```
python -m dlunch
```

Connect to localhost:5000 (if the default port is used) to see the web app.

## Customization
_Data-Lunch_ configurations explout [Hydra](https://hydra.cc/docs/intro/) versatility.
It is possible to alter default configurations by using _Hydra's overrides_, for example

```
python -m dlunch panel/gui=major_release
```

will alter some graphic elements to show a release banner.

## Docker
A _Docker_ image with Data-Lunch is available [here](https://hub.docker.com/r/michelealberti/data-lunch-app).
