Webapp

From kortix-ai/suna · View interactive version

Webapp is an AI agent skill from the GitHub repository kortix-ai/suna. Use for fullstack web apps built with the bundled Express, Vite, React, Tailwind, and Drizzle template.

How to use this skill

Skill file

Fullstack Web App

Build fullstack web applications using an opinionated pre-wired template: Express + Vite + React + Tailwind CSS + shadcn/ui + Drizzle ORM.

Load the kortix-design skill before you write UI. It owns every visual choice: tokens, type, color, states, motion, the slop sweep and the screenshot check. This skill owns the template and the build.

Getting Started

Copy the template into its own App folder (apps/<name>/ by default; one

folder per App), then install dependencies:

cp -r skills/webapp/template/ apps/<name>/
cd apps/<name>
npm install

Run the dev server:

npm run dev

This starts an Express server for the backend and a Vite server for the frontend on the same port.

Build Order

Follow this order strictly:

  1. Schema — Define your data model in shared/schema.ts first
  2. Frontend — Build all React components and pages
  3. Backend — Implement Express routes in server/routes.ts
  4. Integration — Wire frontend to backend via queryClient

Architecture


Webapp Template — Design Notes

The shared design files (see References below) are the authoritative source for all design decisions — colors, fonts, type scale, spacing. This section only covers template-specific workflow that the shared files don't address.

Replacing `red` Placeholders in `index.css`

The template's index.css ships with red placeholder values that must be replaced before the app looks right. Infer a palette from the subject matter first — a fitness tracker should feel energetic (bright accent, dark surfaces), a recipe app should feel warm (amber/terracotta tones), a finance dashboard should feel precise (cool neutrals, blue accent). Derive colors from the product's domain, not from a generic default.

When deriving a custom palette, use HSL values in H S% L% format (no hsl() wrapper) and maintain both :root and .dark variants following the same variable structure in index.css.

If the subject gives no clear color signal and the user provided no direction after being asked, fall back to the Kortix neutral system from skills/website-building/shared/01-design-tokens.md and use a single accent color only where emphasis is needed.

Webapp-Specific Type and Font Rules


Art Direction by Product Type

| Product Type | Concept-Driven Direction | Token Starting Points |

|---|---|---|

| SaaS / productivity | A writing tool is calm and typographic. A project management tool is structured and efficient. A design tool is visual and spacious. Match personality to purpose. | Neutral surfaces. 1 accent. Body font that matches the product's character. |

| Dashboard / analytics | Finance dashboards demand precision and sobriety. Marketing dashboards can be warmer and more visual. The data's domain sets the tone. | Sans-serif + monospace for data. High-contrast. Load skills/webapp/dashboards.md. |

| E-commerce | Luxury goods: muted surfaces, serif display, restrained accent. Kids' toys: warm, bright, rounded. Outdoor gear: earthy tones, rugged sans-serif. | Warm palette derived from product category. Strong CTA contrast. |

| Brand experience | A music streaming brand differs from an architecture studio. Derive everything from the brand. | Display font at --text-xl in-app; --text-2xl ONLY for marketing/landing hero sections. 1-2 custom accent hues. Theatrical motion. |

| Admin panel | Utilitarian, clear, efficient. A healthcare admin panel feels different from a developer tools panel. | Inter or DM Sans (loaded via CDN, not system fonts). Functional color only. Dense layout. |


Best Practices by App Type

SaaS Products & Dashboards

E-Commerce & Online Stores

Brand Experiences & Marketing Apps


Types

Storage

Backend

Frontend

Components: shadcn/ui on Base UI

The components in client/src/components/ui/ are shadcn/ui on Base UI (@base-ui/react), not Radix. Their names, variants and look are shadcn's. Never install @radix-ui/*, radix-ui, cmdk or vaul. Do not run npx shadcn add: every component is already in the template, and the registry ships Tailwind v4 classes this v3 template cannot use. To add a component, write it on Base UI in the same style as the existing files.

What differs from older shadcn examples:

Styling and Theming

--my-var: 23 10% 23%;

Dark Mode

  1. Set darkMode: ["class"] in tailwind.config.ts and define color variables in :root and .dark CSS classes
  2. Create ThemeProvider with useState seeded from window.matchMedia("(prefers-color-scheme: dark)"), and a useEffect to toggle the "dark" class on document.documentElement. Do not use localStorage or cookies for theme persistence — they are blocked in the sandboxed iframe.
  3. When not using utility class names configured in tailwind.config.ts, always use explicit light/dark variants for ALL visual properties: className="bg-white dark:bg-black text-black dark:text-white". When using utility classes configured in tailwind config, you can assume these already been configured to automatically adapt to dark mode.

Running the Project

Run npm run dev to start the development server. This starts Express for the backend and Vite for the frontend on the same port. After making edits, the server will automatically reload.

Installing Packages

If you need to install additional packages, run npm install <package-name>.

Testing

Read skills/website-building/shared/12-playwright-interactive.md for testing and QA. Use Playwright via agent-browser to navigate, interact with, and screenshot your local dev server.

Deployment

Static-only apps (no server logic):

Build the frontend and deploy the static output:

cd apps/<name>
npm run build

Then preview the built app locally with a real command such as python3 -m http.server 3000 from the output directory, or use the repo's actual deployment command if one exists.

Apps with backend (most webapp projects):

The template runs Express on port 5000. After building, deploy the static output and the backend server handles API calls via port proxy:

  1. Build: npm run build
  2. Start the production server locally with node dist/index.cjs via pty_spawn when you need a production-style verification pass.
  3. If a real deployment workflow exists for the target repo, use that exact workflow instead of inventing a platform-specific deploy command.

Keep API paths and environment assumptions explicit so local verification works before any deployment step.

On Kortix (when kortix apps ls exits 0): deploy with the kortix-apps

system skill (kortix system-skills get kortix-apps), only after the user asks

to publish.

kortix apps deploy apps/<name>/dist/public --type static --spa. No machine, no

compute cost.

the app, then deploy apps/<name> with `--type dockerfile --on-demand

--command '["node","dist/index.cjs"]' --port 5000`. In-memory storage is lost whenever the App stops (an on-demand

App stops after 5 idle minutes) and on every new deployment. Say so before

you publish.

Config File Guidance

Environment

Read skills/webapp/references/environment.md — pre-installed packages, dev server setup, deployment constraints.

References

Before writing code, read the shared design files below (mandatory). Then identify whether any webapp-specific reference applies to the task. If it does, read it in parallel with skills/webapp/references/environment.md.

Shared design guidance (authoritative — read first):

These files come from the website-building dependency and live under skills/website-building/shared/ — NOT under skills/webapp/shared/.

Webapp-specific references:

These files live under skills/webapp/references/.

SEO

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.