This is a demo that shows how you can use Typesense, along with Laravel, in order to build a search index using real data from a Postgres data store.
The app was built using Laravel Sail, a lightweight CLI for Laravel development using Docker, Laravel Scout's Typesense module, and Inertia.js for building a React frontend with Typescript support, along with the Typesense Adapter for react-instantsearch.
To run this project locally, check out the .env.example
file for the environment variables you'll need to configure, install the dependencies and start the Docker images:
./vendor/bin/sail up
Then apply the migrations:
./vendor/bin/sail sail artisan migrate
And source the Database:
./scripts/sourcedb.sh
After which you'll need to index Typesense using Laravel Scout:
sail artisan scout:import "App\Models\Game"
And finally spin up your server instance:
./vendor/bin/sail yarn run dev
./vendor/bin/sail artisan serve
Open http://localhost to see the app.
For more information, please consult both the Typesense Documentation and Laravel Scout's Documentation as well.
The dataset used in this showcase is from Terenci Claramunt's (@terencicp) public dataset of Steam Games released from 2013 up to 2023 listed here: https://www.kaggle.com/datasets/terencicp/steam-games-december-2023