Slice · AI prompt
Quote/name/role rotator backend. Public `listAll` + `get` (no auth — testimonials are public), admin CRUD via `requireAdmin`, internal `seed` for one-shot bootstrap. Indexed by `order` so carousel/grid keeps stable rotation. Lifted 2026-05-16 from rahmanef.com; token-based admin gate swapped for rr `_shared/auth`.
# Install `testimonials` — Testimonials
> Quote/name/role rotator backend.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/testimonials
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=testimonials
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/testimonials
## 1. Install
```bash
npx rahman-resources add testimonials
# alias: npx rr add testimonials
```
The CLI copies `frontend/slices/testimonials/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- peer slices (cascade install):
- `convex-auth` — requireAdmin uses getAuthUserId from @convex-dev/auth.
- env vars:
- `SUPER_ADMIN_EMAIL` (convex)
- convex feature paths: `convex/features/testimonials`
## 3. Wire it up
Run `npx rr add testimonials`. Compose `testimonialsTables` into root schema. Bootstrap via `npx convex run internal.features.testimonials.mutations.seed '{"items":[{"quote":"...","name":"...","role":"...","order":1}]}'`. Render with `useQuery(api.features.testimonials.queries.listAll)`.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.