A minimal Vue + TypeScript template powered by Searchcraft β the developer-first vertical search engine.
Modern apps need fast, relevant, typo-tolerant search β but building it from scratch or with legacy tools is expensive, complex, and backend-heavy. Thatβs where Searchcraft comes in: a zero-config, front-end focused vertical search engine built to drop into your product in minutes.
This template exists to make that even easier. It provides:
- A minimal but complete Vite + Vue + TypeScript frontend, bootstrapped with
npm create vue@latest - Out-of-the-box Searchcraft SDK integration
- Clean environment variable config and instant dev startup
Whether you're building search for a publisher, SaaS app, ecommerce experience, or anything content-heavy β this gets you from zero to search fast.
- π Vue 3 + TypeScript β The latest versions for modern development
- β‘ Vite 6 β Lightning-fast builds, HMR, and DX
- π§ͺ Minimal boilerplate β Just enough structure to get started
- π Environment-based configuration β No hardcoded secrets
- β ESLint 9 β Preconfigured for code quality with Vue support
- π Typo-tolerant, relevance-tuned search with zero backend setup
- π§© Built-in UI components for search inputs, result lists, and pagination
- ποΈ Advanced filtering with date ranges, facets, numeric ranges, and toggle filters
- π§ Smart ranking with support for field weighting, stopwords, and synonyms
- π Analytics-ready with built-in hooks for usage insights via Vektron
- π°οΈ Fully managed β No need to stand up infrastructure
You can either click "Use this template" on GitHub, or use degit from the command line:
npx degit searchcraft-inc/vite-vue-searchcraft-template <app_name>
Install dependencies:
yarn
Then, add a .env file in the root of your project with your Searchcraft credentials, which can be found in your Searchcraft Vektron Dashboard:
VITE_ENDPOINT_URL=
VITE_INDEX_NAME=
VITE_READ_KEY=
Run the app in development mode:
yarn dev
This project includes a few helpful npm/yarn scripts to streamline development:
| Command | Description |
|---|---|
yarn dev |
Starts the Vite development server with hot module reload. |
yarn build |
Builds the project using Vue TypeScript compiler and Vite for production. |
yarn preview |
Serves the production build locally. |
yarn lint |
Runs ESLint across the codebase to catch errors and bad patterns. |
- Node.js v18+
- Yarn (or npm)
- A Searchcraft account with a configured index
The most common issue is field name mismatches. Ensure your filter configuration uses the exact field names from your Searchcraft index schema:
// β Wrong: using 'field' instead of 'fieldName'
const dateFilter = {
type: 'dateRange',
field: 'pub_date', // Incorrect property name
}
// β
Correct: using 'fieldName' with exact field name from your index
const dateFilter = {
type: 'dateRange',
fieldName: 'published_date', // Must match your index schema
options: {
minDate: new Date('2020-01-01'),
maxDate: new Date(),
granularity: 'day',
},
}Check your field names in the Vektron Dashboard under your index schema if you are using Searchcraft Cloud.
- π Searchcraft Docs
- π°οΈ Vektron Dashboard
- π¬ Searchcraft Discord
- π§ Searchcraft Reddit
- π§ͺ Searchcraft SDK on npm
Licensed under the Apache 2.0 License.
Built with π°οΈ by the Searchcraft team
