Giter Club home page Giter Club logo

piranhacms / piranha.core Goto Github PK

View Code? Open in Web Editor NEW
1.9K 90.0 542.0 34.78 MB

Piranha CMS is the friendly editor-focused CMS for .NET that can be used both as an integrated CMS or as a headless API.

Home Page: http://piranhacms.org

License: MIT License

C# 63.91% JavaScript 24.68% Shell 0.08% HTML 6.50% Vue 2.90% SCSS 1.94%
dotnet-core cms cms-framework entityframeworkcore piranha asp-net-core asp-net-core-mvc asp-net-core-razor-pages dotnet6

piranha.core's Introduction

Welcome to Piranha.Core

Codacy Badge CodeFactor Sponsors Backers Gitter chat

Build server Platform Build status
GitHub Actions Windows .NET Win
GitHub Actions Linux .NET
CoverAlls Coverage Status
NuGet NuGet
Crowdin (Localization) Crowdin

About

Piranha CMS is a decoupled, cross-platform CMS built for .NET8 and Entity Framework Core. It has a modular and extensible architecture and supports a multitude of hosting and deployment scenarios.

Getting started

Prerequisites

Create a new project from our templates

To use our project templates you first need to download and install them from NuGet. This can be done with:

dotnet new -i Piranha.Templates

When creating a new project with dotnet new you should first create a new empty folder. The default behaviour is that the new project is named after its containing folder.

Please note that naming your project Piranha (even if it is a test project) will result in a circular reference error when you try to restore the packages. This is due to a limitation in dotnet restore.

After this is done you can create a new web project for razor pages with:

dotnet new piranha.razor

To read more about of our available project templates, please read more on https://piranhacms.org/docs/basics/project-templates

Get the latest source code and get going

> git clone https://github.com/PiranhaCMS/piranha.core.git
> cd piranha.core
> dotnet restore
> dotnet build
> cd examples/MvcWeb
> dotnet run

Log into the Manager

The manager interface can be found at the URL ~/manager with the default credentials:

admin / password

For production scenarios we advise you to remove this user, or change the password and update the password strength policy. More information on this can be found in the official documentation here.

Build and update javascript/css assets

> cd piranha.core/core/Piranha.Manager
> npm install
> gulp min:js
> gulp min:css

Backers

Support Piranha CMS with a monthly donation and help us focus on giving you even more features and better support. Piranha CMS @ Open Collective

Sponsors

These are our financial sponsors! You can also become a sponsor either through GitHub or Open Collective.

Arcady

Peak Crypto

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

piranha.core's People

Contributors

121gwjolt avatar 5w33n avatar aatmmr avatar alirizaadiyahsi avatar axunonb avatar azurerok avatar dependabot[bot] avatar filipmatsman avatar gyfke avatar gyretech avatar henriknergaard-ins avatar i-love-code avatar j2ba avatar jensbrak avatar lucgosso avatar martijntakken avatar mikaellindemann avatar mikebairdrocks avatar nhawdge avatar sayganov avatar sit-harry avatar stefanolsen avatar successgo avatar talagozis avatar tedvanderveen avatar tidyui avatar urreman avatar vjacquet avatar willwolfram18 avatar zacpwhite 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  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

piranha.core's Issues

Media storage on local disc

Implement media storage for local smaller installations not hosted in Azure. This requires the interfaces specified in #23 to be finalized.

AutoMapper dependency.....

Hi,

I want to pull in the entity models into a DBContext and although the docs say it is built on AutoMapper 5.1.1 the constraint is for AutoMapper (>= 3.3.1 && < 3.4.0)' when I pull in PiranhaCMS.Core.2.2.5.

Before I go and duplicate code here is there any chance of an updated NuGet package?

Create page in hierarchical position

Add contextual buttons in the manager site map to add pages directly to a hierarchical position. This should also calculate the correct hierarchical slug for the page.

Permission matrix

A good way to implement permissions in the manager interface would be to have some kind of permissions matrix where you can assign different actions on different datatypes to different roles. For example:

  • Pages
    • Create page
    • Publish/unpublish page
    • Delete page
    • Move page

This could then be changed per installation by adding groups & setting these for certain actions.

MarkdownField editor template

Add editor template in the manager for the MarkdownField. The user should edit the content in plain text but there should be a preview mode which renders the entered markdown as HTML for the user. The rendered HTML should not be editable.

Unit Tests

Unit tests for all core functions as well as for the data services.

500 error after update to Core 2.2.7.2

If have update the NuGet Packackes tot 2.2.7.2. All my packages are up-to-date, but my project is not working anymore.

I receive a 500 Error:

__DynamicModule_Piranha.Web.ApplicationModule, Piranha, Version=2.2.6243.15973, Culture=neutral, PublicKeyToken=null_4c0a1dc4-8c7c-4864-9797-b0b2f34f30f9

Does anyone know what is going wrong here?

I have following packages installed
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Antlr" version="3.5.0.2" targetFramework="net452" /> <package id="AutoMapper" version="5.2.0" targetFramework="net452" /> <package id="bootstrap.less" version="3.3.7" targetFramework="net452" /> <package id="EntityFramework" version="6.1.3" targetFramework="net451" /> <package id="FontAwesome" version="4.7.0" targetFramework="net452" /> <package id="jQuery" version="3.1.1" targetFramework="net452" /> <package id="jQuery.Validation" version="1.16.0" targetFramework="net452" /> <package id="MarkdownSharp" version="1.13.0.0" targetFramework="net451" /> <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.7" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.JavaScript" version="0.15.0-build58334" targetFramework="net451" /> <package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.Web" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.WindowsServer" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" /> <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" /> <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451" /> <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net451" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" /> <package id="Modernizr" version="2.8.3" targetFramework="net452" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="PagedList" version="1.17.0.0" targetFramework="net452" /> <package id="PagedList.Mvc" version="4.5.0.0" targetFramework="net452" /> <package id="PiranhaCMS.Core" version="2.2.7.2" targetFramework="net452" /> <package id="PiranhaCMS.Mvc" version="2.2.6" targetFramework="net452" /> <package id="Respond" version="1.4.2" targetFramework="net452" /> <package id="Twitter.Bootstrap.Less" version="3.3.6" targetFramework="net452" /> <package id="WebActivatorEx" version="2.2.0" targetFramework="net452" /> <package id="WebGrease" version="1.6.0" targetFramework="net452" /> </packages>

Management API

A separate API for data management should be created in it's own project. This API will be used by Web manager interface, but can also be used for seeding data, import programs or other services that wants to interact with the database.

Category management

Add support for working with categories in the manager interface & setting all information regarding archive setup for the category.

Media management

Add views for working with, and referencing media in the manager interface.

Management UI

Create Web manager interface for creating and maintaining the CMS data. This MVC application should be put in its own project and the interface should be based on the common standards of bootstrap & jQuery

Setup AppVeyor CI

Setup AppVeyor (or another available build service) for automatically building & running tests. At the moment AppVeyor seems to have problems with building netcore 1.1 libraries/applications but it might be possible to set it up with custom config.

Media card view in the manager

The media library now shows folders and uploaded assets in a folder-like manner, much like the file explorer. It would however be nice to have the option to view the media library in a more card based view with large thumbnails for all of the uploaded assets.

First level caching

Add mechanism for caching fully transformed models in an efficient way. This is to minimize load on the database and prevent mapping the same models over and over again. The solution needs to be memory efficient & handle clearing models after they have been updated through the API.

Add MediaType

Add Type field to the Media data model so that media can easily be filtered on if it's and image, document or a video.

Authentication Interface

Authentication should be replacable. Create interface to enable to create different authentication methods.

Attribute based type builder.

Add a new project for building types from models classes with attributes instead of JSON. Using the JSON files is redundant if you're using strongly typed models. This could for example look like this:

// Both Id and Title should be required
[PageType(Id = "Start", Title = "Start page")]
public class StartPageModel : PageModel<StartPageModel>
{
    // Id should always be set to property name.
    // Title is optional and will default to property name.
    [Region]
    public ComplexRegion Ingress { get; set; }

    [Region(Title = "Main content")]
    public HtmlField Content { get; set; }
}

public class ComplexRegion
{
    // Id should always be set to property name.
    // Title is optional and will default to property name.
    [Field]
    public StringField Title { get; set; }
    [Field(Title = "Ingress body")]
    public TextField Body { get; set; }
}

Types can either be added automatically by reflection or be added manually when adding the builder in Configure(). An example how the builder could look with manually added types.

var pageTypeBuilder = new Piranha.Builder.Attributes.PageTypeBuilder(api)
    .AddType(typeof(AboutPage))
    .AddType(typeof(StartPageModel))
    .AddType(typeof(StandardPage));
pageTypeBuilder.Build();

UseSqlServer error on OS X

Piranha.Manager's StartUp.cs uses options.UseSqlServer() which causes an error on OS X environments.

Not sure what the best solution for this is. Perhaps provide an override method or setup separate extension methods for UseSqlServer and UseSqlite

Support for SelectField

It would be nice to have a SelectField that would map to an enum which would be rendered as a drop down list in the manager interface.

Config for supported file extensions

Add configuration for the supported file extensions divided by media type. for example:

"Piranha": {
  "MediaExtensions": {
    "Images": ".png,.jpg",
    "Documents": ".pdf",
    "Videos": ".mp4"
  }
}

This config will then also be used for mapping the incoming file to a MediaType.

Page edit race condition

What is the mechanism for handling race conditions on editing entities within the manager interface? Is there a plan to include a TimestampAttribute on a Version property on any of the tables to implement optimistic concurrency?

NullPointerException when starting the example for the first time

When starting the example blog for the first time the Seed method crashes. This could be because either the Api or the DbContext has not been created yet.

Restarting the application with dotnet run resolves the issue and the example creates it's data in the database.

Customizable meta-fields?

The current verison of Piranha CMS (2.x) has fields for the meta tags keywords & description. Maybe it would be nice to be able to configurate the meta fields that should be available and have them as a dynamic collection. This could for example configurated like this:

"SEO" : [
  {
    "Id" : "keywords",
    "Title": "Keywords",
    "Mandatory": false,
    "Max": 128
  },
  {
    "Id": "description",
    "Title": "Description",
    "Mandatory": false,
    "Max": 255
  }
]

These fields should also be available when manipulating the model from code, for example:

var post = api.Posts.GetById(...);

post.SEO["keywords"] = "Piranha,CMS,Blog,.NET,DotNetCore,MVC";
post.SEO["description"] = "This is the description for the post";

IoC Container Interface

This way ASP.NET applications can use the built in support (or whichever is used) and other applications can use whatever container they like. This also simplifies app composition.

Future Enchancement: More request handler hooks

First, I fully acknowledge this is a rather niche use-case so if this feature were to be skipped I completely understand.

I am currently working on a project at work which we are planning to integrate PiranhaCMS 2.2.5 into. One of the features we are working on is restricting documents and media based on a user's group/permissions so that only certain documents can reach certain users. We plan to accomplish this with document categories that map to access permissions since media files don't support having permissions directly on them.

In the process of writing a custom IRequestHandler implementation, I found that in order to check a user's permissions the request needs to have passed the HttpApplication.AcquireRequestState event since user profile information is stored in the current session. It may be a nice addition to update the IRequestHandler to include more events similar to what the HttpApplication event sequence is.

Since it seems most of the 2.2.x handlers only need the BeginRequest method, the standard handlers could all derive from a base RequestHandlerBase class which implements all the IRequestHandler methods as virtual members so that all the methods are present in the actual handler but they can still be overridden if necessary. And this would also allow for easier coding of those handlers if this feature were to be implemented

Implement logging

Add logging throughout all of the core components. This should be done with the standard ILoggerFactory

UI components

Create UI components for:

  • Menu generation
  • Breadcrumb generation
  • Link generation
  • Meda generation
  • Meta data generation

For reference, check the existing UI helper in the PiranhaCMS repo.

Make AppVeyor run unit tests

AppVeyor seemed to fail running the unit tests with the following message:

Discovering tests...OK
%xunit20%\xunit.console.x86 "C:\projects\piranha-core\test\core\Piranha.AspNet.Tests\bin\Debug\netcoreapp1.1\Piranha.AspNet.Tests.dll" -appveyor
xUnit.net Console Runner (32-bit .NET 4.0.30319.42000)
System.InvalidOperationException: Unknown test framework: could not find xunit.dll (v1) or xunit.execution.*.dll (v2) in C:\projects\piranha-core\test\core\Piranha.AspNet.Tests\bin\Debug\netcoreapp1.1

I'm not sure why this is happening, have you tried running xunit tests within AppVeyor @TheWolfA2

Hierarchical slugs

Like in the 2.x version of Piranha CMS slugs should be able to be generated hierarchical, i.e include the parent slug as a prefix, giving pages the following URL syntax:

mysite.com/docs
mysite.com/docs/getting-started
mysite.com/docs/getting-started/installing-from-nuget

Drag & drop support for moving pages

Add support for moving pages and subtrees of pages in the manager interface with drag & drop. When the page is released the structure should be saved & reloaded with ajax.

Move all texts in Piranha.Manager to resources/json

To support localization of the manager interface, move all texts & labels into either resources or JSON-files depending on what solutions is prefered. While native support for resource files is good, plain text JSON files are still easier to edit & can be deployed without having to recompile or update the packages.

Page redirects

Add support for setting up a page as a redirect. It would also be good to be able to specify the type of redirect (temporary, permanent).

Add view to PageType & Page

Add the view field to both PageTypes & Pages. This means pages can use the same controller logic but be marked to be rendered by different views.

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.