FluentCMS 0.1.3
See the version list below for details.
dotnet add package FluentCMS --version 0.1.3
NuGet\Install-Package FluentCMS -Version 0.1.3
<PackageReference Include="FluentCMS" Version="0.1.3" />
paket add FluentCMS --version 0.1.3
#r "nuget: FluentCMS, 0.1.3"
// Install FluentCMS as a Cake Addin #addin nuget:?package=FluentCMS&version=0.1.3 // Install FluentCMS as a Cake Tool #tool nuget:?package=FluentCMS&version=0.1.3
Fluent CMS - CRUD (Create, Read, Update, Delete) for any entities
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
, andEntityDeleted
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
- Admin Panel https://fluent-cms-admin.azurewebsites.net/
- Email:
admin@cms.com
- Password:
Admin1!
- Email:
- Public Site : https://fluent-cms-ui.azurewebsites.net/
Add Fluent CMS to your own project
The example project can be found at https://github.com/fluent-cms/fluent-cms/tree/main/examples/WebApiExamples
Create your own Asp.net Core WebApplication.
Add FluentCMS package
dotnet add package FluentCMS
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"); var app = builder.Build();
Currently FluentCMS support AddSqliteCms, AddSqlServerCms, AddPostgresCMS
Add the following line After builder.Build()
await app.UseCmsAsync();
this function bootstrap router, initialize Fluent CMS schema table
Now you can start web server, the following chapter explains how to build schema and manage data.
Develop a simple educational system use Fluent CMS
When designing a database schema for a simple educational system, you typically need to create tables for Teachers
, Courses
, and Students
. The relationships between these tables can vary depending on the specific requirements, but a common structure might include the following:
Database Schema
1. Teachers Table
This table stores information about the teachers.
Column Name | Data Type | Description |
---|---|---|
TeacherId |
INT |
Primary Key, unique ID for each teacher. |
FirstName |
VARCHAR |
Teacher's first name. |
LastName |
VARCHAR |
Teacher's last name. |
Email |
VARCHAR |
Teacher's email address. |
PhoneNumber |
VARCHAR |
Teacher's contact number. |
2. Courses Table
This table stores information about the courses.
Column Name | Data Type | Description |
---|---|---|
CourseId |
INT |
Primary Key, unique ID for each course. |
CourseName |
VARCHAR |
Name of the course. |
Description |
TEXT |
Brief description of the course. |
TeacherId |
INT |
Foreign Key, references TeacherId in the Teachers table. |
3. Students Table
This table stores information about the students.
Column Name | Data Type | Description |
---|---|---|
StudentId |
INT |
Primary Key, unique ID for each student. |
FirstName |
VARCHAR |
Student's first name. |
LastName |
VARCHAR |
Student's last name. |
Email |
VARCHAR |
Student's email address. |
EnrollmentDate |
DATE |
Date when the student enrolled. |
4. Enrollments Table (Junction Table)
This table manages the many-to-many relationship between Students
and Courses
, since a student can enroll in multiple courses, and a course can have multiple students.
Column Name | Data Type | Description |
---|---|---|
EnrollmentId |
INT |
Primary Key, unique ID for each enrollment. |
StudentId |
INT |
Foreign Key, references StudentId in the Students table. |
CourseId |
INT |
Foreign Key, references CourseId in the Courses table. |
Relationships:
- Teachers to Courses: One-to-Many (A teacher can teach multiple courses, but a course is taught by only one teacher).
- Students to Courses: Many-to-Many (A student can enroll in multiple courses, and each course can have multiple students).
Build Schema use Fluent CMS Schema builder
After start your asp.net core application, you can a menu item Schema Builder
in the application's home page.
You can add entity
teacher
,student
in schema builder UIWhen you add entity
course
, after add basic attributesname
anddescription
, you can add relationships- add attribute
teacher
, with the following settings
{ "DataType": "Int", "Field": "teacher", "Header": "Teacher", "InList": true, "InDetail": true, "IsDefault": false, "Type": "lookup", "Options": "teacher" }
- add attribute
students
, with the following settings
{ "DataType": "Na", "Field": "students", "Header": "Students", "InList": false, "InDetail": true, "IsDefault": false, "Type": "crosstable", "Options": "student" }
- add attribute
Now the minimal value product is ready to use.
Extent functionality by add Hook functions
You need to add your own Business logic, for examples, you want to verify if the email and phone number of entity teacher
is valid.
you can register a cook function before insert or update teacher
app.RegisterCmsHook("teacher", [Occasion.BeforeInsert, Occasion.BeforeUpdate],(IDictionary<string,object> teacher) =>
{
var (email, phoneNumber) = ((string)teacher["email"], (string)teacher["phone_number"]);
if (!IsValidEmail())
{
throw new InvalidParamException($"email `{email}` is invalid");
}
if (!IsValidPhoneNumber())
{
throw new InvalidParamException($"phone number `{phoneNumber}` is invalid");
}
}
Permissions
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
- Web Server:
- Admin Panel Client:
- Code admin-panel
- Doc Admin-Panel-UI
- Schema Builder:
- Code schema-ui
- Doc Schema-Builder-UI
Product | Versions 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. |
-
net8.0
- Confluent.Kafka (>= 2.5.2)
- FluentMigrator.Runner.Postgres (>= 5.2.0)
- FluentMigrator.Runner.Sqlite (>= 5.2.0)
- FluentResults (>= 3.16.0)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 8.0.8)
- Microsoft.AspNetCore.OpenApi (>= 8.0.6)
- Microsoft.AspNetCore.WebUtilities (>= 8.0.6)
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.6)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.7)
- MongoDB.Driver (>= 2.28.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.4)
- SqlKata (>= 2.4.0)
- SqlKata.Execution (>= 2.4.0)
- Swashbuckle.AspNetCore (>= 6.4.0)
- System.Data.SqlClient (>= 4.8.6)
- System.Runtime.Caching (>= 8.0.0)
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 | 60 | 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 |