This search experience is powered by Typesense which is a blazing-fast, open source typo-tolerant search-engine. It is an open source alternative to Algolia and an easier-to-use alternative to ElasticSearch.
/
├── typesense/
│ ├── compose.yml # help you setup the typsesense server with default data
│ ├── default_data.jsonl
│ ├── Dockerfile
│ └── entrypoint.sh
└── app/
└── src/main/java/com/example/showcase_soccer_matches_search_kotlin_compose/
├── components
├── ...
└── utils
└── typesense.kt # Typesense client
To run this project locally, make sure your Typesense server is started:
- Update the Typesense server in the Dockerfile
ENV TYPESENSE_DATA_DIR=/data
ENV TYPESENSE_API_KEY=xyz
ENV TYPESENSE_PORT=8108
ENV COLLECTION_NAME=soccer_matches
cd typesense
# Start typesense server
docker compose up
-
Update the Typesense client here with your Typesense hostname ()
nodes.add( Node( "http", "192.168.10.202", // your Typesense hostname "8108" ) ) val config = Configuration(nodes, Duration.ofSeconds(2), "xyz") // your Typesense API key
IN A PRODUCTION, YOU WANT TO HAVE AN AUTHENTICATED BACKEND API ENDPOINT THAT RETURNS THE HOSTNAMES AND API KEYS, INSTEAD OF HARD-CODING IT IN THE APP
- Then run the app