Before creating your first spark project, you should ensure that your local machine has:

  • .NET 7 - You can find the download here.
  • Node and Npm - You can find the download here

Once you have the .NET 7 SDK installed, you will also need Entity Framework Core tools. This can be installed with a simple dotnet command in your terminal:

dotnet tool install --global dotnet-ef

Your First Spark Project

After you have installed the required dependencies, you will need to install the Spark CLI.

# Install the Spark CLI
dotnet tool install --global Spark.CLI

Then using the Spark CLI, install the Spark project templates.

# Install Spark's project templates
spark install

You are now ready to create your first Spark project!

# Create your first Spark project
spark new MyApp

Spark comes with several project templates to choose from. You can choose to generate your project with a certain template by providing the -t option.

Blazor Example: spark new MyApp -t blazor

Api Example: spark new MyApp -t api

To read more about project templates, check out our documentation here

Now that your project has been created, cd into the root folder and run npm install.

cd MyApp
npm install

You can now create and run your first database migration. This will create the User tables for authentication that comes with a fresh Spark project.

spark make migration User
spark migrate

Open your Spark project in the console by using Spark’s open command. This will open it with your default IDE.

spark open

Finally, start .NET’s local development server using the dotnet watch command:

dotnet watch

Updating Spark CLI

The easiest way to update the Spark CLI is to uninstall and reinstall it.

dotnet tool uninstall -g Spark.CLI
dotnet tool install -g Spark.CLI

Updating Spark’s Project Templates

To update Spark’s project templates, simply run the spark update command in your console.

spark update

Stay up to date with Spark on Twitter or our Newsletter

Looking for .NET jobs? Check out Dotnet Jobs for weekly job postings.