All Projects → servicetitan → Stl.fusion.samples

servicetitan / Stl.fusion.samples

Licence: mit
A collection of samples for Fusion library: https://github.com/servicetitan/Stl.Fusion

Projects that are alternatives of or similar to Stl.fusion.samples

Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (+1220%)
Mutual labels:  realtime, dotnet-core
Realm Dotnet
Realm is a mobile database: a replacement for SQLite & ORMs
Stars: ✭ 927 (+1326.15%)
Mutual labels:  realtime, dotnet-core
Dotnetworkqueue
A work queue for dot.net with SQL server, SQLite, Redis and PostGreSQL backends
Stars: ✭ 58 (-10.77%)
Mutual labels:  dotnet-core
Icanpay.donet
统一支付网关。支持NET46和NETSTANDARD2_0。支持支付宝,微信,银联支付渠道通过Web,App,Wap,QRCode方式支付。简化订单的创建、查询、退款跟接收网关返回的支付通知等功能
Stars: ✭ 62 (-4.62%)
Mutual labels:  dotnet-core
Pioneer Console Boilerplate
Dependency injection, logging and configuration in a .NET Core console application.
Stars: ✭ 60 (-7.69%)
Mutual labels:  dotnet-core
Community Cluster
OpenFaaS Cloud Cluster for Community
Stars: ✭ 59 (-9.23%)
Mutual labels:  dotnet-core
Rtscli
Python CLI Stocks Ticker + Portfolio Tracker
Stars: ✭ 61 (-6.15%)
Mutual labels:  realtime
Yarn.msbuild
MSBuild integration for the Yarn package manager.
Stars: ✭ 57 (-12.31%)
Mutual labels:  dotnet-core
Steaming Ip Camera Nodejs
Real time streaming IP/Network security camera on web browser using NodeJS
Stars: ✭ 64 (-1.54%)
Mutual labels:  realtime
Dotnet Bundle
MSBuild task and CLI tools for bundling .NET Core projects into MacOS applications (.app)
Stars: ✭ 59 (-9.23%)
Mutual labels:  dotnet-core
Logvac
Simple, lightweight, api-driven log aggregation service with realtime push capabilities and historical persistence.
Stars: ✭ 61 (-6.15%)
Mutual labels:  realtime
Aspnet Core Clean Arch
It is a clean architecture project template which is based on hexagonal-architecture principles built with .Net core.
Stars: ✭ 60 (-7.69%)
Mutual labels:  dotnet-core
Developing Solutions Azure Exam
This repository contains resources for the Exam AZ-203: Developing Solutions for Microsoft Azure. You can find direct links to resources and and practice resources to test yourself ☁️🎓📚
Stars: ✭ 59 (-9.23%)
Mutual labels:  dotnet-core
Aspnetboilerplate Core Ng
Tutorial for ASP.NET Boilerplate Core + Angular
Stars: ✭ 61 (-6.15%)
Mutual labels:  dotnet-core
Virtualizingwrappanel
Implementation of a VirtualizingWrapPanel for WPF running .NET Framework 4.5+ or .NET Core 3.0+
Stars: ✭ 59 (-9.23%)
Mutual labels:  dotnet-core
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (+1629.23%)
Mutual labels:  realtime
Fakeiteasy
The easy mocking library for .NET
Stars: ✭ 1,092 (+1580%)
Mutual labels:  dotnet-core
Dnczeus
DncZeus 是一个基于ASP.NET Core 3 + Vue.js(iview-admin) 的前后端分离的通用后台权限(页面访问、操作按钮控制)管理系统框架。后端使用.NET Core 3 + Entity Framework Core构建,UI则是目前流行的基于Vue.js的iView(iview-admin)。项目实现了前后端的动态权限管理和控制以及基于JWT的用户令牌认证机制,让前后端的交互更流畅。码云镜像:https://gitee.com/rector/DncZeus 。演示地址(demo):
Stars: ✭ 1,104 (+1598.46%)
Mutual labels:  dotnet-core
Devchatterbot
Stars: ✭ 60 (-7.69%)
Mutual labels:  dotnet-core
Skater .net Obfuscator
Skater .NET Obfuscator is an obfuscation tool for .NET code protection. It implements all known software protection techniques and obfuscation algorithms.
Stars: ✭ 64 (-1.54%)
Mutual labels:  dotnet-core

Welcome to a collection of Fusion samples!

All project updates are published on its Discord Server; it's also the best place for Q/A.
Build Discord Server

Check out Board Games - the newest Fusion sample that implements both Blazor Server and WASM modes, 2 games, chat, online presence, OAuth sign-in, user session tracking, and a number of other 100% real-time features. All of this is powered by Fusion + just 35 lines of code related to real-time updates!

What's Inside?

0. Solution Templates

Sorry, we don't provide dotnet new-based templates yet, but the ones you can copy & modify can be found in the templates folder.

Currently there are 2 app templates:

  • Blazorise-based app template
  • MudBlazor-based app template (it uses an older Fusion version now, so we don't recommend to use it yet)

Open Templates.sln, run any of *.Host or *.Server projects, and go to http://localhost:5005 to them in action.

1. HelloCart and HelloWorld Samples

HelloCart is a small console app designed to show how to implement a simple Fusion API by starting from a toy version of it and gradually transition to its production-ready version that uses EF Core, can be called remotely, and scales horizontally relying on multi-host invalidation.

"QuickStart: Learn 80% of Fusion by walking through HelloCart sample" is the newest part of Fusion Tutorial that covers specifically this sample. Check it out!

Fusion-style HelloWorld shows how to create an incremental build simulation on Fusion. Nothing is really built there, of course - the goal is to shows how Fusion "captures" dependencies right when you use them and runs cascading invalidations.

If you're choosing between HelloWorld and HelloCart - start from HelloCart first, it is

2. HelloBlazorServer Sample

HelloBlazorServer is the default Blazor Server App modified to reveal some Fusion powers. Contrary to the original app:

  • It displays changes made to a global counter in real-time
  • Similarly, it updates weather forecasts in real-time
  • A new "Simple Chat" sample shows a bit more complex update scenario and features a simple chat bot.

If you're curious how big is the difference between the code of these samples and a similar code without any real-time features, check out this part of Fusion README.md.

3. Blazor Samples

Play with live version of this app right now!

It's a dual-mode Blazor SPA hosted by ASP.NET Core website, which also serves its API. The application includes:

  • "Server Time" and "Server Screen" pages showing the simplest timeout-based invalidation
  • "Chat" – a tiny chat relying on event-based invalidation
  • "Composition" shows how Fusion tracks and updates a complex state built from the output of Compute Services (local producers) and Replica Services (remote producers)
  • "Authentication" – a GitHub authentication sample with Google-style real-time session tracking, "Kick", and "Sign-out everywhere" actions.

Check out a 7-min. video walk-through for this sample - the animations below show just some of its features.

Note that "Composition" sample shown in a separate window in the bottom-right corner also properly updates everything. It shows Fusion's ability to use both local IComputed<T> instances and client-side replicas of similar server-side instances to compute a new value that properly tracks all these dependencies and updates accordingly:

  • First panel's UI model is composed on the server-side; its client-side replica is bound to the component displaying the panel
  • And the second panel uses an UI model composed completely on the client by combining server-side replicas of all the values used there.
  • The surprising part: two above files are almost identical!

The sample supports both (!) Server-Side Blazor and Blazor WebAssembly modes – you can switch the mode on its "Home" page.

Moreover, it also exposes a regular RESTful API – try invoking any of endpoints there right from embedded Swagger console.

4. Caching Sample

It's a console app running the benchmark (Client) + ASP.NET Core API Server. Its output on Ryzen Threadripper 3960X:

Local services:
Fusion's Compute Service [-> EF Core -> SQL Server]:
  Reads         : 27.55M operations/s
Regular Service [-> EF Core -> SQL Server]:
  Reads         : 25.05K operations/s

Remote services:
Fusion's Replica Client [-> HTTP+WebSocket -> ASP.NET Core -> Compute Service -> EF Core -> SQL Server]:
  Reads         : 20.29M operations/s
RestEase Client [-> HTTP -> ASP.NET Core -> Compute Service -> EF Core -> SQL Server]:
  Reads         : 127.96K operations/s
RestEase Client [-> HTTP -> ASP.NET Core -> Regular Service -> EF Core -> SQL Server]:
  Reads         : 20.46K operations/s

What's interesting in this output?

  • Fusion-backed API endpoint serving relatively small amount of cacheable data scales to ~ 130,000 RPS while running the test on the same machine (that's a disadvantage).
  • Identical EF Core-based API endpoint scales to just 20K RPS.

So there is a ~ 6.5x difference for an extremely simple EF Core service hitting a tiny DB running in simple recovery mode. In other words, use of Fusion on server-side only brings ~ an order of magnitude performance boost even when there is almost nothing to speed up!

Besides that, the test shows Replica Services scale ~ almost as local Compute Services, i.e. to ~ 20 million "RPS". These aren't true RPS, of course - Replica Service simply kills any RPC for cached values that are known to be consistent. But nevertheless, it's still a pretty unique feature Fusion brings to the table – and that's exactly what allows it Blazor samples to share the same code for both WASM and SSB modes. So even though Replica Service is just a client for remote Compute Service, its performance is very similar!

5. Tutorial

It's interactive – you can simply browse it, but to modify and run the C# code presented there, you need Try .NET or Docker.

Running Samples

Build & run locally with .NET 5.0 SDK:

# Run this command first
dotnet build
Sample Command
HelloCart dotnet run -p src/HelloCart/HelloCart.csproj
HelloWorld dotnet run -p src/HelloWorld/HelloWorld.csproj
HelloBlazorServer dotnet run --project src/HelloBlazorServer/HelloBlazorServer.csproj + open http://localhost:5000/
Blazor Samples dotnet run --project src/Blazor/Server/Server.csproj + open http://localhost:5005/
Caching Run-Sample-Caching.cmd. See Run-Sample-Caching.cmd to run this sample on Unix.
Tutorial Install Try .NET + dotnet try --port 50005 docs/tutorial

Build & run with Docker + Docker Compose:

# Run this command first
docker-compose build
Sample Command
HelloCart docker-compose run sample_hello_cart dotnet Samples.HelloCart.dll
HelloWorld docker-compose run sample_hello_world dotnet Samples.HelloWorld.dll
HelloBlazorServer docker-compose run --service-ports sample_hello_blazor_server + open http://localhost:5000/
Blazor Samples docker-compose run --service-ports sample_blazor + open http://localhost:5005/
Caching docker-compose run sample_caching_client dotnet Samples.Caching.Client.dll
Tutorial docker-compose run --service-ports tutorial + open https://localhost:50005/README.md

Useful Links

P.S. If you've already spent some time learning about Fusion, please help us to make it better by completing Fusion Feedback Form (1…3 min).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].