This demo showcases Typesense's Geo Search features in a Next.js project.
- Node.js 20.x and npm
- Typesense server. Can be hosted locally using the
docker-compose.yml
file in the repository, instructions in Local Setup section. - sqlite3
-
Clone the project.
-
Install dependencies at the root of the project using npm.
npm install
-
(Optional) To run a local instance of Typesense server using the
docker-compose.yml
config in this repository, run the following command.docker compose up -d
Note: This requires Docker to be installed on the system.
-
Copy
.env.example
file and create a.env
file at the root of the project. -
Set the values of required environment variables in the
.env
file that was created. -
Download the airports dataset from https://ourairports.com/data/ in CSV format under
dataset/source
directory.
Following CSV files are required:- airports.csv
- runways.csv
- countries.csv
- regions.csv
-
Seed the Typesense database with the airports data by running the following command at the root of the project.
npm run data:seed
This command may take a while depending on the size of the data.
-
Once the Typesense database has been seeded, Next.js application can be started.
- For production:
npm run build npm start
- For development:
npm run dev
- For production:
-
Access the application at
localhost:3000
.
This project is licensed under Apache License 2.0.
The airports dataset used is by ourairports.com and relased under Public Domain.