An open API service indexing awesome lists of open source software.

https://github.com/13bytes/labfooddesk

LabEats allows a group of people to manage money in combination with item-sales, procurement and group-orders in a moderated prepaid fashion
https://github.com/13bytes/labfooddesk

group-ordering nextjs t3-stack tailwindcss typescript

Last synced: 12 months ago
JSON representation

LabEats allows a group of people to manage money in combination with item-sales, procurement and group-orders in a moderated prepaid fashion

Awesome Lists containing this project

README

          

# LabEats
**LabEats allows a group of people to manage money in combination with item-sales, procurement and group-orders in a moderated prepaid fashion.**

A tool to manage (food)(orders) in the Aerospace Lab (an awesome club in Germany).\
It is designed with our club in mind, but can surely be adapted to fit more needs.

## Overview
**"Kaufen":** Allows users to buy items which are already present (e.g. a beverages).

**"Gruppen-Kauf":** Allows users to join a group-order for one fixed event.
After a specified deadline, one user can close the ordering-process (e.g. to buy the pre-ordered amount).
After this, the price of the whole purchase can be split up between the participants in an arbitrary fashion.

**"Split" & "Aufladen":** Allows users to transfer money.\
The system is designed the following:\
There exists a group of trusted users which are allowed to overdraw their accounts.
All other users can only spend their prepaid credit - which they obtain by giving the trusted users money in the real world.

**"Konto":** Every transaction is logged and can be viewed here.

**Admin-Functionality:**
- Users are authenticated against LDAP (with additional magic links for development).
- All items can have a percentual and/or fixed additional fee which can be tracked on special clearing accounts.
- Users can be compensated for procurement from those special clearing accounts as well as from the "main account"

## Deployment
deployment via [docker compose](https://docs.docker.com/compose/)

- copy `docker-compose.yml` onto the server. Set `ENABLE_PRISMA_STUDIO`.
- copy `.env.example` onto the server and rename it to `.env` - fill in details accordingly.
- copy the `./nginx` folder from the repo and create file `./nginx/prismaStudio-htpasswd`.
- _if prisma studio is enabled:_ add entrie(s) to htpasswd. A example can be found in `prismaStudio-htpasswd.example`
- `docker compose up -d`

The docker image will publish LabEats on Port **3000**.\
This port should be deployed behind a reverse-proxy handling HTTPS.
`ENABLE_PRISMA_STUDIO=true` will also run a frontend for the database on port **5556**.\
Only secured by basic HTTP auth (set in `./nginx/prismaStudio-htpasswd`), this port should not be open to the public!

## Development

This is a NextJS project. Some file-conventions apply.

Start Developing:
`npm run dev`

Update types based on current schema:
`npx prisma generate`
- Create TS (prisma) types `import { prisma } from "~/server/db"`
- Creates zod-schemas in `import { mySchema } from '/prisma/generated/zod';`

Update dev-db (might lose data)
`npx prisma db push`

Create DB Migrations (for production)
`npx prisma migrate dev`

### Open ToDos
- Automatisches abmelden aller Accounts nach update (via changes)
- Android Zahlentastatur Komma ausgeblendet
#### Nice Improvements:
- Item-Page: Item-Reihenfolge anpassbar machen (persistent)
- Item-Page: Kategorie-filter für user persistieren
- Gruppen-Split
- Verrechnungskonten-Auszahlung für Admins auch selbst möglich
- Gruppen-Kauf auf eine/mehrere Kategorien beschränken
- Personen einen "Projekt-Tag" geben
- Verrechnungkonten global anzeigen
- Vorbesteller-Items mit Fix-Preis (Default-Feld vorausfüllen)
- Ofengebühr für mehrfachbestellungen optional deaktivieren
- write test-cases (https://www.prisma.io/docs/orm/prisma-client/testing/integration-testing)

---

## Questions & Contact

Stuck somewhere? Or you want to adopt LabEats to your needs? \
You can contact me at coding@13bytes.de or create a [issue](https://github.com/13Bytes/LabFoodDesk/issues).