Giter Club home page Giter Club logo

food-truck's Introduction

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 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: Fluent CMS 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: Fluent CMS is designed with performance in mind, boasting speeds 100 times faster than Strapi (details in the performance vs Strapi test). It is also 10% faster than manually written APIs using Entity Framework (details in the performance vs EF test).

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\1.0.0\staticwebassets. Please replace 0.0.4 with the correct version number.

    dotnet add package FluentCMS
    cp -a ~/.nuget/packages/fluentcms/0.0.3/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, Next.Continue, (IDictionary<string,object> payload) =>
    {
      payload["Name"] = "Teacher " + payload["Name"];
    });
    
  8. Source code of this example can be found at WebApiExamples

We welcome contributions!

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

Development

overview.png

food-truck's People

Contributors

fluent-cms avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.