Uvacoder / CocktailBerry-WebApp

WebApp with API and endpoint for CocktailBerry. Have insights into made cocktails.

Home Page:https://stats-cocktailberry.streamlit.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CocktailBerry

GitHub release (latest by date) GitHub Release Date Python Version GitHub GitHub issues Quality Gate Status GitHub Repo stars

Support CocktailBerry

WebApp with API and endpoint for CocktailBerry. Have insights into made cocktails.

Getting Started

Either cd into frontend or backend and run pip install -r requirements.txt or use poetry in main folder to install everything for both apps with poetry install. Then in the corresponding folder run:

# omit poetry run if using normal python
poetry run uvicorn main:app --reload # backend
poetry run streamlit run streamlit_app.py # frontend, use in main folder

If you want everything to work properly, you need a deta space account and a collection access token (go to Space>Collection>Your Collection>Collection Settings>Generate Token). Deta is used for Deta Collection e.g. storing of the data and for the later deployment of the API. Don't worry it's free (and will always be that way, according to deta). Copy the .env.example in both folders as a .env file and change the token dummy to your project access token:

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, Deta was used for the hosting. 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 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.

ProgramSchema

Access

Simply go to the site and have nice insight into the data. If you have build your 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.

About

WebApp with API and endpoint for CocktailBerry. Have insights into made cocktails.

https://stats-cocktailberry.streamlit.app/

License:MIT License


Languages

Language:Python 98.9%Language:CSS 1.1%