📜 ⬆️ ⬇️

KodiCMS - CMS on the Kohana framework

Hello everyone, on Habré already for 6 years and only now decided to write my first post, although I am still not sure that this is a good idea.

Foreword


For more than 6 years I have been developing web applications, starting with layout , javascript , php , python , etc., in general, for all the time I went through all the stages of creating a website from design in photoshop and ending with creating a full-fledged website.


')

Decision on your bike


In 2012, I was tired of using third-party CMS, some had a poor API, others had problems with the flexibility of templates, in general, each system took a lot of time to develop modules and I had the idea to create my own bike, although it is even more hemorrhoids, but in it I I can do everything as I like, programmer.

It was decided not to write from scratch, but to take as a basis the example of the implementation of modules from different CMS, which, it seemed to me, effectively cope with their task, as well as popular ready-made libraries, well, here is a list of what was included in the system:
  1. WolfCMS (Modules: pages, templates, snippets, settings, plugins, users)
  2. FlexoCMS (javascript, loading pages)
  3. OpenConstructor (Datasource module, Hybrid data (analog information blocks in Bitrix), organization of templates, widgets)
  4. Kohana framework as core
  5. Twitter Bootstrap as UI
  6. FontAwesome
  7. Ace as a code editor
  8. elFinder as a file manager
  9. Select2 for drop-down lists
  10. Fancybox for popup windows
  11. jQuery UI
  12. Dropzone
  13. jQuery Nestable to sort the page tree
  14. Backbone (Used in the list of plugins and for parts of pages)
  15. RedactorJS (free version) as a text editor


Well, a small list of difficulties that had to face for 2 years of developing the system alone:


About the system


And now I want to introduce my OpenSource system to you - KodiCMS , which turned 2 years old on August 15, during this time 2175 commits were made, 250 issue was closed, although many were created by me, work on the system continues today.



Key features:



Unfortunately, the bottleneck of the system is documentation, it is there, but it is very small (https://github.com/butschster/kodicms/wiki) and the creation of this laborious process, which I don’t have to pull, and the system’s capabilities know a lot. :(

System structure


Developing a CMS, I tried to change the code of the kohana core as little as possible, or rather not even the system folder is not touched completely, some classes were expanded through modules and refined, but in fact it is Kohana version 3.3.2.
The system is divided into modules and plug-ins, the original idea was to realize the connection of the modules to each other through Observer's, in practice 70% of the modules and plug-ins work through them, which allows you to safely disconnect part of the modules, I myself have not tried to do it, but I hope that it is.

API


The system has a full-fledged API that supports GET, POST, PUT, DELET requests via ajax and directly, has its own URl structure, access to it is allowed through the backend, or through the frontend with a unique key. The API is also implemented through controllers and actions. A little about him can be found here .

Frontend works through the route, which is called the most recent, at the time of its call to the database, the pages are searched by url and the current page is output, all requests are cached by key and by tag.

Caching


CMS uses the kohana module - Cache for data caching. All cache types support caching tags. The system caches most requests:


Plugins


The system is expanded with plugins, but the plug-in for the system is the same module, only it is located in the plugins folder and is connected only after activation via the admin panel, but this is a full-featured kohana module, except that it has, in addition to the init.php file frontend.php and backend.php, in which you can include additional code that must be executed in a particular environment.



In general, this is only the beginning, there are also Mail templates and events, task execution through the kohana module - Minion, but settings via the admin panel, hybrid data, dashboard, configs, user meta data, etc. And I really want to tell everyone about it and show how it all works.

For familiarization with the system there is a demo site: demo.kodicms.ru , please do not break the site, because others will not be able to see it.
Youtube channel
Project repository: github.com/butschster/kodicms , the latest updates in the dev branch, there is also a unittest branch in which the first tests appear, but again not enough for all the time. Join the development;)

In general, test, use, send your ideas for development and improvement in any form, issue, pull-request, PM, skype, forum , comment

Thanks for attention.

Upd. Thanks to Habrahabr for the company blog.

Source: https://habr.com/ru/post/240665/


All Articles