Documentation

Everything you need to know to build, continuously iterate, and scale AI-native applications on Site Mills.

Introduction

Site Mills is an AI-first web development platform. Rather than dealing with fragmented toolchains, deployment pipelines, and environment setups, you converse with an orchestration agent that iteratively builds an application matching your intent.

We designed the system with constrained scope. By enforcing a consistent, production-ready application model across frontend, backend, and data services, the AI holds significantly deeper context, yielding robust outcomes faster than general AI coding tools.

How It Works

Building an app on Site Mills generally follows a simple loop:

  1. Prompt: Go to the SiteMills Dashboard and describe what you want (e.g., "Build a dashboard that tracks cryptocurrency prices").
  2. Execution: The AI Agent orchestrates several specialized sub-agents. It outlines a plan, provisions a SiteMills Collections DB schema, wires backend fetch routes for public APIs, constructs frontend UI components, and binds them together.
  3. Preview & Verify: The platform instantly compiles your code and hot-reloads it in a sandboxed preview environment. The AI Verifier checks for syntax and runtime errors, patching them autonomously.
  4. Manual Handoff: Jump into the integrated Code Editor any time to manually tweak logic, fix CSS, or add developer collaborators to your workspace.

Architecture Stack

Tight ecosystem for maximum speed

We strictly enforce a highly optimized software stack. This removes "glue code" hallucination risk and guarantees sub-second compilation across your entire project.

  • Frontend Core: Component-based UI architecture with modern styling primitives.
  • Backend Runtime: SiteMills Sandbox Runtime executes server logic in a secure, high-performance environment.
  • Data Layer: SiteMills Collections DB and managed object storage accessed through runtime APIs.
  • Orchestrator: SiteMills orchestration engine managing prompt strategies, multi-agent workflows, code history, and system rollbacks.

Frontend Experience

Your frontend source code uses standard component structures. The AI organizes reusable views, state, and styling into clean semantic markup and maintainable modules.

Because there is no "build step" visible to you, changes made either via the SiteMills Dashboard prompt or manually in the Code Editor are instantly reflected in your deployment envelope.

SiteMills Sandbox Runtime (Backend)

Traditional backend deployments are slow and costly. SiteMills provides a secure sandbox runtime for backend handlers and jobs, optimized for low-latency execution in each workspace.

For safety and consistency, the runtime exposes a curated server API surface for data access, integrations, storage, and observability.

Third-Party APIs & Integrations

Need to wire up Stripe, Twilio, OpenAI, or a specialized internal CRM? Simply ask the AI to map it. Because the frontend shouldn't hold secrets, the AI will build a backend runtime handler that stores your API keys securely inside our platform's Vault, performs the outbound HTTP fetch, and proxies sanitized JSON down to your frontend. For deferred workloads, SiteMills also includes a built-in async message queue surface (ctx.queue) so you can offload expensive tasks without introducing custom queue infrastructure.

Scheduled Jobs & Automation

Site Mills natively supports background automation without managing external schedulers or queue infrastructure. Through the dashboard or your AI Prompts, you can define asynchronous Jobs (e.g., Run billing compilation at 12:00 AM UTC daily). The runtime engine guarantees highly-available orchestration of these routines.

Async Message Queues

Use ctx.queue when you want request handlers to hand work off asynchronously. You enqueue a message with a target handler route, then the runtime processes it out-of-band with retries, explicit ack/no-ack support, and dead-letter handling.

  • Enqueue: ctx.queue.enqueue({ queueName, handlerRoute, payload, ... }) (or send(...) alias).
  • Ack: Return ctx.queue.ack(...) in the queue handler for successful completion.
  • No-ack / Retry: Return ctx.queue.nack({ requeue: true, retryDelayMs, reason }) for retryable failures.
  • Dead-letter: Return ctx.queue.nack({ requeue: false, reason }) or exceed max retries.

Queue messages inherit the active runtime data scope: branch previews use branch scope, while deployed environment URLs use stable dev/staging/prod scopes.

This is useful for email fan-out, webhook retries, long-running enrichment, and post-checkout workflows that should not block a synchronous response.

SiteMills Collections DB

All projects come with access to a managed collections database. The AI uses the built-in runtime db() API to manage schema-flexible structured data. Through the platform Dashboard, you can manually oversee records, evolve structure, query JSON documents, or purge caches.

Site Analytics & Insights

You don't need Google Analytics. The platform proxy records passive privacy-focused telemetry on edge requests. Access the Insights tab on your Dashboard to view global unique visits, API latency graphs, standard error rates across your runtime services, and geographical distribution metrics-all visualized in real-time. Queue usage is also tracked under event type queue_usage with event names such as queue_message_enqueued, queue_message_retried, and queue_message_dead_lettered.

Collaboration & IDE

No more sending zip files or wrestling with Git conflicts. Site Mills workspaces can be shared with a simple URL.

  • Invite Engineers: Coworkers get access to the professional web IDE built right into your dashboard.
  • Simultaneous Editing: The AI can act as junior developer. Ask it to fix styling on the Header component while you manually write complex sorting algorithms in the backend Data controller.

Exporting Code

You are never locked in. If your scale exceeds Site Mills, or you desire traditional hosting platforms, you can instantly export your compiled application. The generated ZIP structure maps cleanly to a standard Monorepo layout ready for Vercel, Netlify, or standard Docker containment.