FluentCMS 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluentCMS --version 0.1.1                
NuGet\Install-Package FluentCMS -Version 0.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluentCMS" Version="0.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentCMS --version 0.1.1                
#r "nuget: FluentCMS, 0.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FluentCMS as a Cake Addin
#addin nuget:?package=FluentCMS&version=0.1.1

// Install FluentCMS as a Cake Tool
#tool nuget:?package=FluentCMS&version=0.1.1                

Fluent CMS - CRUD (Create, Read, Update, Delete) for any entities

GitHub stars Welcome to Fluent CMS If you find it useful, please give it a star ⭐

What is it

Fluent CMS is an open-source content management system designed to streamline web development workflows. It proves valuable even for non-CMS projects by eliminating the need for tedious CRUD API and page development.

  • CRUD APIs: It offers a set of RESTful CRUD (Create, Read, Update, Delete) APIs for any entities based on your configuration, easily set up using the Schema Builder.
  • Admin Panel UI: The system includes an Admin Panel UI for data management, featuring a rich set of input types such as datetime, dropdown, image, rich text, and a flexible query builder for data searching.
  • Easy Integration: The Systems can be seamlessly integrated into your ASP.NET Core project via a NuGet package. You can extend your business logic by registering hook functions that execute before or after database access.
  • Performance: The system is designed with performance in mind, boasting speeds 100 times faster than Strapi (details in the performance vs Strapi test). It is also as faster than manually written APIs using Entity Framework (details in the performance vs EF test).
  • Easily Extensible The system can automatically generate EntityCreated, EntityUpdated, and EntityDeleted events and publish them to an event broker (such as Kafka). This makes it simple to extend functionality, such as adding consumers for OpenSearch, Elasticsearch, or document databases.

Live Demo - A blog website based on Fluent CMS

source code FluentCMS.Blog

Add Fluent CMS to your own project

  1. Create your own WebApplication.

  2. Add FluentCMS package
    The next command copies the compiled Admin Panel code to your wwwroot directory. The frontend code, written in React and jQuery, is available in the admin-ui folder within this repository.
    For Mac, use the following command. For Windows, the directory should be located at $(NuGetPackageRoot)fluentcms<Version>\staticwebassets. Please replace <Version> with the correct version number.

    dotnet add package FluentCMS
    cp -a ~/.nuget/packages/fluentcms/<Version>/staticwebassets wwwroot 
    
  3. Modify Program.cs, add the following line before builder.Build(), the input parameter is the connection string of database.

    builder.AddSqliteCms("Data Source=cms.db").PrintVersion();
    var app = builder.Build();
    

    Currently FluentCMS support AddSqliteCms, AddSqlServerCms, AddPostgresCMS

  4. Add the following line After builder.Build()

    await app.UseCmsAsync(false);
    

    this function bootstrap router, initialize Fluent CMS schema table

  5. If everthing is good, when the app starts, when you go to the home page, you should see the empty Admin Panel Here is a quickstart on how to use the Admin Panel Quickstart.md

  6. If you want to have a look at how FluentCMS handles one to many, many-to-many relationships, just add the following code

    var schemaService = app.GetCmsSchemaService();
    await schemaService.AddOrSaveSimpleEntity("student", "Name", null, null);
    await schemaService.AddOrSaveSimpleEntity("teacher", "Name", null, null);
    await schemaService.AddOrSaveSimpleEntity("class", "Name", "teacher", "student");   
    

    These code created 3 entity, class and teacher has many-to-one relationship. class and student has many-to-many relationship

  7. To Add you own business logic, you can add hook, before or after CRUD. For more hook example, have a look at Program.cs

    var hooks = app.GetCmsHookFactory();
    hooks.AddHook("teacher", Occasion.BeforeInsert, (IDictionary<string,object> payload) =>
    {
      payload["Name"] = "Teacher " + payload["Name"];
    });
    
  8. Source code of this example can be found at WebApiExamples

Produce Events to Kafka

The producing event functionality is implemented by adding hook functions behind the scene, to enable this functionality, you need add two line of code, builder.AddKafkaMessageProducer("localhost:9092"); and app.RegisterMessageProducerHook().

builder.AddSqliteCms("Data Source=cmsapp.db").PrintVersion();
builder.AddKafkaMessageProducer("localhost:9092");
var app = builder.Build();
await app.UseCmsAsync(false);
app.RegisterMessageProducerHook();

We welcome contributions!

If you're interested in improving FluentCMS, please read our CONTRIBUTING.md guide.

Development

overview.png

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on FluentCMS:

Repository Stars
fluent-cms/fluent-cms
CRUD (Create, Read, Update, Delete) for any entities
Version Downloads Last updated
0.2.6 69 11/11/2024
0.2.5 78 10/30/2024
0.2.4 87 10/23/2024
0.2.3 98 10/2/2024
0.2.2 91 10/2/2024
0.2.1 98 9/26/2024
0.2.0 96 9/8/2024
0.1.8 95 9/8/2024
0.1.7 85 9/8/2024
0.1.6 102 9/8/2024
0.1.5 97 9/8/2024
0.1.4 110 8/30/2024
0.1.3 124 8/23/2024
0.1.2 114 8/23/2024
0.1.1 122 8/22/2024
0.1.0 125 8/22/2024
0.0.6 130 8/15/2024
0.0.5 116 8/15/2024
0.0.4 80 8/5/2024
0.0.3 130 7/31/2024