Getting Started

Get your first Spark application running in under a minute.

Prerequisites

Ensure you have the Dart SDK installed (version 3.0 or later).

Install the CLI

Install the Spark CLI globally:

dart pub global activate spark_cli

Create a Project

Create a new Spark project:

spark init my_app
cd my_app

Start Development

Run the development server with hot reload:

spark dev

Visit `http://localhost:8080` to see your app. The server automatically reloads when you save changes.

Project Structure

The CLI generates a project with this structure:

my_app/
├── bin/
│   └── server.dart      # Server entry point
├── lib/
│   ├── pages/           # Page files
│   ├── components/      # Web components
│   └── endpoints/       # API routes
└── pubspec.yaml

Build for Production

Build a standalone executable for deployment:

spark build

This creates `build/server`, a single executable that runs without the Dart SDK.