General
PromptBeginner5 minmarkdown
Untitled Skill
185
Frontend code patterns for components, pages, and api.ts
Loading actions...
Main instructions and any bundled files for this skill.
frontend/src/lib/api.ts)interface for every new backend response shape, co-located with its API function.api axios instance (api.get/post/delete).{ headers: { 'x-admin-key': adminKey } } as the axios config.fetch directly (not axios), return () => void abort function using AbortController.Promise<T> — extract .then((r) => r.data) for axios.frontend/src/components/)cn() from ../lib/utils for conditional class merging — never template-literal class concatenation.frontend/src/pages/)useState for all data — no global store.useEffect; set loading/error states.App.tsx with a <Route>.| Purpose | Classes |
|---|---|
| Page/app background | bg-[#09090b] |
| Card / section surface | bg-white/[0.03] — bg-white/[0.04] |
| Borders | border-white/[0.07] — border-white/[0.08] |
| Primary text | text-white |
| Secondary text | text-zinc-300 — text-zinc-400 |
| Muted / placeholder | text-zinc-500 — text-zinc-600 |
| CTA buttons | bg-gradient-to-r from-orange-500 to-amber-500 |
| Accent / icon color | text-orange-400, bg-orange-500/10 |
| Error | border-red-500/20 bg-red-500/10 text-red-400 |
| Success | text-emerald-400 |
| Loading spinner | h-8 w-8 animate-spin rounded-full border-2 border-orange-500 border-t-transparent |
| Input focus | focus:border-orange-500/50 |
lucide-react. Do not add a new icon library.rounded-xlrounded-2xlcursor:pointer styleTypeScript and ESLint rules that MUST be followed when creating, modifying, or reviewing any file under apps/frontend/, including .ts, .tsx, .js, and .jsx files. Also apply when discussing frontend li...
risks