πŸ€– AI QUICK START

Style an ANTSAND website in 7 steps

This is the complete API-driven workflow for AI styling ANTSAND Databoard websites. Each step is a single API call. The entire loop β€” from reading the board to deploying a live site β€” takes under 30 seconds.

πŸ“‹ ANTSAND AI Styling Prompt β€” copy and paste into your AI
You are styling an ANTSAND Databoard website via its REST API.

## Authentication

All requests use Bearer token auth:
```
-H "Authorization: Bearer YOUR_API_KEY"
```

## The 7-Step Workflow

### 1. List boards
GET /api/v1/databoards β†’ returns array of boards with _id, boardname

### 2. Inspect the board
GET /api/v1/databoards/{BOARD_ID} β†’ returns full JSON with:
- datalist[*].css.section.container β€” section root (theme goes here)
- datalist[*].css.data.container β€” grid/layout class
- datalist[*].css.data.sub_container β€” card wrapper class
- datalist[*].css.data.h3, .p, .cta, .img_container β€” content field classes
- sass β€” site-level SCSS

### 3. Patch field CSS classes
POST /api/v1/databoards/{BOARD_ID}/patch
Content-Type: application/json
Body: { "patch_delta": { "datalist.0.css.section.container": "antsand-section theme-dark-corporate", ... } }

### 4. Compile utilities
POST /api/v1/databoards/{BOARD_ID}/utilities/compile
Scans all css_class fields, generates board-local utility CSS.
Response includes: classes_found, utility_classes, rules_emitted, unsupported_classes

### 5. Deploy
POST /api/v1/databoards/{BOARD_ID}/deploy
Compiles templates, generates controllers/views, publishes the site.

### 6. Smoke test
curl -s -o /dev/null -w "%{http_code}" http://YOUR_SITE_URL/
Should return 200.

### 7. Iterate
Repeat steps 3β†’5 for each section. The loop is idempotent.

## Field β†’ Rendered HTML Map

Databoard field         Rendered element     Fixed class
section.container   β†’   section              .section
section.h2          β†’   h2                   .data-h2
section.p           β†’   p                    .data-p
data.container      β†’   div                  .data-container
data.sub_container  β†’   div (per item)       .data-sub-container
data.img_container  β†’   div wrapping img     .data-img-container
data.h3             β†’   h3                   .data-h3
data.p              β†’   p                    .data-p
data.span           β†’   span                 .data-span
data.cta            β†’   a                    .data-cta

Your classes are APPENDED to the fixed class. e.g.:
  data.h3 = "text-fluid-lg line-clamp-2"
  renders: <h3 class="data-h3 text-fluid-lg line-clamp-2">

## Two-Tier Rule

Always use a Tier 1 semantic class first, then Tier 2 utilities:
βœ… "antsand-section theme-dark-corporate"
βœ… "antsand-grid md:grid-cols-3 gap-6"
βœ… "antsand-btn antsand-btn-primary touch-target"
❌ "flex gap-4 p-6" (no semantic root)

## Available Theme Presets (set on section.container)

- theme-dark-corporate β€” dark navy, indigo accent, tech/SaaS
- theme-warm-editorial β€” cream/ivory, serif headings, blogs/magazines
- theme-minimal-clean β€” pure white, tight spacing, portfolios/docs
- theme-bold-gradient β€” dark gradient, glass cards, marketing/events

## Available Utility Classes (pre-compiled in antsand-v2.css)

Layout:       antsand-grid, md:grid-cols-2/3/4, lg:grid-cols-3/4, gap-4/6/8, flex, flex-col, flex-wrap
Typography:   text-fluid-sm/base/lg/xl/2xl/3xl/4xl/5xl, line-clamp-2/3, font-bold/semibold, text-center/left/right
Spacing:      p-1..8, px-*/py-*, m-1..8, mx-auto, sm:p-4, lg:p-8, sm:gap-4, lg:gap-8
Effects:      transition-all/fast/slow, hover:-translate-y-1, hover:scale-105, opacity-50/75, shadow-md/lg
Media:        aspect-video/square/photo, object-cover/contain, rounded-lg/full
Responsive:   sm:hidden, md:block, lg:flex, sm:text-sm, lg:text-2xl
Accessibility: sr-only, skip-to-content, touch-target/touch-target-lg, focus-ring, motion-safe:transition-all

## Styling Layers (what to change where)

- Field CSS (datalist[*].css.*) β€” MOST work happens here
- Site Sass (sass/common_styles) β€” one-off brand overrides
- /utilities/compile β€” auto-generates board-local CSS from field classes
- Sass v2 (styles_antsand/) β€” only for reusable framework changes

## Common Patterns

Services (3-col):
  section.container = "antsand-section theme-minimal-clean"
  data.container = "antsand-grid md:grid-cols-3 gap-6"
  data.h3 = "text-fluid-lg"
  data.p = "line-clamp-3 opacity-75"
  data.cta = "antsand-btn antsand-btn-primary"

Blog grid:
  section.container = "antsand-section theme-warm-editorial"
  data.container = "antsand-grid md:grid-cols-2 gap-8"
  data.img_container = "aspect-photo"
  data.h3 = "text-fluid-lg line-clamp-2"
  data.p = "line-clamp-3"

Pricing:
  section.container = "antsand-section theme-dark-corporate"
  data.container = "antsand-grid md:grid-cols-3 gap-6"
  data.span = "text-fluid-3xl font-bold"
  data.cta = "antsand-btn antsand-btn-primary touch-target-lg"

Hero:
  section.container = "antsand-section theme-bold-gradient"
  section.h2 = "text-fluid-4xl font-bold"
  section.p = "text-fluid-lg opacity-75"

## Troubleshooting

- Classes not rendering? β†’ Call /utilities/compile before /deploy
- Theme not applying? β†’ Theme class goes on section.container, not individual fields
- 401 error? β†’ Check Bearer token with GET /api/v1/me
- Need custom CSS? β†’ Patch sass.common_styles with SCSS targeting .data-h3, .data-sub-container, etc.
Prerequisites: You need an ANTSAND API key and a Databoard object ID. Create API keys from your profile page β†’ API Keys tab. The key is shown once β€” store it securely.

What is Databoard?

Databoard is ANTSAND's visual control plane for generated websites. It stores the site structure an AI or human edits: HMVC modules/controllers/actions, routes, ACL roles, page sections, menus, data mappings, field-level CSS classes, and site-specific Sass. Deployment reads this board and compiles it into a real Phalcon HMVC application.

For styling work, Databoard is where classes are attached to concrete fields like section.container, data.container, data.sub_container, data.h3, data.p, and data.cta. Sass v2 provides reusable classes; Databoard decides where those classes are applied for each generated site.

1

GET  Authenticate & list boards

Verify your API key works, then list all Databoards you own.

Verify key
curl -s http://localhost/api/v1/me \
  -H "Authorization: Bearer YOUR_API_KEY" | jq
List boards
curl -s http://localhost/api/v1/databoards \
  -H "Authorization: Bearer YOUR_API_KEY" | jq '.[].name'

β†’ Save the _id.$oid of the board you want to style. This is your BOARD_ID for all following steps.

2

GET  Inspect the board

Fetch the full Databoard configuration β€” sections, HMVC, field CSS classes, menu, Sass, and metadata.

Fetch board
curl -s http://localhost/api/v1/databoards/BOARD_ID \
  -H "Authorization: Bearer YOUR_API_KEY" | jq
Key fields to read:
  • datalist[*].css.section.container β€” Section root class (theme goes here)
  • datalist[*].css.data.container β€” Grid/layout container class
  • datalist[*].css.data.sub_container β€” Card/item wrapper class
  • datalist[*].css.data.h3, .p, .cta β€” Content field classes
  • datalist[*].css.data.img_container β€” Image wrapper class
  • sass β€” Site-level Sass/common_styles
3

POST  Patch field CSS classes

Apply your styling changes. The patch endpoint merges your delta into the existing board β€” you don't need to send the full object.

Patch CSS classes on section index 0
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/patch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "patch_delta": {
      "datalist.0.css.section.container": "antsand-section theme-dark-corporate",
      "datalist.0.css.data.container": "antsand-grid md:grid-cols-3 gap-6",
      "datalist.0.css.data.sub_container": "transition-all",
      "datalist.0.css.data.img_container": "aspect-video",
      "datalist.0.css.data.h3": "text-fluid-lg line-clamp-2",
      "datalist.0.css.data.p": "text-fluid-base line-clamp-3 opacity-75",
      "datalist.0.css.data.cta": "antsand-btn antsand-btn-primary touch-target"
    }
  }' | jq
Two-tier rule: Always start with a Tier 1 semantic class (antsand-section, antsand-grid, antsand-btn), then add Tier 2 utility classes (md:grid-cols-3, gap-6, line-clamp-2). Never pure utilities alone.
4

POST  Compile utilities

The Sass scanner reads every css_class field from the board. Classes already in antsand-v2.css are served from CDN. Board-specific utility classes get compiled into a site-local _utilities.scss.

Compile board utilities
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/utilities/compile \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' | jq

β†’ Response includes: classes_found, utility_classes, rules_emitted, unsupported_classes. Check unsupported_classes β€” those are class names the scanner couldn't generate rules for.

5

POST  Deploy

Deploy the board to its generated website. The compiler resolves templates (parameter_files.json, common_init_modern, service_3_modern), renders the Header/Body/Footer hierarchy, and publishes.

Deploy
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/deploy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' | jq
6

GET  Smoke test

Verify the deployed site is live and rendering correctly. The smoke test checks HTTP status codes, expected content, and absence of fatal errors.

Quick verification
# Quick check β€” site returns 200
curl -s -o /dev/null -w "%{http_code}" http://YOUR_SITE_URL/

# Full smoke test suite (from repo)
make test-site-smoke SITE=http://YOUR_SITE_URL
7

πŸ”„  Iterate

Repeat steps 3β†’5 for each section you want to style. Each iteration is: patch classes β†’ compile utilities β†’ deploy. The loop is idempotent β€” redeploying with the same classes produces the same site.

Patch + compile + deploy in one sequence
# Patch section 2 with a different theme
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/patch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "patch_delta": {
      "datalist.2.css.section.container": "antsand-section theme-warm-editorial"
    }
  }' | jq .ok

# Recompile utilities (picks up new classes)
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/utilities/compile \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d '{}' | jq .rules_emitted

# Redeploy
curl -s -X POST http://localhost/api/v1/databoards/BOARD_ID/deploy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" -d '{}' | jq .ok

πŸ“ Styling Layers

ANTSAND styling is layered. As an AI, know which layer to change for any given task.

Layer What it is When to change
πŸ›οΈ Sass v2 styles_antsand/sass_v2/ β€” shared framework CSS. 400+ utilities, 12 components, 4 themes. Only for reusable tokens/components that ship to all sites. Requires make master.
πŸ“„ Template defaults parameter_files.json β€” seeds CSS fields and default classes for new sections. When you want new sections to start with different default classes.
πŸ—οΈ Volt templates service_3_modern.volt, common_init_modern.volt β€” render the HBF hierarchy. Almost never. These are the contract β€” the fixed class hierarchy comes from here.
🎯 Field CSS datalist[*].css.* β€” per-field class names set via API patch. Most AI work happens here. Theme on section, layout on container, utilities on fields.
🎨 Site Sass Databoard sass/common_styles β€” per-site branding CSS. For one-off brand overrides, page-level CSS, or section-specific selectors.
⚑ Board utilities /utilities/compile output β€” board-local utility Sass. Auto-generated. Just call the compile endpoint after patching classes.
Rule of thumb: If a style change only affects one board, don't edit Sass v2. Put it in field CSS classes (step 3) or site Sass. The compile endpoint (step 4) handles generating any missing utility rules.

πŸ“¦ Available Class Reference

These classes are pre-compiled in antsand-v2.css. Use them in field CSS β€” no compilation needed.

🎨 Themes

theme-dark-corporate
theme-warm-editorial
theme-minimal-clean
theme-bold-gradient

πŸ“ Layout

antsand-grid
md:grid-cols-2 / 3 / 4
lg:grid-cols-3 / 4
gap-4 / gap-6 / gap-8
flex / flex-col / flex-wrap

πŸ“ Typography

text-fluid-sm / base / lg / xl / 2xl
line-clamp-2 / 3
text-center / left / right
font-bold / semibold

✨ Effects

transition-all / fast / slow
hover:-translate-y-1
hover:scale-105
opacity-75 / opacity-50
shadow-md / shadow-lg

πŸ“Έ Media

aspect-video / aspect-square
aspect-photo
object-cover / contain
rounded-lg / rounded-full

β™Ώ Accessibility

sr-only / skip-to-content
touch-target / touch-target-lg
focus-ring / focus-ring-primary
motion-safe:transition-all

Full reference: Databoard Utilities Loop  |  Homepage: Copyable AI prompts

πŸ—ΊοΈ Field β†’ Rendered Element Map

When you patch datalist[N].css.data.h3, these classes end up on the actual rendered HTML element. Here's what maps to what.

Databoard Field β†’ Rendered HTML
Databoard field           Rendered element        Fixed class
section.container    β†’   <section>               .section
section.h2           β†’   <h2>                    .data-h2
section.p            β†’   <p>                     .data-p
data.container       β†’   <div>                   .data-container
data.sub_container   β†’   <div> (per item)        .data-sub-container
data.img_container   β†’   <div> wrapping <img>    .data-img-container
data.h3              β†’   <h3>                    .data-h3
data.p               β†’   <p>                     .data-p
data.span            β†’   <span>                  .data-span
data.cta             β†’   <a>                     .data-cta

Your CSS classes are APPENDED to the fixed class. e.g.:
  data.h3 = "text-fluid-lg line-clamp-2"
  renders: <h3 class="data-h3 text-fluid-lg line-clamp-2">

πŸ’‘ Common Patterns

Services section (3-column cards)

{
  "section.container": "antsand-section theme-minimal-clean",
  "data.container": "antsand-grid md:grid-cols-3 gap-6",
  "data.sub_container": "transition-all",
  "data.h3": "text-fluid-lg",
  "data.p": "line-clamp-3 opacity-75",
  "data.cta": "antsand-btn antsand-btn-primary"
}

Blog grid (editorial feel)

{
  "section.container": "antsand-section theme-warm-editorial",
  "data.container": "antsand-grid md:grid-cols-2 gap-8",
  "data.sub_container": "transition-all",
  "data.img_container": "aspect-photo",
  "data.h3": "text-fluid-lg line-clamp-2",
  "data.p": "line-clamp-3",
  "data.cta": "antsand-btn"
}

Pricing table (dark SaaS)

{
  "section.container": "antsand-section theme-dark-corporate",
  "data.container": "antsand-grid md:grid-cols-3 gap-6",
  "data.sub_container": "transition-all",
  "data.h3": "text-fluid-xl",
  "data.span": "text-fluid-3xl font-bold",
  "data.p": "opacity-75",
  "data.cta": "antsand-btn antsand-btn-primary touch-target-lg"
}

Hero section (bold gradient)

{
  "section.container": "antsand-section theme-bold-gradient",
  "section.h2": "text-fluid-4xl font-bold",
  "section.p": "text-fluid-lg opacity-75",
  "data.container": "antsand-grid md:grid-cols-2 gap-8",
  "data.cta": "antsand-btn antsand-btn-primary touch-target-lg"
}

🧠 The AI Prompt Module

Inside the Databoard UI, the file agentPromptCss.module.js auto-generates a structured prompt for the current section. It includes:

You don't need to parse the JS file. When working inside Databoard, click "Copy AI Prompt" β€” it generates the prompt for the active section. Paste it into any AI chat to get correctly-scoped CSS.

πŸ”§ Troubleshooting

Classes aren't showing on the deployed site

Did you call /utilities/compile before /deploy? The scanner must run to generate board-local utility CSS. Also check unsupported_classes in the compile response β€” those won't render.

Theme isn't applying to all elements

The theme class goes on section.container, not on individual fields. Check that you patched datalist.N.css.section.container and not datalist.N.css.data.h3.

API returns 401 Unauthorized

Verify your API key with GET /api/v1/me. API keys use Authorization: Bearer header, not cookies. Keys are scoped to the user who created them.

Need custom CSS beyond utility classes

Patch the board's sass.common_styles field with custom SCSS. This gets compiled into the site's CSS bundle during deploy. Use standard CSS selectors targeting the fixed hierarchy classes (.data-h3, .data-sub-container, etc.).