Git Product home page Git Product logo

bar-assistant's Introduction

Bar assistant Logo

Docker image Docker image Tests

๐Ÿธ Bar Assistant

Bar Assistant is a self hosted application for managing your home bar. It allows you to search and filter cocktails, add ingredients and create custom cocktail recipes.

This repository only contains the API server, if you are looking for easy to use web client, take a look at Salt Rim.

Click here to view API demo.
Click here to view frontend demo.
Email: [email protected] ยท Password: password

Features

  • Includes over 300 cocktail recipes with detailed information
  • Includes over 150 base ingredients with categories
  • Add and manage multiple bars and bar members
  • Fine-grained user control with user roles
  • Endpoints for managing and filtering ingredients and cocktails
  • Filter recipes by ABV, base ingredient, tags and more
  • Filter recipes based on whether you have the right ingredients or not
  • Detailed cocktail and ingredient information
  • Support for assigning multiple images to resources and image sorting
  • Shopping list generation based on missing ingredients in your inventory
  • Automatic indexing of data with Meilisearch
  • Support for custom cocktail ingredient substitutes
  • Support for glass types, utensils, tags, ingredient categories and more
  • Cocktail recipe importing via URL, JSON, YAML or custom collections
  • Support for cocktail ratings
  • Create user-specific cocktail collections for easy referencing and sharing
  • Support for cocktail and ingredient notes
  • Supports sharing recipes by public links, custom recipe images and printing
  • Create public bar menus
  • Manage custom API personal access tokens with custom permissions set by users
  • Detailed statistics about recipes and user tastes

Cloud

Visit barassistant.app for more information about our cloud offering.

Cloud offering screenshot

Documentation

Documentation is available here.

Contributing

Contributions Welcome!

For more details, see CONTRIBUTING.md.

License

The Bar Assistant API is open-sourced software licensed under the MIT license.

bar-assistant's People

Contributors

augustf avatar dependabot[bot] avatar j-ha avatar karlomikus avatar tempelgogo avatar zdenek-biberle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bar-assistant's Issues

Error When Trying to Login (JSON)

Attempt to login or register results in the following error:
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

A red box with this message appears on top of the Salt Rim login page. Using docker-compose on a Linux server, Ubuntu 22.04LTS.

Here is my docker-compose file:

#version: "3"

services:
  # Setup Meilisearch instance
  meilisearch:
    image: getmeili/meilisearch:v0.29
    environment:
      - MEILI_MASTER_KEY=$MEILI_MASTER_KEY
      - MEILI_ENV=production
    restart: unless-stopped
    ports:
      - 7700:7700
    volumes:
      - ba-meilidata:/meili_data

  # Redis for session and file cache
  redis:
    image: redis
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    restart: unless-stopped

  # Bar Assistant API
  bar-assistant:
    image: kmikus12/bar-assistant-server
    depends_on:
      - meilisearch
      - redis
    environment:
      - APP_URL=$API_URL
      - MEILISEARCH_KEY=$MEILI_MASTER_KEY
      - MEILISEARCH_HOST=$MEILI_HOST
      - REDIS_HOST=redis
    restart: unless-stopped
    volumes:
      - ba-storage:/var/www/cocktails/storage
    ports:
      - 8001:80

  # Bar Assistant Client
  salt-rim:
    image: kmikus12/salt-rim
    depends_on:
      - meilisearch
      - bar-assistant
    environment:
      - API_URL=$API_URL
    restart: unless-stopped
    ports:
      - 12005:8080

volumes:
  ba-meilidata:
  ba-storage:

Reverse Proxy cannot connect to Bar Assistant

Hopefully this is just a config issue on my end but I am hoping you might be able to clarify for me. So I setup the docker build provided in your documentation and got everything working as required and I was able to login using the server URL [http://myserver.local:8080]. When I setup my reverse proxy and pointed to said address and I go to the site I get:

Bar Assistant server:
http://myserver.local:8000
Status: Not available

However the URL http://myserver.local:8080 works just fine. I am guessing there is some special configuration that I need to apply to allow access to port 8000 for the bar-assistant server.

Also a couple of notes about your Complete Docker Install.

  1. The default login that is listed doesn't work. I registered a user and then from the server side promoted that user to admin.
  2. Not sure why but when I specified localhost in the environment variables I got a Not Available message. When I updated to the server DNS name it started connecting. I a guessing this is because its not running on my local machine

Missing Data

I've setup a new docker install. When I create an ingredient or cocktail, it does show "1 ingredient" on the home screen, but when I click on that the Ingredients page is empty. I can't figure out whats going on here, any ideas?

Feature Request - Scrape PUNCH

https://punchdrink.com is a very well respected resource for classic and modern cocktail specifications. Consider scraping this site if you can. Most current bartenders consider The IBA Official Cocktail Specifications can be wrong/outdated for today's tastes. Just something to consider.

Add shelf cocktails endpoint

Should return array with cocktail ids that user can make.

Can be used to implement shelf cocktails refinement on client side.

Users improvement

Currently the main use case of this API is single user in self hosted env.

To improve on that we should add:

  • Add user type: Admin,User
  • Implement generating multitenancy meilisearch tokens
  • Add user management for admin users
    • Add /users endpoint to manage users
  • Add user_id column to images table

Add coffee support

Coffee section:

  • Coffee

    • Origin
    • Roast level
    • Region
    • Variety
    • Process
    • Flavor profile
  • Coffee recipes

    • Time
    • Weight
    • Coffee
    • Temperature
    • Brew method
    • water
    • Grinder
      • Grind size
    • Ratio
  • Brew methods

  • Grinders

    • Name
    • Manufacturer

Cocktail Recipe Variations

Hi, I am currently testing this out on my own local instance running in k8s and have been enjoying it so far.

One of the features that I think would be great if it could be added would be to allow for cocktail recipe variations (eg. IBA variant + my own personal variant on the cocktail) that way instead of having to have 2 cocktails representing the same cocktail, I can instead have 1 cocktail with 2 variants

Show cocktails with similar ingredients

Implement endpoint that takes cocktail_id and returns all cocktails that have same ingredients except 1-2 ingredients.

eg related cocktails:

Cocktail A: gin, vermouth, bitters
Cocktail B: vodka, vermouth, bitters

Implement recipe sharing

Share cocktail recipes using QR codes.

Share generated image of cocktail with the steps and QR code.

Existing cocktails?

After doing a clean install with docker-compose i was expecting the "Includes all current IBA cocktails" on the salt-rim webpage. However it is completely empty? Am i missing something or arent there recipes included?

Thanks!

Docker image improvements

  • Switch to PHP-FPM image variant
  • Include meilisearch instance in base BA image
  • Add empty volume for BA data
    • Move uploads folder and db file to this folder
  • Add nginx as default reverse proxy
  • Add services by path in a another nginx instance
    • /search for meilisearch, /bar for api
    • Update code to handle this changes
  • Use nginx to serve static files for salt-rim
  • [Optional] Create a single container image based on alpine

This should hopefully simplify deployment.

Related issues: #12 #26 #37 #50 #59

bar-assistant/docker#2

Add more filtering methods

By protocol:

  • Shake
  • Stirred
  • Build

By serving:

  • Up
  • Crushed ice

By strength:
Calculate ABV and use it to tag cocktail's strength

  • Light
  • Medium
  • Strong

By base ingredient

Bug - Show More Cocktails Button

Steps to reproduce Bug:

  1. Click Cocktails
  2. Scroll all the way down
  3. Click the "Show more results" button
  4. Scroll all the way down again
  5. I have more cocktails to display but there is no "Show more results" button to display them. I've only hit the "S" cocktails at this point.

[Feature Request] Reverse Proxy enchancement

Hi. I'm not sure if this should be logged here or on the BA GH.

However would it be possible to make it, so you only need to reverse proxy the GUI frontend and not also have to RP the BA server and Meilsearch. This would be much better from a security standpoint as well if exposing the instance publicly which I would like to do

Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80

My docker compose snippet for bar assistant:

  bar-assistant:
    image: kmikus12/bar-assistant-server:v1.0.4
    container_name: bar-assistant
    depends_on:
      - meilisearch
      - meili-redis
    environment:
      - APP_URL=http://<IP Address>:8900
      - MEILISEARCH_KEY=<$MEILI_MASTER_KEY>
      - MEILISEARCH_HOST=http://<IP Adddress>:7700
      - REDIS_HOST=redis
    restart: unless-stopped
    volumes:
      - /volume2/docker/bar/ba:/var/www/cocktails/storage
    ports:
      - 8900:80

Log:

AH00015: Unable to open logs
Updating search index settings...
Syncing cocktails and ingredients to meilisearch...
Adding routes and config to cache...
   INFO  Configuration cached successfully.  
   INFO  Routes cached successfully.  
Application ready!
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

Please can you advise where I've gone wrong? Tried both 1.0.5 and 1.0.4

Server Error when creating new Cocktail

I did a fresh install using the deocumented Docker approach. Everything worked fine: could create new users, deleted the default user, was able to create new ingredients and uploading their pictures. However, when creating a new cocktail, I just get a pop-up saying "Server Error" as soon as I click on the "Save" button. To test, I tried to edit an existing recipe. This worked fine.

What could be the reason that I can change existing recipes of cocktails, can create new ingredients, but can not create a cocktail?

import cocktails programatically

Describe the bug
There used to be a way to import cocktails from external websites directly from the backend. It has been removed from the README.md recently. However it doesn't work currently. I can import cocktails through the web UI. From the backend, such an error is thrown:

[2023-03-08 20:52:11] production.INFO: [IMAGE_SERVICE] Image created with id: 450
Undefined array key "sort

To Reproduce
docker exec -it bar-assistant php artisan bar:scrape https://tuxedono2.com/coco-no-coco-cocktail-recipe
Versions:
podman v4.4.1

Cocktails I can make filter not working: invalid_search_filter

Hello, on my instance the "cocktails I can make" filter is not working and produce an error.

The request is a POST on /search/indexes/cocktails/search that returns a 400

Request payload:

{"q":"","facets":["tags","user_id","has_public_link","average_rating","main_ingredient_name","method","glass"],"attributesToHighlight":["*"],"highlightPreTag":"__ais-highlight__","highlightPostTag":"__/ais-highlight__","limit":101,"filter":["id IN [[object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object]]"],"sort":["name:asc"]}

Request response:

{"message":"Expected only comma-separated field names inside `IN[..]` but instead found `[object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object]]`.\n8:143 id IN [[object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object]]","code":"invalid_search_filter","type":"invalid_request","link":"https://docs.meilisearch.com/errors#invalid_search_filter"}

v1.0.0 Checklist

  • Finish OpenApi specification
  • Include substitute ingredients when showing what cocktails a user can make
  • Test docker up/down with database migrations and seeding
  • Add the most "popular" cocktails
  • Check performance issues (opcache/remove file session)
  • Add command to reset search indexes
  • Preselect some default ingredients for new deploys
  • Add demo environment
    • Generate specific api key for meilisearch

Add dashboard stats

  • 5 Most popular ingredients
  • Total cocktails
  • Total ingredients
  • 5 Top rated cocktails
  • Total favorited cocktails

Error when running the migrate command, database file does not exist

Describe the bug
running the
docker compose exec app php artisan migrate
command return an error that
Database file at path [/var/www/cocktails/storage/bar-assistant/database.sqlite] does not exist. Ensure this is an absolute path to the database. (Connection: sqlite, SQL: PRAGMA foreign_keys = ON;)

To Reproduce
run the above command

Versions:
Client:
Cloud integration: v1.0.31
Version: 20.10.23
API version: 1.41
Go version: go1.18.10
Git commit: 7155243
Built: Thu Jan 19 17:35:19 2023
OS/Arch: darwin/amd64
Context: desktop-linux
Experimental: true

Server: Docker Desktop 4.17.0 (99724)
Engine:
Version: 20.10.23
API version: 1.41 (minimum version 1.12)
Go version: go1.18.10
Git commit: 6051f14
Built: Thu Jan 19 17:32:04 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.