Skip to content

Installation ​

Meet DotBlaze ​

DotBlaze (a blaze: a fast, powerful flame) is a web framework that gives ASP.NET Core the developer experience of Laravel: a clear folder convention, facades, Eloquent-style models, hand-written migrations, queues, and a command line that runs through the application itself, like Artisan. Views are Blade templates (.blade.html, compiled to Razor) or plain Razor (.cshtml), styled with Tailwind CSS, with Alpine.js for small interactions.

Why DotBlaze? ​

DotBlaze does not replace ASP.NET Core. Routing, dependency injection, EF Core, Razor, authentication, and Data Protection all do the real work; DotBlaze is a layer of conventions and Laravel-style APIs on top of them. You can use static facades (Config.Get(...), Log.Info(...)) the Laravel way, or inject the same services through constructors the .NET way.

Creating a DotBlaze Application ​

Requirements ​

DotBlaze is published on nuget.org, so you do not need the DotBlaze repository.

Installing the Template and the CLI ​

Install the application template and the dotblaze command line tool from nuget.org:

shell
dotnet new install DotBlaze.Templates
dotnet tool install --global DotBlaze.Cli

The tool is optional: everything it runs in your application also works with dotnet run -- <command>. See Console Commands.

Creating the Application ​

Create a new application with dotblaze new, which runs dotnet new dotblaze-app. The name is used for the project, its root namespace, and the directory it is created in:

shell
dotblaze new Blog
cd Blog

Without the CLI, run dotnet new dotblaze-app -n Blog instead.

The new application references the DotBlaze package from nuget.org, at the same version as the template. See Directory Structure for a tour of the generated files.

Running the Application ​

Create the SQLite database by running the migrations, build the frontend assets, and start the application:

shell
dotblaze migrate
npm install && npm run build
dotblaze serve

dotblaze migrate is DotBlaze's version of php artisan migrate: the CLI forwards the command to the application, which runs it instead of starting the web server. See Console Commands.

Once the server has started, open the URL it prints (by default http://localhost:5000). The welcome page shows the application name and a small Alpine.js counter, which confirms that both the CSS and the JavaScript were built.

To seed a test user (test@example.com, password password), run the seeder that ships with the template:

shell
dotblaze db:seed

Hot Reload ​

For local development, start the server with .NET's built-in file watcher. DotBlaze uses rebuild/restart mode so Blade compilation runs for every edit:

shell
dotblaze serve --watch
# Without the DotBlaze CLI:
dotnet watch --no-hot-reload run

dotblaze serve and dotnet run without watch still run normally, without watching for changes. Extra arguments are preserved, for example:

shell
dotblaze serve --watch -- --urls http://localhost:5050

Saving a watched C# or Blade file (resources/views/**/*.blade.html) rebuilds and restarts the application. Refresh the page after the server starts again. In-memory state and open connections are reset. This is intentionally not in-place managed hot reload: Blade translation runs in MSBuild, which managed hot reload does not reliably rerun. Stop watching with Ctrl+C. For a C#/Razor-only project, plain dotnet watch run remains available directly.

The .NET SDK is required. Watch mode is for development, not production. It does not run your frontend build: rebuild CSS/JavaScript separately with npm run build (or the frontend watcher configured in your project). Changes to startup configuration or .env may require a manual restart.

Initial Configuration ​

All configuration lives in the config directory, one C# class per area. Values that differ per machine, such as passwords, belong in a .env file. dotblaze new creates it from .env.example, with a new APP_KEY. If you cloned an existing application, copy the example file and generate a key:

shell
cp .env.example .env
dotblaze key:generate

The template's .env.example lists APP_NAME, APP_KEY, the DB_* connection settings, and the AWS_* variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET, AWS_ENDPOINT) that the config classes read through Env. The .env file is ignored by git. See Configuration for how config files, .env, and environment variables fit together.

Databases ​

A new application uses SQLite, with the database file at database/app.db. To use PostgreSQL, MySQL, or SQL Server, add the matching driver package and set DB_CONNECTION and the connection details in .env:

shell
dotnet add package DotBlaze.Database.Postgres
ini
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=dotblaze
DB_USERNAME=postgres
DB_PASSWORD=secret

Driver packages are loaded automatically by the driver name in the config, so no other code change is needed. See Database: Getting Started for details.

Optional Packages ​

Everything else is in the DotBlaze package. Add these when you need them:

PackageFor
DotBlaze.Database.Postgres, DotBlaze.Database.MySql, DotBlaze.Database.SqlServerPostgreSQL, MySQL, and SQL Server (Database). SQLite is built in.
DotBlaze.Storage.S3The S3 disk (File Storage).
DotBlaze.RedisRedis for the cache, queues, and broadcasting (Redis).
DotBlaze.TinkerThe tinker console (Console Commands).
DotBlaze.ImageResize, crop, convert, and optimize raster images (Images).
DotBlaze.AIAgents, streaming, structured output, media, and retrieval (AI SDK).
DotBlaze.Horizon, DotBlaze.Telescope, DotBlaze.PulseQueue, debugging, and performance dashboards. See their individual installation pages.
DotBlaze.TestingTest helpers, in your test project (Testing).
shell
dotnet add package DotBlaze.Redis

Keep every DotBlaze package on the same version as DotBlaze.

Updating DotBlaze ​

Update the packages in your application to the latest version. Run dotnet add package for DotBlaze and for every other DotBlaze package the application uses, so they all stay on the same version:

shell
dotnet add package DotBlaze
dotnet add package DotBlaze.Database.Postgres

Update the template and the CLI too, so new applications and generated files match:

shell
dotnet new install DotBlaze.Templates
dotnet tool update --global DotBlaze.Cli

WARNING

DotBlaze is below version 1.0, so a new version may contain breaking changes. Run your tests after updating.

Next Steps ​

Now that you have an application running, you may want to read:

First Working Feature ​

Follow the complete application walkthrough after installation. It includes file-by-file code rather than assuming a Post model or controller already exists.

Before adding a feature, confirm the base application works:

shell
dotnet --version
dotnet build
dotblaze migrate
dotblaze db:check
dotblaze route:list

Expected: an SDK version starting with 10., a successful build, applied migrations, matching model/table definitions, and the home route in the route list. Run these commands in the application directory containing its .csproj.

For local development, set the environment in the same terminal before starting the server.

powershell
# PowerShell
$env:ASPNETCORE_ENVIRONMENT = "Development"
dotblaze serve
bash
# Bash / zsh
export ASPNETCORE_ENVIRONMENT=Development
dotblaze serve

If dotblaze is not on PATH, application commands also work as dotnet run -- migrate, dotnet run -- route:list, and dotnet run for the web server. A missing stylesheet means the npm build has not produced wwwroot/build; it is separate from dotnet build.