Skip to main content
vibld

Template

Nettleby

A developer console page where users configure a batch scraping or crawl job: pick a target type, paste URLs, choose output format and content options. A parallel 'with code' tab shows the equivalent API call so the UI doubles as documentation.

Create batch crawl job form in developer console · App screen: add edit · Small tools and apps · full-stack app (auth + DB)

A mock-up of the screen, drawn from its layout, palette and typefaces. A build follows the full prompt below.

Start from this screenRead the build prompt

Typefaces

The catalog's own faces. A screen composed into a template is drawn in that template's typefaces.

  • InterHeadings: Inter 500 28px page title, -0.02em
  • InterBody: Inter 400 16px / 1.5; helper text 16px in the muted colour

Patterns

  • UI vs code tabs for the same form
  • segmented control for target type
  • monospace textarea for URL list
  • toggle rows list for options
  • persistent left sidebar with section labels
  • credit balance in top-right
  • upgrade card in sidebar footer

States it is designed for

  • empty form
  • invalid URLs listed
  • over limit (more than 25,000 lines)
  • insufficient credits warning with estimated cost
  • submitting
  • created -> redirect
  • API error toast with retry
  • free plan limits shown on premium options (disabled toggles with lock + tooltip)

Who it is for

  • developers building data pipelines
  • AI engineers collecting web content

Layout

  1. Left sidebar (~220px): workspace switcher and search at top, Overview, PRODUCTS label (data APIs, monitors, batches active, logo lookup), WORKSPACE label (API keys, usage, team), free-plan card with Upgrade, Help, Documentation, account
  2. Top-right: credits counter
  3. Main column (max 460px, centred): back link, title, subtitle, tabs (Create via UI / Create with code) + Read docs link
  4. Form: Target type segmented (Scrape URLs, Crawl sitemap, Crawl from URL) + helper; URLs source select + monospace textarea with helper 'One URL per line. Up to 25,000'; Output format segmented (Markdown, HTML) + helper; Content options card with toggle rows; sticky Create batch button
  5. Code tab: language select and a dark code block mirroring the current form values with copy button
  6. Mobile: sidebar becomes a drawer; form full width

Palette

Tidy, developer-friendly and quiet; blue is reserved for primary and on-state.

  • app bg#f7f7f7
  • surface#ffffff
  • text#1a1a1a
  • muted text#6b6b6b
  • segment track#ececec
  • input border#8c8c8c
  • primary blue#0072e6
  • on primary#ffffff
  • toggle on#1a8cff
  • code bg#1c1f24
  • code text#e6e6e6
  • focus ring#1a8cff

Every checked pair, measured again

SampleWhereRatioNeeds
Aabody text on app bg16.25:14.5:1
Aamuted helper on app bg4.97:14.5:1
AaUpgrade label on blue4.62:14.5:1
input border on white3.36:13:1
toggle on vs track surface3.37:13:1
Aaunselected segment label on track4.51:14.5:1
Aacode text on code bg13.24:14.5:1
focus ring on app bg3.14:13:1

As vibld’s tokens

The palette on the fifteen colour tokens vibld styles a project with, each text colour on the fill it is read on. Marked tokens are solved from the palette, because no swatch held that role at 4.5:1.

  • background
  • card
  • muted
  • primary
  • secondary
  • accent
  • destructive *

Type scale

Display
Inter 500 28px page title, -0.02em
Body
Inter 400 16px / 1.5; helper text 16px in the muted colour

JetBrains Mono 400 15px for the URL textarea and code block; section labels uppercase 12px 600 with 0.06em tracking.

Spacing and imagery

Comfortable; 4px base, 28px between form groups, 8px label-to-control; radius 8px inputs and cards, 6px segments; no shadows, 1px borders.

Line icons in the sidebar; no illustrations.

Components

  • ConsoleSidebar with SectionLabel
  • CreditsCounter
  • ModeTabs (UI / code)
  • SegmentedControl
  • UrlListTextarea with line counter
  • SourceSelect (URL list, CSV upload, sitemap URL)
  • ToggleRow list
  • CodePreview with language select and copy
  • CreateBatchButton
  • PlanCard with Upgrade

Interactions

  • Every form change updates the code tab payload live
  • Textarea counts valid URLs and flags invalid lines inline with line numbers
  • Switching target type swaps the URL input for a single start URL + depth fields
  • Copy button shows a check for 1.5s
  • Create batch validates, shows spinner, then routes to the batch detail page
  • Keyboard: Cmd/Ctrl+Enter submits

Data

  • Batch{id, workspace_id, target_type (urls|sitemap|crawl), urls[], start_url?, max_depth?, page_budget, output_format (markdown|html), include_links, include_images, status (queued|running|completed|failed), created_at}
  • Workspace{id, credits, plan (free|pro)}
  • ApiKey{id, workspace_id, prefix, last_used_at}

Guardrails

Experience

  • Show the equivalent API call so users can graduate from UI to code
  • Give each control a one-line helper explaining its effect
  • Estimate credit cost before submit
  • Keep options in a single card of toggles rather than scattered checkboxes
  • Preserve the draft if the user switches tabs

Accessibility

  • Tabs and segmented controls use proper roles with arrow-key support
  • Textarea has a label, and invalid-line messages are listed in text under it
  • Toggle rows are switches with the label as their name
  • Code block is focusable and scrollable with a visible focus ring
  • Section labels are not headings-only visually; use real h2s

Security

  • Validate URLs server-side (scheme http/https only, block private IP ranges to avoid SSRF)
  • Enforce per-workspace rate limits and credit checks in an Edge Function
  • RLS on batches by workspace membership
  • Never render the API key in the code preview; use a placeholder variable
  • Cap textarea size and line count server-side

Build prompt

The baseline every prompt in the catalog assumes, then this design’s own ten sections, from goal to guardrails.

The baseline
### How to use these prompts
Paste an entry's build prompt into your coding agent as the first message. Each prompt names its own stack, tokens and acceptance criteria; the rules below apply to all of them and can be prepended once per project.

### Engineering baseline
- TypeScript strict mode, no `any`, small typed components, feature folders, and one source of truth for design tokens (CSS variables consumed by Tailwind).
- Validate every input with a shared zod schema on the client and again on the server or edge function. Never trust client-side checks alone.
- Show loading, empty and error states for every async view. Surface errors in plain language with a retry, and log details to the console in development only.
- Keep secrets out of the bundle. Only publishable keys (for example a Supabase anon key) belong in client code; service-role keys, API keys and webhooks live in server or edge-function environment variables.

### Data and auth baseline (full-stack entries)
- Enable Row Level Security on every table before inserting data. Default-deny, then add owner-scoped policies (`auth.uid() = user_id`) and explicit role checks for admin views.
- Store roles in a separate table checked by a security-definer function, never in a user-editable profile field.
- Upload files to private storage buckets with size and MIME limits, and serve them through signed URLs.
- Rate-limit public endpoints (forms, auth, AI calls) and add a honeypot field or captcha to anonymous forms.
- Take payments through a hosted checkout and verify webhooks by signature. Never handle raw card data.

### Accessibility and UX baseline
- Target WCAG 2.2 AA: 4.5:1 contrast for normal text and 3:1 for large text, input borders, focus rings and meaningful icons or chart lines. Every palette in this catalog lists its verified pairs; re-check with a contrast tool after any colour change.
- Keep body text at 16px or larger with 1.5 line height, nothing below 12px, no light weights under 24px, and uppercase only for short labels.
- Give every interactive element a visible focus ring, full keyboard support, semantic landmarks, labelled form fields, and alt text on meaningful images.
- Respect `prefers-reduced-motion` for every animation. Give drag-and-drop and carousels keyboard and button alternatives.
- Build mobile-first and test at 375px, 768px and 1280px.

### Content guardrails
- Use original copy, fictional sample data and placeholder or licensed imagery. Do not reuse another product's name, logo, screenshots or marketing text.
- Label demo testimonials and metrics as samples. Collect the minimum personal data the feature needs.

### SaaS screen baseline
- Design every screen for its full set of states: first-run empty, loading skeleton, partial data, error with retry, permission-denied, and success feedback. Each entry lists the states its screen needs.
- Keep destructive actions (delete, revoke, downgrade, remove member) behind a confirmation that names the object, and prefer undo over a second dialog where the action is reversible.
- Enforce authorisation on the server for every action a screen exposes. Hiding a button is not access control; check the role again in the API or RLS policy.
- Never show secrets (API keys, tokens) in full after creation. Show them once, then mask them, and offer rotate and revoke.
- Keep the app shell (navigation, workspace switcher, account menu) consistent across screens, and preserve filters, sort and scroll position when the user navigates back.
### Goal
Build **Nettleby**, the Create batch page of a web-data developer console with a UI tab and a live code tab. Include sidebar shell, credits counter, realistic mock workspaces, and every validation and submission state.

### Stack
Use React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui, Radix, lucide-react, TanStack Query, react-hook-form, zod, Supabase.  Use Supabase for Auth, Postgres (row-level security on every table) and Storage where noted; keep only the anon key in the browser and run privileged work in Edge Functions.

### Pages & layout
1. **/batches/new**: the form.
2. **/batches/:id**: simple detail stub to land on after creation.
3. **/batches**: list stub for the sidebar link.

Regions, in order:
- Left sidebar (~220px): workspace switcher and search at top, Overview, PRODUCTS label (data APIs, monitors, batches active, logo lookup), WORKSPACE label (API keys, usage, team), free-plan card with Upgrade, Help, Documentation, account
- Top-right: credits counter
- Main column (max 460px, centred): back link, title, subtitle, tabs (Create via UI / Create with code) + Read docs link
- Form: Target type segmented (Scrape URLs, Crawl sitemap, Crawl from URL) + helper; URLs source select + monospace textarea with helper 'One URL per line. Up to 25,000'; Output format segmented (Markdown, HTML) + helper; Content options card with toggle rows; sticky Create batch button
- Code tab: language select and a dark code block mirroring the current form values with copy button
- Mobile: sidebar becomes a drawer; form full width

### Design system
- Colors: `--app-bg: #f7f7f7` (app bg), `--surface: #ffffff` (surface), `--text: #1a1a1a` (text), `--muted-text: #6b6b6b` (muted text), `--segment-track: #ececec` (segment track), `--input-border: #8c8c8c` (input border), `--primary-blue: #0072e6` (primary blue), `--on-primary: #ffffff` (on primary), `--toggle-on: #1a8cff` (toggle on), `--code-bg: #1c1f24` (code bg), `--code-text: #e6e6e6` (code text), `--focus-ring: #1a8cff` (focus ring).
- Fonts: Inter 500 28px page title, -0.02em for headings; Inter 400 16px / 1.5; helper text 16px in the muted colour for body. JetBrains Mono 400 15px for the URL textarea and code block; section labels uppercase 12px 600 with 0.06em tracking.
- Spacing, radius and shadows: Comfortable; 4px base, 28px between form groups, 8px label-to-control; radius 8px inputs and cards, 6px segments; no shadows, 1px borders.
- Motion: 150-200 ms ease-out for hover, focus and overlay transitions; overlays fade and scale from 98% to 100%; everything collapses to an instant change under prefers-reduced-motion.
- Mood: Tidy, developer-friendly and quiet; blue is reserved for primary and on-state. Imagery: Line icons in the sidebar; no illustrations.

### Components & interactions
Build these components: ConsoleSidebar with SectionLabel; CreditsCounter; ModeTabs (UI / code); SegmentedControl; UrlListTextarea with line counter; SourceSelect (URL list, CSV upload, sitemap URL); ToggleRow list; CodePreview with language select and copy; CreateBatchButton; PlanCard with Upgrade.

- Every form change updates the code tab payload live
- Textarea counts valid URLs and flags invalid lines inline with line numbers
- Switching target type swaps the URL input for a single start URL + depth fields
- Copy button shows a check for 1.5s
- Create batch validates, shows spinner, then routes to the batch detail page
- Keyboard: Cmd/Ctrl+Enter submits

### Data & state
Model: `Batch{id, workspace_id, target_type (urls|sitemap|crawl), urls[], start_url?, max_depth?, page_budget, output_format (markdown|html), include_links, include_images, status (queued|running|completed|failed), created_at}`; `Workspace{id, credits, plan (free|pro)}`; `ApiKey{id, workspace_id, prefix, last_used_at}`.

Form state in react-hook-form with a discriminated-union zod schema by target type. A pure `toApiPayload(form)` feeds both submit and the code preview, so they never diverge. Estimated credits = URLs x per-page cost.

States to implement and demo:
- empty form
- invalid URLs listed
- over limit (more than 25,000 lines)
- insufficient credits warning with estimated cost
- submitting
- created -> redirect
- API error toast with retry
- free plan limits shown on premium options (disabled toggles with lock + tooltip)

### Accessibility
- Tabs and segmented controls use proper roles with arrow-key support
- Textarea has a label, and invalid-line messages are listed in text under it
- Toggle rows are switches with the label as their name
- Code block is focusable and scrollable with a visible focus ring
- Section labels are not headings-only visually; use real h2s
- Body text is 16px with line-height 1.5 (15px only inside dense tables), nothing renders below 12px, weights of 300 or lighter appear only at 24px and above, and uppercase is limited to short labels with at least 0.05em tracking.
Verified contrast: body text on app bg: #1a1a1a on #f7f7f7 = 16.25:1; muted helper on app bg: #6b6b6b on #f7f7f7 = 4.97:1; Upgrade label on blue: #ffffff on #0072e6 = 4.62:1; input border on white: #8c8c8c on #ffffff = 3.36:1; toggle on vs track surface: #1a8cff on #ffffff = 3.37:1; unselected segment label on track: #6b6b6b on #ececec = 4.51:1; code text on code bg: #e6e6e6 on #1c1f24 = 13.24:1; focus ring on app bg: #1a8cff on #f7f7f7 = 3.14:1.

### Security
- Validate URLs server-side (scheme http/https only, block private IP ranges to avoid SSRF)
- Enforce per-workspace rate limits and credit checks in an Edge Function
- RLS on batches by workspace membership
- Never render the API key in the code preview; use a placeholder variable
- Cap textarea size and line count server-side

RLS: `batches` - select/insert where the user is a member of `workspace_id`; update only via service role (workers); `workspaces` - members select; `api_keys` - members select prefix only.

### Performance & SEO
Virtualise invalid-line list for huge pastes; parse URLs in a web worker above 5,000 lines. Lazy-load the code highlighter. Noindex console routes.

### Guardrails
- Show the equivalent API call so users can graduate from UI to code
- Give each control a one-line helper explaining its effect
- Estimate credit cost before submit
- Keep options in a single card of toggles rather than scattered checkboxes
- Preserve the draft if the user switches tabs
- Use the product name Nettleby and fresh, generic copy throughout; all people, companies, amounts and IDs are invented, and no third-party brand, logo or wordmark appears.
- Keep components small and typed (no `any`), and surface every failure visibly instead of swallowing it.

Acceptance criteria:
- [ ] Code tab mirrors every form change
- [ ] Invalid URLs flagged with line numbers
- [ ] Credit estimate and limit warnings work
- [ ] Batch created and redirects to detail
- [ ] 390px layout works

Open the builderAll templatesThis palette on its own