-
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 #31 from karlomikus/develop
Merge v102
- Loading branch information
Showing
23 changed files
with
802 additions
and
505 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ This application is made with Laravel, so you should check out [deployment requi | |
The basic requirements are: | ||
|
||
- PHP >= 8.1 | ||
- GD Extension | ||
- Sqlite 3 | ||
- Working [Meilisearch server](https://github.com/meilisearch) instance (v0.29) | ||
- (Optional) Redis server instance | ||
|
@@ -79,6 +80,33 @@ Docker image exposes the `/var/www/cocktails/storage` volume, and there is curre | |
|
||
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. | ||
|
||
### Database file backup | ||
|
||
You can copy the whole .sqlite file database with the following: | ||
|
||
``` bash | ||
# Via docker | ||
$ docker cp bar-assistant:/var/www/cocktails/storage/database.sqlite /path/on/host | ||
|
||
# Via docker compose | ||
$ docker compose cp bar-assistant:/var/www/cocktails/storage/database.sqlite /path/on/host | ||
``` | ||
|
||
### Database dump SQL | ||
|
||
You can dump your database to .sql file using the following: | ||
|
||
``` bash | ||
# Via cli | ||
$ sqlite3 /var/www/cocktails/storage/database.sqlite .dump > mydump.sql | ||
|
||
# Via docker | ||
$ docker exec bar-assistant sqlite3 /var/www/cocktails/storage/database.sqlite .dump > mydump.sql | ||
|
||
# Via docker compose | ||
$ docker compose exec bar-assistant sqlite3 /var/www/cocktails/storage/database.sqlite .dump > mydump.sql | ||
``` | ||
|
||
## Manual setup | ||
|
||
After cloning the repository, you should do the following: | ||
|
@@ -117,6 +145,9 @@ $ php artisan migrate --force | |
|
||
# To fill the database with data | ||
$ php artisan bar:open | ||
|
||
# Or with specific email and password | ||
$ php artisan bar:open [email protected] --pass=12345 | ||
``` | ||
|
||
## Usage | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kami\Cocktail\Scraper; | ||
|
||
trait HasJsonLd | ||
{ | ||
public function parseSchema(): ?array | ||
{ | ||
$jsonLdSchema = $this->crawler->filterXPath('//script[@type="application/ld+json"]')->first()->text(); | ||
|
||
return json_decode($jsonLdSchema, true); | ||
} | ||
} |
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
Oops, something went wrong.