Description
Simplify.Web is a lightweight and fast server-side .NET web-framework based on MVC and OWIN patterns for building HTTP based web-applications, RESTful APIs etc.
It can be used as: An API backend framework, As a mix of API backend + some SPA front end like Angular, As an old way backend generated web-site.
It can be hosted: The same way as an ApsNetCore MVC application (On IIS, or as a console application), Inside a windows service
Simplify.Web alternatives and similar packages
Based on the "Application Frameworks" category.
Alternatively, view Simplify.Web alternatives based on common mentions on social networks and blogs.
-
CoreFX
DISCONTINUED. This repo is used for servicing PR's for .NET Core 2.1 and 3.1. Please visit us at https://github.com/dotnet/runtime -
Introducing .NET Multi-platform App UI (MAUI)
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. -
ABP
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation. -
Uno Platform
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. -
DotNetty
DotNetty project – a port of netty, event-driven asynchronous network application framework -
Fusion
Build real-time apps (Blazor included) with less than 1% of extra code responsible for real-time updates. Host 10-1000x faster APIs relying on transparent and nearly 100% consistent caching. We call it DREAM, or Distributed REActive Memoization, and it's here to turn real-time on! -
Mono-Addins
DISCONTINUED. Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications. -
silky
The Silky framework is designed to help developers quickly build a microservice development framework through simple code and configuration under the .net platform. -
Newbe.Claptrap
This is a frameworks with reactive, event sourcing and Actor pattern as basic theories. On top of this, developers can create "distributed", "scale out", and "easy to test" application more simply. Claptrap and it`s Minions is on the way. -
Gradio.NET
⭐Gradio for .NET – a port of Gradio, an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function. Gradio for .NET – 基于 Gradio 的 .NET 移植,Gradio 是一个开源 Python 包,允许你为机器学习模型、API 或任何任意 Python 函数快速构建演示或 Web 应用程序。 -
MicroBootstrap
DISCONTINUED. A Full Stack framework written in .NET Core to speed up your development process in microservices and modular monolith apps. It gathers most widely used frameworks in .NET world and pack them into a simple bootstrap package. -
PersianDataAnnotations
PersianDataAnnotations is ASP.NET Core MVC & ASP.NET MVC Custom Localization DataAnnotations (Localized MVC Errors) for Persian(Farsi) language - فارسی سازی خطاهای اعتبارسنجی توکار ام.وی.سی. و کور.ام.وی.سی. برای نمایش اعتبار سنجی سمت کلاینت -
Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. -
Ether.Network
DISCONTINUED. Ether.Network is an open source networking library that allow developers to create simple, fast and scalable socket server or client applications over the TCP/IP protocol.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Simplify.Web or a related project?
README
Simplify.Web
Simplify.Web is an open-source, lightweight and fast server-side .NET web-framework based on MVC and OWIN patterns for building HTTP based web-applications, RESTful APIs etc.
Framework can be used as:
- An API backend framework
- As a mix of API backend + some SPA front end like Angular
- As an old way backend generated web-site
Can be hosted:
- The same way as an ApsNetCore MVC application (On IIS, or as a console application)
- Inside a windows service
Main features
- Comes as Microsoft.AspNetCore middleware
- Can be used as an API backend only with front-end frameworks
- Based on MVC and MVVM patterns
- Lightweight & Fast
- Uses switchable IOC container for itself and controllers, views constructor injection (Simplify.DI)
- Support async controllers
- Supports controllers which can be run on any request
- Localization-friendly (supports templates, strings and data files localization by default)
- Uses fast templates engine (Simplify.Templates)
- Mocking-friendly
- Mono-friendly
Quick start
There is a templates package available at nuget.org for Simplify.Web. It contains a couple of templates which can be a good starting point for your application.
Installing a templates package:
dotnet new -i Simplify.Web.Templates
Template | Short Name |
---|---|
Angular template | sweb.angular |
Api template | sweb.api |
Minimal template | sweb.minimal |
Windows service hosted api template | sweb.api.windowsservice |
Use the short name to create a project based on selected template:
dotnet new sweb.angular -n HelloWorldApplication
Then just run project via F5 (it will download all required nuget and npm packages at first build).
Detailed documentation
API outgoing JSON controller example
[Get("api/v1/weatherTypes")]
public class SampleDataController : Controller
{
private static readonly string[] Summaries =
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public override ControllerResponse Invoke()
{
try
{
return new Json(items);
}
catch (Exception e)
{
Console.WriteLine(e);
return StatusCode(500);
}
}
}
API ingoing JSON controller example
[Post("api/v1/sendMessage")]
public class SampleDataController : Controller<SampleModel>
{
public override ControllerResponse Invoke()
{
try
{
Trace.WriteLine($"Object with message received: {Model.Message}");
return NoContent();
}
catch (Exception e) when (e is ModelValidationException || e is Newtonsoft.Json.JsonException)
{
return StatusCode(400, e.Message);
}
catch (Exception e)
{
Console.WriteLine(e);
return StatusCode(500, "Site error!");
}
}
}
public class SampleModel
{
[Required]
public string Message { get; set; }
}
Some simple HTML generation controllers example
Static page controller
// Controller will be executed only on HTTP GET request like http://mysite.com/about
[Get("about")]
public class AboutController : Controller
{
public override ControllerResponse Invoke()
{
// About.tpl content will be inserted into {MainContent} in Master.tpl
return new StaticTpl("Static/About", StringTable.PageTitleAbout);
}
}
Any page controller with high run priority example
Runs on any request and adds login panel to a pages
// Controller will be executed on any request and will be launched before other controllers (because they have Priority = 0 by default)
[Priority(-1)]
public class LoginPanelController : AsyncController
{
public override async Task<ControllerResponse> Invoke()
{
return Context.Context.Authentication.User == null
// Data from GuestPanel.tpl will be inserted into {LoginPanel} in Master.tpl
? new InlineTpl("LoginPanel", await TemplateFactory.LoadAsync("Shared/LoginPanel/GuestPanel"))
// Data from LoggedUserPanelView will be inserted into {LoginPanel} in Master.tpl
: new InlineTpl("LoginPanel", await GetView<LoggedUserPanelView>().Get(Context.Context.Authentication.User.Identity.Name));
}
}
View example
public class LoggedUserPanelView : View
{
public async Task<ITemplate> Get(string userName)
{
// Loading template from LoggedUserPanel.tpl asynchronously
var tpl = await TemplateFactory.LoadAsync("Shared/LoginPanel/LoggedUserPanel");
// Setting userName into {UserName} variable in LoggedUserPanel.tpl
tpl.Add("UserName", userName);
return tpl;
}
}
Example applications
Below is the list of sample applications showing different variations of Simplify.Web usage:
- Only as an API backend with Angular + Bootstrap UI SPA
- Simple Kestrel-based Application with backend page
- Kestrel-based Application with backend HTML generation, localization, authentication
- Only as an API backend with Vue.js + Bootstrap UI SPA
- Only as an API backend with Vue.js + Element UI SPA
- Simple Kestrel-based Application hosted as windows-service
Contributing
There are many ways in which you can participate in the project. Like most open-source software projects, contributing code is just one of many outlets where you can help improve. Some of the things that you could help out with are:
- Documentation (both code and features)
- Bug reports
- Bug fixes
- Feature requests
- Feature implementations
- Test coverage
- Code quality
- Sample applications
Related Projects
Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:
- Simplify.Web.Json - JSON serialization/deserialization
- Simplify.Web.Multipart - multipart form model binder
- Simplify.Web.MessageBox - non-interactive server side message box
- Simplify.Web.Templates - Visual studio project templates
License
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
*Note that all licence references and agreements mentioned in the Simplify.Web README section above
are relevant to that project's source code only.