https://github.com/andrewohnsland/cocktailberry-stats
WebApp with API and endpoint for CocktailBerry. Have insights into made cocktails.
https://github.com/andrewohnsland/cocktailberry-stats
cocktail cocktailberry cocktails deta python streamlit
Last synced: 6 months ago
JSON representation
WebApp with API and endpoint for CocktailBerry. Have insights into made cocktails.
- Host: GitHub
- URL: https://github.com/andrewohnsland/cocktailberry-stats
- Owner: AndreWohnsland
- License: mit
- Created: 2022-03-11T12:45:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-05-24T06:44:37.000Z (about 1 year ago)
- Last Synced: 2025-05-24T07:35:53.130Z (about 1 year ago)
- Topics: cocktail, cocktailberry, cocktails, deta, python, streamlit
- Language: Python
- Homepage: https://stats-cocktailberry.streamlit.app/
- Size: 5.79 MB
- Stars: 7
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README






[](https://sonarcloud.io/summary/new_code?id=AndreWohnsland_CocktailBerry-WebApp)

[](https://www.buymeacoffee.com/AndreWohnsland)
WebApp with API and endpoint for [CocktailBerry](https://github.com/AndreWohnsland/CocktailBerry). Have insights into made cocktails.
## Getting Started
### Installing Dependencies
We use [Astral UV](https://docs.astral.sh/uv/) to manage dependencies and run the applications:
```bash
uv sync --all-packages
```
### Running the Application
```bash
# omit uv run if using normal python
uv run uvicorn app:app --reload # backend -> cd backend first
uv run streamlit run streamlit_app.py # frontend, use in main folder
```
If you want to have everything working, you will need to set up a mongodb, which can be done locally (docker) or with a cloud provider.
Copy the `.env.example` in both folders as a `.env` file and change the url dummy to your mongo db url:
```bash
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
```
Using `DEBUG=1` in the env files will enable some dev features, like the creation of an additional `*_dev` database to let you test anything without changing your main one.
The `BACKEND_URL` defaults to localhost (http://127.0.0.1:8000), where the backend runs locally.
If you deploy backend and frontend on two different places (like streamlit share and deta space), you need to set this variable in the frontend accordingly.
For detailed instruction for deployment, please refer to the according docs of your provider.
## Architecture
In this project, a self hosted web server is used to host the backend.
Currently, streamlit share is used to host the backend, but it can be easily deployed to any other provider.
The WebApp can be accessed freely over any browser.
The API is protected an can be only accessed with an according API key to prevent unauthorized access.
To get an API key for your [CocktailBerry](https://github.com/AndreWohnsland/CocktailBerry) machine follow the instructions on the website.
Alternatively, you can clone this repo, set up your own dashboard with backend and use the according hook endpoint and header values with the CocktailBerry microservice for your own, private dashboard.

## Access
Simply go to the [site](https://stats-cocktailberry.streamlit.app/) and have nice insight into the data.
If you have build your [CocktailBerry](https://github.com/AndreWohnsland/CocktailBerry) and use the official software, you can get an API key for CocktailBerry to use the provided endpoint to submit your production data. This way, you can actively participate. 🙌
Also, if you directly just want the data for the last 24 hours, for example if you want to give your guest insights in the current developments of the cocktail stats, there is the possibility to add the `?partymode=true` query parameter to the url.
This will cause the "Only Show last 24h Data" checkbox to be checked by default.