Skip to content

Latest commit

 

History

History
107 lines (79 loc) · 6.8 KB

README.md

File metadata and controls

107 lines (79 loc) · 6.8 KB

RealWorld Example App

Microsoft Orleans codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

What is RealWorld

Realworld is a simple content management system similar to Medium.com or Wordpress but is much simpler. For live demo, please visit: https://demo.realworld.io/. Its basic features are:

  1. signup & sigin users
  2. CRUD articles
  3. articles tags, favorite, comments

Realworld is built using SPA, having Frontend Web app and Backend Web API. For further information, please visit RealWorld Github.

Screenshots

Home page Home

Article Page Article

This Work-In-Progress codebase was created to demonstrate a fully fledged fullstack application built with Microsoft Orleans including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Microsoft Orleans community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

This Web app is combining ASP.NET Core Web API and Microsoft Orleans. ASP.NET Core is used as the Orleans Clients, so we need an Orleans Server and that is what /src/SiloHost is for.

For the ASP.NET Core Web API, some notable packages used (beside Orleans):

  1. Fluent validation
  2. Microsoft JWT Bearer
  3. Swashbuckle for ASP.NET Core
  4. Feature folder
  5. Npgsql for cluster client accessing cluster management table
  6. MediaTR for thin controllers

note that ASP.NET Core Web API don't use ngpsql to access database directly in the logic, its only used for accessing cluster management table.

For The Orleans implementation, some notes:

  1. Postgresql is used for both AdoNet clustering and grains persistent provider
  2. Related to grains persistent provider, the payloadjson column of orleansstorage table is changed from default TEXT to JSONB
  3. Npgsql for direct query to database

Picture below ilustrate the relations of ASP.NET Core Web API, represented by Conduit and Orleans implementation, represented by SiloHost :

High-level architecture

In the code base, we also try to adopt practice from Golang language regarding method return value being Error is one of it. See https://golang.org/doc/tutorial/handle-errors. In C#, tuple is used to replicate similar practice. This might be changed in the future, like removed altogether, but currently we are still unsure to continue or stop. Leave it like this for the time being.

For more in-depth and complete example of Orleans sample, please look at OneBoxDeployment or road-to-orleans.

Getting Started

to have this up and running, steps are as follow:

  1. clone this repository
  2. prepare the database, as instructed in /scripts/README.md
  3. build the solution
  4. start the /src/Conduit

Work Progress Status

All works is done:

Footnote

Copy many codes from an awesome conduit implementation using ASP.NET Core. Please check that repository, many things done right and much to learn from it.