Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/typesense/showcase-address-autocomplete
Demo that shows how to build an address autocomplete experience with Typesense. Alternative for Algolia Places and Google Maps API
https://github.com/typesense/showcase-address-autocomplete
address-autocomplete address-search algolia-places typesense
Last synced: about 2 months ago
JSON representation
Demo that shows how to build an address autocomplete experience with Typesense. Alternative for Algolia Places and Google Maps API
- Host: GitHub
- URL: https://github.com/typesense/showcase-address-autocomplete
- Owner: typesense
- License: apache-2.0
- Created: 2024-05-23T15:55:53.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-17T20:44:38.000Z (6 months ago)
- Last Synced: 2024-06-17T22:52:19.673Z (6 months ago)
- Topics: address-autocomplete, address-search, algolia-places, typesense
- Language: Jupyter Notebook
- Homepage: https://address-autocomplete.typesense.org
- Size: 93.8 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Address Autocomplete - powered by Typesense πΊοΈ π
This demo shows you how to build an Address autocomplete experience, similar to what you see commonly on address form fields, using Typesense, which is an open source alternative to Algolia.
This is a good alternative to Algolia Places (which was sunset) and also an alternative to Google Maps API (which tends be very expensive).
The dataset is from [OpenAddresses](https://www.kaggle.com/datasets/openaddresses/openaddresses-us-northeast).
## Get started
To run this project locally:
Start the typesense server
```shell
docker compose up
```Index data into typesense
```shell
export TYPESENSE_API_KEY='xyz'
export TYPESENSE_URL='http://localhost:8108'curl "${TYPESENSE_URL}/debug" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"curl "${TYPESENSE_URL}/collections" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"name": "addresses_boston",
"fields": [
{"name": "postcode", "type": "string" },
{"name": "address", "type": "string" }
]
}'curl "${TYPESENSE_URL}/collections/addresses_boston/documents/import?action=create" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-X POST \
-T ./data/boston-addresses.jsonl
```Open the `index.html` file in the root of this repo in a web browser.