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_cliCreate a Project
Create a new Spark project:
spark init my_app
cd my_appStart Development
Run the development server with hot reload:
spark devVisit `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.yamlBuild for Production
Build a standalone executable for deployment:
spark buildThis creates `build/server`, a single executable that runs without the Dart SDK.