Skip to content

[FEAT]: Generic search UI, read-only existing servers and 4 new templates - #7

Open
Nikhiladiga wants to merge 16 commits into
masterfrom
feat/generic-search-ui-and-templates
Open

Nikhiladiga wants to merge 16 commits into
masterfrom
feat/generic-search-ui-and-templates

Conversation

@Nikhiladiga

Copy link
Copy Markdown
Collaborator

Change Summary

  • Generic search UI: every template reads typesense.config.json (schema + what to search, filter and show), so the UI works with any collection, not only books.
  • Search your own Typesense server, read-only: --server-url, --collections, --api-key-stdin. Several collections and aliases, with one query to all of them. The CLI never changes the server.
  • Key safety: the browser gets the key you give, so the CLI refuses admin keys and keys that can write. In a terminal it keeps asking until the key works, and explains why each key was refused.
  • 4 new templates: React, Vue, SvelteKit, Angular (8 in total), all with the Typesense Cloud look.
  • Local server: port check before anything starts, unique container names per project, admin key check after /health.
  • After the run, the CLI starts the dev server and opens the browser (not with --yes).
  • Security fix: the env file is added to .gitignore when the starter does not ignore it (Vite and Angular starters did not).
  • Tooling: Biome, a Husky pre-push check, a CI workflow, npm run e2e per template, and a new test suite grouped by feature (51 tests, one against a real Typesense in Docker).
  • Docs and npm: rewritten README and template docs, re-recorded demo GIF and screenshot, repository links and keywords in package.json.

Breaking changes (hence 0.2.0)

  • --dataset empty is removed; a local server always loads the books sample.
  • "I already have one running" needs a search key instead of an admin key, and no longer writes the books collection to that server.
  • A server URL with a path is refused.

Testing

  • npm run check (lint, typecheck, 51 tests incl. Docker).
  • npm run e2e -- vanilla.
  • Read-only path, key loop and dev server tested by hand against real Typesense servers.

PR Checklist

@Nikhiladiga Nikhiladiga self-assigned this Nov 23, 2026
@Nikhiladiga Nikhiladiga added the enhancement New feature or request label Nov 23, 2026
Comment thread src/steps/existingServer.ts Outdated
* that change nothing when the key has it: an id that no document has, an empty
* import, and bodies that Typesense rejects as invalid. Measured on Typesense 30.
*/
function writeProbes(collection: string): [string, string, string | undefined, string][] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list can go stale over time.

Could we go back to how master did this? Take the admin key once, use it to read the schemas, and create a documents:search key scoped to the chosen collections (createSearchOnlyKey already does this). Then the browser key is safe by construction and we can drop these probes.

With the probes we have to list every write route ourselves, and that list goes stale every time we add a new one to Typesense Server. For eg, analytics, conversation models and NL search models are already missing, and a key with collections:delete gets through this probe already.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 00a8c2c. The CLI now takes the admin key, uses it for that run only to read the schemas, and creates a documents:search key scoped to the chosen collections and each alias's target. The admin key is never written to disk. The probes, the curl step and the clipboard helper are gone.

One related change: createSearchOnlyKey deleted every key with the shared description, so on a shared server a second project would have removed the first project's key. The description now includes the project name and a hash of its path, so a re-run replaces only its own key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants