Overview
The frontend command palette (frontend/components/ui/command-palette.tsx) and a planned global search page ([FE-19]) need one endpoint that searches across the platform. A global search page existed before the reset commit.
What to Build
A SearchModule in backend/src/search/:
| Method |
Path |
Description |
GET |
/api/search?q=&types=&limit= |
Cross-entity search |
- Searches: assets (name, assetId, serialNumber, manufacturer, model, tags), users (name, email), documents (name) —
types filter narrows scope
- Postgres
ILIKE for v1 is fine; structure the service so full-text (tsvector) can replace it later
- Grouped response:
{ assets: [...], users: [...], documents: [...] }, each item with id, display label, and route hint (e.g. /assets/:id)
- Respect RBAC ([BE-15]): staff results limited to what they can view
- Min query length 2;
limit per group (default 5, max 20)
References
- Pre-reset version:
git log --oneline --all -- 'backend/src/**search**' / commit 0c2b80b
- Blocked by [BE-06], [BE-03], [BE-10]
Acceptance Criteria
Overview
The frontend command palette (
frontend/components/ui/command-palette.tsx) and a planned global search page ([FE-19]) need one endpoint that searches across the platform. A global search page existed before the reset commit.What to Build
A
SearchModuleinbackend/src/search/:GET/api/search?q=&types=&limit=typesfilter narrows scopeILIKEfor v1 is fine; structure the service so full-text (tsvector) can replace it later{ assets: [...], users: [...], documents: [...] }, each item withid, display label, and route hint (e.g./assets/:id)limitper group (default 5, max 20)References
git log --oneline --all -- 'backend/src/**search**'/ commit0c2b80bAcceptance Criteria
types=assetsnarrows correctly; per-group limit respected400