-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from karlomikus/develop
Next version
- Loading branch information
Showing
34 changed files
with
2,029 additions
and
776 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,11 @@ | |
|
||
## 🍸 Bar assistant | ||
|
||
Bar assistant is a self hosted application for managing your home bar. It allows you to add ingredients and create custom cocktail recipes. | ||
Bar assistant is a self hosted application for managing your home bar. It allows you to add your ingredients, search for cocktails 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](https://github.com/karlomikus/vue-salt-rim). | ||
|
||
Note: This application is still in development and there will be breaking changes and loss of data. I do not recommend using this in a "production" environment until a stable version is released. | ||
|
||
## Features | ||
|
||
- Includes all current IBA cocktails | ||
- Over 100 ingredients | ||
- Endpoints for managing of ingredients and cocktails | ||
|
@@ -26,32 +23,55 @@ Note: This application is still in development and there will be breaking change | |
- Ability to upload and assign images | ||
- Shopping list for missing ingredients | ||
- Automatic indexing of data in Meilisearch | ||
- Cocktail ingredient substitutes | ||
- Assign glass types to cocktails | ||
|
||
## Planned features | ||
|
||
- Cocktail recipe sharing | ||
- Cocktail and shopping list printing | ||
- User defined cocktail collections | ||
- Cocktail ratings | ||
- Add user notes to cocktail | ||
- Add cocktail flavor profiles | ||
- Ingredient and cocktail aliasing | ||
- Ingredient substitutes | ||
- Cocktail recipe scraping | ||
- Importing and exporting cocktails | ||
|
||
## Installation | ||
|
||
This application is made with Laravel, so you should [follow installation instructions](https://laravel.com/docs/9.x/deployment) for a standard Laravel project. | ||
This application is made with Laravel, so you should check out [deployment requirements](https://laravel.com/docs/9.x/deployment) for a standard Laravel project. | ||
|
||
### Requirements: | ||
The basic requirements are: | ||
|
||
- PHP >=8.1 | ||
- PHP >= 8.1 | ||
- Sqlite 3 | ||
- Working [Meilisearch server](https://github.com/meilisearch) | ||
- Working [Meilisearch server](https://github.com/meilisearch) instance | ||
- (Optional) Redis server instance | ||
|
||
## Docker setup | ||
|
||
Docker setup is the easiest way to get started. This will run only the server but you can [checkout how to setup the whole Bar Assistant stack here.](https://github.com/bar-assistant/docker) | ||
|
||
``` bash | ||
$ docker volume create bass-volume | ||
|
||
$ docker run -d \ | ||
--name bar-assistant \ | ||
-e APP_URL=http://localhost:8000 \ | ||
-e MEILISEARCH_HOST=http://localhost:7700 \ | ||
-e MEILISEARCH_KEY=masterKey \ | ||
-e REDIS_HOST=redis \ | ||
-v bass-volume:/var/www/cocktails/storage \ | ||
-p 8000:80 \ | ||
kmikus12/bar-assistant-server | ||
``` | ||
|
||
Docker image exposes the `/var/www/cocktails/storage` volume, and there is currently and issue with host permissions if you are using a local folder mapping. | ||
|
||
### Meilisearch | ||
|
||
Bar Assistant is using Meilisearch as a primary Scout driver. It's used to index cocktails and ingredients used for filtering and full text search. | ||
Bar Assistant is using Meilisearch as a primary [Scout driver](https://laravel.com/docs/9.x/scout). It's main purpose is to index cocktails and ingredients and power filtering and searching on the frontend. Checkout [this guide here](https://docs.meilisearch.com/learn/cookbooks/docker.html) on how to setup Meilisearch docker instance. | ||
|
||
### Setup | ||
## Manual setup | ||
|
||
After cloning the repository, you should do the following: | ||
|
||
|
@@ -68,6 +88,12 @@ APP_URL= | |
MEILISEARCH_HOST= | ||
# Meilisearch search key | ||
MEILISEARCH_KEY= | ||
# If using redis, the following | ||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
CACHE_DRIVER=redis | ||
SESSION_DRIVER=redis | ||
``` | ||
|
||
2. Run the commands | ||
|
@@ -79,32 +105,23 @@ $ php artisan key:generate | |
$ php artisan storage:link | ||
|
||
# To setup the database: | ||
$ php artisan migrate | ||
$ php artisan migrate --force | ||
|
||
# To fill the database with data | ||
$ php artisan bar:open | ||
``` | ||
|
||
Default login information is: | ||
## Usage | ||
|
||
Checkout `/docs` route to see endpoints documentation. | ||
|
||
Default login information is: | ||
- email: `[email protected]` | ||
- password: `password` | ||
|
||
## Docker | ||
|
||
[Also checkout how to setup the whole Bar Assistant stack here.](https://github.com/karlomikus/vue-salt-rim#docker-compose) | ||
|
||
``` bash | ||
docker run -d \ | ||
-e APP_URL=http://localhost:8080 \ | ||
-e MEILISEARCH_HOST=http://localhost:7700 \ | ||
-e MEILISEARCH_KEY=maskerKey \ | ||
kmikus12/bar-assistant-server | ||
``` | ||
|
||
## Contributing | ||
|
||
TODO | ||
TODO, Fork and create a pull request... | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Kami\Cocktail\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Kami\Cocktail\SearchActions; | ||
use Illuminate\Support\Facades\Artisan; | ||
|
||
class BarSearchRefresh extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'bar:refresh-search'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Refresh search index'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int | ||
*/ | ||
public function handle() | ||
{ | ||
// Clear indexes | ||
// SearchActions::flushSearchIndex(); // TODO: Create method to import site_index | ||
$this->info('Removing cocktails and ingredients index...'); | ||
Artisan::call('scout:flush', ['model' => "Kami\Cocktail\Models\Cocktail"]); | ||
Artisan::call('scout:flush', ['model' => "Kami\Cocktail\Models\Ingredient"]); | ||
|
||
// Update settings | ||
$this->info('Updating index settings...'); | ||
SearchActions::updateIndexSettings(); | ||
|
||
$this->info('Importing cocktails and ingredients...'); | ||
Artisan::call('scout:import', ['model' => "Kami\Cocktail\Models\Cocktail"]); | ||
Artisan::call('scout:import', ['model' => "Kami\Cocktail\Models\Ingredient"]); | ||
|
||
return Command::SUCCESS; | ||
} | ||
} |
Oops, something went wrong.