Cursor rule
.cursor/rules/frontend-web.mdcCursor rules
Quality
56/100
Scores the file, not the repository.Length
382 words
6 headings · 0 code blocksRepository
4.0k
— · pushed 2 days agoLast changed
3 days ago
First indexed 3 days ago.12345## Frontend (apps/web)67- **Role**: Deliver the Telegram search UI. All business logic and side effects should live in `packages/client` / `packages/core`, not in Vue components.8- **Architecture**:9 - Use **Composition API** with `<script setup lang="ts">` by default. Avoid Options API for new code.10 - Keep components small and focused; extract logic into composables in `apps/web/src/composables` or into `packages/client`.11 - Do not access Telegram or the database directly from `apps/web`; always go through `@tg-search/client`.1213### Routing, Layouts & Navigation1415- Use the auto-generated routes from `vue-router/auto-routes` and `virtual:generated-layouts`.16- Prefer **file-based routing** conventions over manual route declarations.17- Guard routes via Pinia stores or client events (auth status), not ad‑hoc `localStorage` checks in components.18- When adding navigation transitions or loading states:19 - Integrate with the existing `NProgress` guards in `main.ts` instead of ad‑hoc spinners in every page.2021### State & Data Fetching2223- Global/shared state belongs in **Pinia** stores (either in `apps/web/src/stores` or `packages/client`).24- For async data and server/core interactions:25 - Prefer **TanStack Query** (`@tanstack/vue-query`) for request lifecycle, caching, and background refetch.26 - Model long‑running operations (imports, indexing, sync) as events and progress updates flowing through `@tg-search/client`, not as raw HTTP calls from components.27- Never call `initDrizzle` or mutate `CoreContext` directly from `apps/web`; that belongs in `packages/client`.2829### UI, Styling & UX3031- Use **UnoCSS** utilities and the existing presets (`unocss`, `unocss-preset-shadcn`, `@proj-airi/unocss-preset-chromatic`) as the primary styling tools.32- Keep layout and visual primitives reusable:33 - Extract repeated patterns into small components under `apps/web/src/components`.34 - Avoid deep CSS overrides; prefer class-based composition.35- Respect accessibility basics:36 - Use semantic HTML elements and proper labels for inputs and buttons.37 - Ensure keyboard navigation works for any new interactive components.3839### Error Handling & Notifications4041- Surface user-facing errors via consistent UI (e.g. toast/notification component or error blocks), not `alert` or silent failures.42- For unexpected errors:43 - Log via `@guiiai/logg` only inside `packages/client` / `packages/common`; the web app should avoid its own logging layer beyond dev tooling.44 - Show a generic message to the user; do not display raw stack traces.4546### Devtools & PGlite4748- PGlite devtools (`@unbird/pglite-inspector`) must remain **development-only**:49 - Guard setup with `import.meta.env.DEV` as in `main.ts`.50 - If you add more devtools hooks, wire them behind the same guard and avoid impacting production bundle size significantly.5152
Also in groupultra/telegram-search
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| groupultra/telegram-search.cursor/rules/testing.mdc · 4.0k | Cursor rules | teststyletesting-strategydatabase | 55/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/architecture.mdc · 4.0k | Cursor rules | buildtestlint-formatarch+4 | 89/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/backend-server.mdc · 4.0k | Cursor rules | setupsecuritymonorepo | 52/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/client.mdc · 4.0k | Cursor rules | stylearchtypesdependencies+1 | 60/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/contributing.mdc · 4.0k | Cursor rules | styletypesgit | 56/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/core.mdc · 4.0k | Cursor rules | stylearchdependenciesdatabase+1 | 60/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/db.mdc · 4.0k | Cursor rules | styletypesdatabaseperformance | 59/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/events.mdc · 4.0k | Cursor rules | style | 60/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/pglite-inspector.mdc · 4.0k | Cursor rules | securityapi | 47/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/tooling.mdc · 4.0k | Cursor rules | buildlint-formatstyledeployment+1 | 67/100 | 3 days ago | |
| groupultra/telegram-search.github/copilot-instructions.md · 4.0k | Copilot instructions | teststyleagent-behaviour | 76/100 | 3 days ago | |
| groupultra/telegram-searchAGENTS.md · 4.0k | AGENTS.md | setupbuildtestlint-format+10 | 83/100 | 3 days ago |
Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/backend-server.mdc Diff against .cursor/rules/client.mdc Diff against .cursor/rules/contributing.mdc Diff against .cursor/rules/core.mdc Diff against .cursor/rules/db.mdc Diff against .cursor/rules/events.mdc Diff against .cursor/rules/pglite-inspector.mdc Diff against .cursor/rules/tooling.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
