Architecture

Fanray is built with common architectural patterns, it’s designed to extensible, maintainable and testable so that others could easily get on, expand and create their own applications.

Extensibility

Extensible design in software engineering is to accept that not everything can be designed in advance. A light software framework which allows for changes is provided instead. - Wikipedia

The extensible design allows you to create plugins, themes and widgets, it also provides the basic infrastructure for building your own applications.

Extensible Architecture

  • Widgets: A widget is a piece of UI that displays inside widget areas. Develop a widget when you want to show a visual element that user can drag and drop between widget areas. Widget areas are either system defined or custom defined by theme designers.

  • Plugins: A plugin adds a feature that can be turned on or off by activating or deactivating the plugin, it may or may not have any UI element. Develop a plugin when the feature is optional to the core app. Plugins help the core stay focused on essential functionality and not to become bloated.

  • Themes: A theme is the website visitors see, it has a set of pages deisngers have full control over. It may contain 0 or more widget areas to display widgets, and plugin areas for injecting plugin UI elements.

  • Applications: An application is a major functionality people can use, like a blog, forum or ecomerce etc.

Tiers and Concerns

Fanray uses a common Multitier architecture, below is the basic flow of its tiers (a.k.a. layers) and their repsonsibilities.

Multitier Architecture

  • Client: You can interact with Fanray using either a browser or desktop clients that supports MetaWeblog API, such as Open Live Writer.

  • Web: The Public Site is a themed ASP.NET Core MVC app. It utilizes the Skinny Controllers, Fact Models and Dumb Views principle to make the controllers very light on logic, the views focused mainly on presenting data, and the services centralized with business rules. The Admin Panel leverages on ASP.NET Core Razor Pages, Vue.js and Vuetify.js to provide a mini-SPAs application that is easily extensible to support extension setting pages.

  • Domain: It contains a set of services and models. This tier does the heavy lifting by handling the business rules, validation, caching, calling repositories for data etc.

  • Data: It uses EF Core and SQL Server as its default ORM and database. The data tier is built with Repository Pattern, thus you can swap in your own ORM and database of choice.

  • Storage: Fanray stores relational data and JSON data using a relational database. It stores image files using either file system or Azure Blob Storage based on configuration.

Solution Structue

Solution Structure

The folder sturcture is self-explanatory, the Core folder contains the key libraries

Core Folder Description
Fan Core app that provides common services
Fan.Blog The blog app
Fan.Web Web infrastructure
Fan.WebApp Web application that hosts everything

Theme