Giter Club home page Giter Club logo

cloudy.net's Introduction

Cloudy creates a backoffice out of your EF Core context.

Just create your DbContext, Models, and hook up Cloudy. Configure behavior with UI hints.

[Display(Description = "This is a sample class to show off most bells and whistles of the toolkit.")]
public class Page : INameable, IRoutable
{
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public Guid Id { get; set; }
    public string Name { get; set; }
    public string UrlSegment { get; set; }
    [UIHint("textarea")]
    public string Description { get; set; }
    [Select(typeof(Page))]
    public string RelatedPageId { get; set; }
}

Screenshot of how Cloudy scaffolds previously mentioned model, showing URL segment that will be used for routing

endpoints.MapGet("/pages/{route:contentroute}", async c => 
    await c.Response.WriteAsync($"Hello {c.GetContentFromContentRoute<Page>().Name}")
);

Screenshot of a browser routing a request to previously mentioned route

Installation

Create a new, empty ASP.NET Core web application.

Install Cloudy.NET and Cloudy.NET.UI from NuGet.

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddCloudy(cloudy => cloudy
    .AddAdmin(admin => admin.Unprotect())   // NOTE: Admin UI will be publicly available!
    .AddContext<MyContext>()                // Adds EF Core context with your content types
);

services.AddDbContext<MyContext>(options => options
    .UseInMemoryDatabase("cloudytest")      // Adjust according to your needs.
);

var app = builder.Build();

app.UseStaticFiles(new StaticFileOptions().MustValidate()); // This removes the need for manually clearing browser cache when updating frontend assets

app.UseAuthentication();
app.UseAuthorization();

app.MapRazorPages();
app.MapControllers();
app.MapGet("/", async c => c.Response.Redirect("/Admin"));

app.Run();

Authentication

The UI works well with external login providers and ASP.NET Identity. Remove Unprotect() in UseCloudyAdmin, and define the adminarea authorization policy to something appropriate.

The following example allows anyone having logged in access to the admin area:

configurator.Services.Configure<AuthorizationOptions>(o => o.AddPolicy("adminarea", builder => builder.RequireAuthenticatedUser()));

Database

Cloudy.NET supports any database supported by EF Core: Inmemory, SQLite, SQL Server, CosmosDB ...

Building the repository

Clone the repo and run. To get the frontend code of the Admin section running, run npm ci and npm run build from the wwwroot-src/ folder. Alternatively, you can run npm ci and then npm run dev and set the Configuration value (right click the sample project in Visual Studio and choose "Edit user secrets") ViteBaseUri to the running Vite URL, something like http://localhost:5173/.

Licensing

Free for non-commercial projects and 25 USD per month ex VAT for a Beta license

Check out https://www.cloudy.net/product/pricing

Usage for large corporations

Cloudy.NET is in Beta and is not guaranteed to keep API compatibility between releases.

cloudy.net's People

Contributors

bassieee avatar bjorn-ali-goransson avatar dependabot[bot] avatar jim-cloudy avatar tai-nguyen-niteco avatar taiducnguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cloudy.net's Issues

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.