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 许可协议。转载请注明出处!
相关文章
开发现代化的.NetCore控制台程序:(4)使用GithubAction自动构建以及发布nuget包
GitHub Action自动构建发布nuget包,省时省力。Secrets管理token,workflow一劳永逸。吐槽nuget推送重复输入token,烦人!
2023-11-13 · C# · 约 1 分钟
纯 C#实现+AOT 打造的多功能图片处理工具 ImageGlider
纯C#+AOT打造的ImageGlider,图像处理功能堆得像山,还非得标榜零依赖?ImageSharp封装得倒是挺顺溜,就是不知道这模块化架构能走多远。Web API和CLI工具有点东西,但别指望我夸太离谱。
2025-08-05 · C# · 约 1 分钟
C#中AES加密的实现
AES算法简介 高级加密标准(英语:Advanced Encryption Standard,缩写:AES),在密码学中又称Rijndael加密法,是美国联邦政府采用的一种区块加密标准。这个标准用来替代原先的DES,已经被多方分析且广为全世界所使用。经过五年的甄选流程,高级加密标准由美国国家标准与技术研究院(NIST)于2001年11月26日发布于FIPS PUB 197,并在2002年5月26日
2022-05-27 · C# · 约 1 分钟
C#使用iKvm黑科技无缝接入JVM生态
C#开发者用iKVM白嫖JVM生态?省事,但依赖处理还得手动折腾。无缝接入?不过是把JAR转DLL,省了移植代码的麻烦。AI工具缺?直接调用HanLP,但依赖处理,呵呵。
2023-10-06 · C# · 约 1 分钟
讨论
共 0 条加载评论中…