Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-typesense-app npm package

Typo-tolerant Typesense search, running locally, in one command.

Next.js installed, the server reporting healthy, 9979 books indexed, and "hary potr" finding Harry Potter

Compatibility note: Requires Node.js 22+. Docker is optional. Without it, point at a Typesense you already run or a Typesense Cloud cluster.

Scaffolding your first search app

With NPM:

npm create typesense-app@latest

Or with npx:

npx create-typesense-app@latest

Then follow the prompts!

To skip them, pass a directory and --yes:

# npm 7+, extra double-dash is needed:
npm create typesense-app@latest my-search-app -- --yes
cd my-search-app
npm run dev

Type hary potr. It finds Harry Potter.

Options

-t, --template <id>   nextjs | qwik | solid | vanilla
    --dataset <name>  books (default) | empty
    --port <number>   host port for the local server (default 8108)
-y, --yes             take the defaults, no prompts
-h, --help            show this
-v, --version         print the version

Templates

id Stack
nextjs Next.js + react-instantsearch
qwik Qwik + instantsearch.js, bundled by Vite
solid SolidJS + instantsearch.js connectors, bundled by Vite
vanilla Vanilla JS + instantsearch.js, bundled by Vite

Both give you the same app. A template is a manifest plus a file overlay, so adding one touches nothing else. See templates/README.md.

What you get

  • A search box, hits with covers, and one facet
  • Typesense in Docker, CORS already configured
  • ~10,000 books indexed
  • A schema and a seed script, short and commented, in the template's language
  • A search-only API key in the browser, scoped to documents:search on one collection. The admin key stays server-side and never gets the public prefix.

Scripts

Script Does
npm run seed rebuilds the collection, and restores the search key if it went missing
npm run typesense:up starts the server
npm run typesense:down stops it, keeping your data

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages