-
Notifications
You must be signed in to change notification settings - Fork 10
Home
code matters edited this page Aug 12, 2024
·
9 revisions
Welcome to Fluent CMS If you find it useful, please give it a star ⭐
Fluent CMS is an open-source content management system designed to simplify the workflow for web development.
- It provides a set of CRUD(Create, Read, Update, Delete) Restful APIs for any entities based on your configuration.
- You can add your own logic by registering hook functions before or after access databases.
- It provides admin panel for you to manage data, the admin panel have a rich set of inputs, text, number, datetime, dropdown, image, image gallery, and rich text editor.
- It provides a schema builder for you to define entity and attributes.
- Admin Panel https://fluent-cms-admin.azurewebsites.net/
- Email:
[email protected]
- Password:
Admin1!
- Email:
- Public Site : https://fluent-cms-ui.azurewebsites.net/
- Create your own WebApplication.
- Add FluentCMS package
dotnet add package FluentCMS # the next command copy compiled Admin Panel code to your wwwroot, # The frontend code was write in React and Jquery, source code is admin-ui, also in this repo # The following command is for Mac, # for windows the directory should be at $(NuGetPackageRoot)fluentcms\1.0.0\staticwebassets # Please change 0.0.4 to the correct version number cp -a ~/.nuget/packages/fluentcms/0.0.4/staticwebassets wwwroot
- Modify Program.cs, add the following line before builder.Build(), the input parameter is the connection string of database.
//Currently FluentCMS support AddSqliteCms, AddSqlServerCms builder.AddSqliteCms("Data Source=cms.db").PrintVersion(); var app = builder.Build();
- Add the following line After builder.Build()
//this function bootstrap router, initialize Fluent CMS schema table await app.UseCmsAsync(false);
- 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
- If you want to have a look at how FluentCMS handles one to many, many-to-many relationships, just add the following code
These code created 3 entity, class and teacher has many-to-one relationship. class and student has many-to-many relationship
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");
- 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, Next.Continue, (IDictionary<string,object> payload) => { payload["Name"] = "Teacher " + payload["Name"]; });