Spark.NET: A Full-Stack Web Framework Trying to Bring a Django / Rails-Style Development Experience Back to the .NET World.
Another attempt to bring Django/Rails-style “convention over configuration” into the .NET ecosystem—looks somewhat interesting. Auth, queues, scheduled jobs and other such chores come pre-baked, so you don’t have to reinvent the wheel every day. But 767 stars and not even a formal release, yet it dares to fly the “production-grade” banner? Heh. C# full-stack enthusiasts can play around with it first, but don’t expect it to replace ASP.NET Core in scale.
目录12 个章节
Introduction
In the AI era, the thinking around technology selection has changed. At least over these past two years, my new projects have all leaned toward a monolithic architecture.
Recently, while working with the ASP.NET Core stack, I discovered an interesting framework: Spark.NET
A full-stack web framework trying to bring a Django / Rails-style development experience back to the .NET world
This framework doesn’t create a brand-new set of technologies. Instead, it pre-installs, integrates, and standardizes ASP.NET Core, EF Core, Blazor SSR / Razor Pages, Vite, Tailwind, authentication, queues, scheduled jobs, CLI, and the like, using a “convention over configuration” approach.
It’s a pretty decent scaffold.
Framework Positioning
Spark.NET officially defines itself as a full-stack web application framework extended from the foundational capabilities of ASP.NET and Entity Framework, with the goal of letting developers more quickly build feature-complete monolithic full-stack web applications.
The official docs explicitly say its goal is to help developers easily build “monolithic, full stack web applications”.
The description in the GitHub README is equally direct: The .NET Web Framework for Makers, emphasizing “production-grade”, “full-stack”, “without sweating the small stuff”.
However, as of when I checked, the repo showed 767 stars, 60 forks, MIT License, and no formal releases yet.
That means it’s more like a “productized ASP.NET Core scaffold + framework convention layer”.
Features
A “Full-Stack Monolith” Approach Aimed at Indie Developers and Small Teams
Spark.NET’s default orientation is not microservices or complete frontend-backend separation, but a Monolithic Full-stack Web App.
Many .NET projects naturally lean enterprise-grade, layered, and heavyweight, while Spark.NET’s vibe is more like Laravel, Rails, Django: get common capabilities like authentication, mail, logging, events, background queues, scheduled jobs, and user dashboards ready first, so developers can go straight into business development.
The official intro lists preconfigured capabilities including Authentication, Mail, Logging, Events & Listeners, Background Queues, Scheduled Jobs, and it also scaffolds login, registration, user dashboard, and user profile pages.
A line worth highlighting:
This isn’t “a more low-level ASP.NET Core”—it’s “an ASP.NET Core closer to the product-development experience”.
“Convention over Configuration” Design
Spark.NET emphasizes a fixed project structure. The official docs say every Spark project has the same project structure, so that whether you’re encountering it for the first time or maintaining an existing project, you know where things are.
Its directory structure is also quite clear:
Application/
Database/
Events/
Jobs/
Mail/
Models/
Services/
Startup/
Assets/
Pages/
Storage/
wwwroot/
Application holds core business code, Database holds EF Core’s DatabaseContext and migration files, Events holds events and listeners, Jobs holds queue jobs or scheduled jobs, Mail holds mail classes, Models holds EF Core models, Services holds injectable services, and Startup holds startup configuration such as DI registration, authentication, events, and job registration.
This structure feels very “Django-like”: you don’t have to agonize over where code should go—you’re given a default answer.
Blazor SSR / Razor Pages
Spark.NET provides two frontend options: Blazor SSR and Razor Pages. The official docs explicitly list these two directions.
Nowadays many full-stack solutions default to React / Next.js / Vue / Nuxt, while Spark.NET chooses to stay in the .NET ecosystem:
- Blazor SSR: organize the UI with Razor Components;
- Razor Pages: traditional server-rendered pages;
- You can use HTMX to enhance navigation, form submissions, and partial refreshes;
- Razor Pages can also be paired with Hydro, giving backend C# components a React-like interactive experience.
This is relatively friendly for indie developers familiar with C#, small SaaS products, internal systems, and admin-style products.
Built-in Modern Frontend Toolchain
Vite + Tailwind CSS + DaisyUI
Although it isn’t on the React/Vue path, Spark.NET doesn’t reject modern frontend tools. The official docs say that Spark projects install Tailwind CSS and DaisyUI via NPM by default, custom CSS goes in Assets/Css/app.css, and CSS / JS is bundled through Vite.
What’s more interesting is that Spark uses the Vite.AspNetCore NuGet package, which automatically starts the Vite server during local development; it also automatically builds frontend assets on dotnet build or dotnet publish.
Excellent CLI Experience
Spark.NET provides its own CLI. The install method is:
dotnet tool install -g Spark.CLI
Then you can run:
spark install
spark update
spark new MyApp
spark make model Developer
spark make migration AddDeveloperTable
spark migrate
spark make component Profile/ProfileDetails
spark make page Profile/Index
spark make event UserRegistered SendWelcomeEmail
spark make mail WelcomeMail
spark make service DeveloperService
spark make job ExampleJob
The official docs list these commands. The CLI can create files for projects, models, migrations, components, pages, events, mail, services, jobs, and more.
Spark.NET tries to provide a complete development workflow—a very modern development experience.
Database Integration
Spark.NET integrates EF Core by default, and new projects come with SQLite already configured by default. The official docs list database support including SQLite, PostgreSQL, MySQL, and SQL Server. Database configuration lives in the .env file, switched via DB_CONNECTION.
On the model side, it requires models to inherit BaseModel, a base class that includes three properties: Id, CreatedAt, and UpdatedAt. Migrations are done via:
spark make migration AddDeveloperTable
spark migrate
The official docs also provide EF Core extension methods like Save and Delete, reducing routine create, update, and delete code.
This also reflects its design philosophy: making the EF Core experience smoother.
Built-in Authentication, Authorization, and API Routing
On authentication, Spark.NET is based on .NET Authentication and provides its own cookie provider; login, logout, registration, and profile-editing pages are all generated for you. Auth configuration can go in appsettings.json, such as login path, cookie expiration days, password strength rules, and so on.
Route protection is fairly standard as well: you can use [Authorize] on Razor pages, or use PageState.User.IsAuthenticated to decide whether to show parts of a page.
On the API side, it uses Minimal APIs. Just create a class that implements the IRoute interface under the Pages/Api directory, and Spark will automatically register these API routes at startup; when you need to protect an endpoint you can use .RequireAuthorization(), and you can also pass role restrictions.
Events, Queues, and Scheduled Jobs—Suited for Real Product Development
Many scaffolds only take care of pages and the database, but Spark.NET also considers background jobs. The official intro lists Events & Listeners, Background Queues, and Scheduled Jobs as default capabilities.
Jobs are based on Coravel’s IInvocable and can be used for background queues or scheduled jobs. Official examples mention that you can run a job every 5 minutes via the scheduler, for example checking inactive users.
For people actually building products, authentication, mail, queues, and scheduled jobs aren’t “we’ll deal with it later” advanced features—they’re infrastructure you’ll run into soon enough. Spark.NET puts these into the framework’s default capabilities ahead of time.
Wrap-up
Spark.Net is a framework that looks quite promising.
Of course, it’s not without problems.
First, it’s still relatively young.
The GitHub page shows no formal releases yet, which means you need to be more cautious when adopting it in production.
Second, its technical direction is very clear: Blazor SSR / Razor Pages / C# full-stack. If your team already deeply uses React, Vue, Next.js, or wants complete frontend-backend separation, then Spark.NET may not be a fit.
Third, its ecosystem maturity definitely can’t compare with mature frameworks like ASP.NET Core itself, Laravel, Rails, or Django. It’s more like a new direction worth watching, not a technical foundation you can blindly bet on.
But I think Spark.NET has one thing that’s very much worth affirming:
It recognizes that the .NET ecosystem doesn’t lack low-level capabilities—what it lacks is a smoother, more productized development experience better suited to spinning up projects quickly.
ASP.NET Core is powerful, but often too “low-level”, too “generic”, too “figure it out yourself”.
What indie developers, small teams, and Makers need is: auth already there, user system already there, queues already there, scheduled jobs already there, frontend build already there, directory structure already there, CLI already there.
That’s where Spark.NET’s value lies.
It may not be the ultimate answer for the .NET ecosystem, but it represents a direction I really like: letting C# developers also have that fast, complete, comfortable full-stack development experience of Django / Rails.
For developers who want to quickly build SaaS, internal systems, admin panels, and small products with .NET, Spark.NET is worth putting on the watch list.
_EOF_
Spark.NET: A Full-Stack Web Framework Trying to Bring a Django / Rails-Style Development Experience Back to the .NET World.
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
SharpIco:用纯C#打造零依赖的.ico图标生成器,支持.NET9与AOT编译
SharpIco 是一款纯 C# 实现的跨平台图标生成工具,支持 AOT 编译,无需外部依赖。它能将 PNG 图片分解为多尺寸(16x16至512x512)合成 ICO 图标,并支持图标结构分析。工具提供命令行界面,可通过 dotnet tool 一键安装,并已发布至 NuGet 和 Scoop。项目旨在简化图标生成与验证,追求轻量、纯粹、易集成的使用体验。
2025-05-26 · C# · 约 1 分钟
使用C#和MemoryCache组件实现轮流调用APIKey以提高并发能力
本文介绍了如何利用C#语言中的MemoryCache组件,结合并发编程技巧,实现轮流调用多个API Key以提高系统的并发能力。通过示例代码和详细说明,读者将了解如何有效地管理API Key的调用次数限制,并优化系统性能。
2024-03-09 · C# · 约 1 分钟
System.Text.Json使用中的几个常见问题
前言 以前.NetCore是不内置JSON库的,所以大家都用Newtonsoft的JSON库,而且也确实挺好用的,不过既然官方出了标准库,那更方便更值得我们多用用,至少不用每次都nuget安装Newtonsoft.Json库了。 不过日常开发使用中会有一些问题,本文记录一下解决方法,欢迎交流~ ~~(文章末尾包含小彩蛋)~~ 字符编码问题 默认的 System.Text.Json 序列化的时候会把
2022-05-27 · C# · 约 1 分钟
C#学习(一)委托的概念和使用
前言 C#学习系列是根据我以前的笔记整理出来复习,顺便发一下文章做个记录。 先引用一个介绍: C# 中的委托(Delegate)类似于 C 或 C++ 中函数的指针。委托(Delegate) 是存有对某个方法的引用的一种引用类型变量。引用可在运行时被改变。 委托(Delegate)特别用于实现事件和回调方法。所有的委托(Delegate)都派生自 System.Delegate 类。 根据使用其他
2021-12-18 · C# · 约 1 分钟
讨论
共 0 条加载评论中…