# FindAstra

AI semantic search for WooCommerce. Replaces the default keyword search with vector embeddings. Three engines: **Local** (in-browser, free), **OpenAI** (BYOK), and **Hugging Face** (BYOK free tier).

## Dev setup

```powershell
npm install
npm run build           # vite -> dist/frontend.js + admin.js
npx playwright install  # one-time browser download
npm run test:e2e
```

E2E tests log in as a WP admin. Create one with WP-CLI:

```powershell
wp user create findastra_admin admin@example.com --role=administrator --user_pass=findastra_admin_pass
```

Or set `FINDASTRA_ADMIN_USER` / `FINDASTRA_ADMIN_PASS` env vars (see `.env.example`).

## Packaging

```powershell
npm run package
# → releases/findastra-<version>.zip
```

The script reads the `Version:` header from `findastra.php`, runs the build, stages production-only files, and zips with the plugin slug as the top-level directory.

## Folder layout

```
includes/            PHP — bootstrap, admin, REST, activator, autoloader, providers
includes/providers/  Provider implementations (base + Local + OpenAI + HF)
src/                 JS source (frontend widget, admin controller, shared embedder)
src/styles/          CSS
dist/                Vite build output (gitignored)
assets/              Static images / fonts
languages/           Translation .pot / .po files
tests/unit/          PHPUnit / Brain Monkey
tests/e2e/           Playwright
scripts/             Build + release scripts
```

## License

GPL-2.0-or-later.
