An open API service indexing awesome lists of open source software.

https://github.com/typesense/showcase-nba-players-search-flutter


https://github.com/typesense/showcase-nba-players-search-flutter

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          


🏀 Search NBA players' stats, powered by Typesense & flutter


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.



This demo uses the typesense-dart client and flutter infinite_scroll_pagination.
The dataset is available on Kaggle.

## Project Structure

```bash
├── cli/
│ ├── data/
│ │ └── nba_players.jsonl
│ ├── compose.yml
│ └── index_typesense.dart # index data from nba_players.jsonl into typesense server
└── src/
├── models/
│ └── ...
├── widgets/
│ └── ...
├── utils/
│ └── typesense.dart # typesense client config
└── main.dart # nba players search
```

## Development

To run this project locally, make sure you have flutter SDK installed:

```shell
cd cli
flutter pub get
#Start typesense server
docker compose up

#Index data into typesense
dart index_typesense.dart
```

Start developing
```shell
flutter pub get
flutter run --dart-define-from-file=.env
```

## Environment

Set env variables in `.env` file to point the app to the Typesense Cluster

```env
TYPESENSE_HOST=localhost # use your internet IPv4 address when developing on mobile
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_SEARCH_ONLY_API_KEY=xyz
```

Only for indexing:

```env
TYPESENSE_ADMIN_API_KEY=xyz
FORCE_REINDEX=false
```