This demo uses the typesense-dart client and flutter infinite_scroll_pagination. The dataset is available on Kaggle.
├── 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
To run this project locally, make sure you have flutter SDK installed:
cd cli
flutter pub get
#Start typesense server
docker compose up
#Index data into typesense
dart index_typesense.dart
Start developing
flutter pub get
flutter run --dart-define-from-file=.env
Set env variables in .env
file to point the app to the Typesense Cluster
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:
TYPESENSE_ADMIN_API_KEY=xyz
FORCE_REINDEX=false