Backend
An overview of the Backend, the functions it offers, what it's different parts are, etc.
Features
Backend like any other Laravel based application is made of different parts. Backend serves these functions:
- Manages database.
- An API for Admin Panel.
- An API for frontend for things like user comments.
- Rendering engine for components.
- Managment of themes for the frontend.
- Managment of Users, Roles and Permissions, who has access to what.
- Authentication managment, protecting routes and endpoints.
- Security, stuff like input sanitization, throttling of routes, etc.
- Downloading themes for installation and updates.
- Services for Global Settings
Routes
Routes are separated by their functionality into different files for easier overview and managment.
- spa.php - Routes consumed by the Admin Panel
- web.php - Routes used by public facing frontend
- installer.php - Routes used by CMS install wizard
- auth.php - Authentication routes for login, registration, etc
All routes can be found under same routes folder.
Controllers
Controllers in LaraOne are either Frontend or Backend Controllers. They can be found under app\Http\Controllers\ in one of these two folders:
- Backend - used by Admin Panel and Authentication routes
- Frontend - used for content rendering and public comments
The only exception is InstallerController which is found directly under app\Http\Controllers folder. This controller is used by CMS Install Wizard.
Models
Auth & Permission models can be found directly under app\Models
- User - Keeps track of all the users.
- Role - Single user can have one or multiple roles attached to him.
- Permission - Permissions are attached to roles or users directly.
Under app\Models\Core you will find the rest of models for the CMS are stored. Some of the models found there are:
- ContentType - Define different content types, Pages & Posts, etc.
- Content - Keeps tracks of Posts, Pages or any other content type.
- Block - These are blocks that save Component data, Blocks are polymorphic and can be attached to Content, Widgets, etc.
- Comment - Comments left on the frontend by site visitors.
- Menu - Keeps tracks of different menues website has.
- MenuItem - Menu Items are attached to only one menu.
- Theme - Keeps tracks of installed themes.
- ThemeSetting - Keeps tracks of themes settings.
- WidgetGroup - Widgets groups can hold any amount of content blocks that serve as widgets.
Services
LaraOne provides following service classes for use:
- RenderContentService - Service that renders index page and single page content stored in database.
- LaraOneService - Used to install & update CMS, download updates for themes, etc.
- SettingsService - Settings managment for saving and updating setting.
- GlobalSettingsService - Singelton service that loads settings only once at boot.
- ThemeService - Used to install & update themes downloaded by LaraOneService.
- WidgetService - Used to create & update Widgets.
- ZipArchiveService - Extends php's ZipArchive to add extractSubdirTo method.
Helpers
Helpers that come with LaraOne can be found under app\Helpers folder. Two helper files can be found under that folder
- helpers.php - basic general helpers
- theme_helpers.php - helpers mostly used by themes
Components
Laraone comes with a set of both layout and content components that allow for crafting of advanced and beautiful websites in no time.
Layout components that ship with LaraOne are:
- Container - Used to build advanced layouts
- Section - Simmilar to Container, used for advanced layouts
- Columns - Used to create columns quickly
- Tabs - Used to create tabs, each tab can hold any number of content components
- Slider - Used to create slides, each slide can hold many content components
Content components that currently ship with LaraOne are:
- Headline - Adds a headline
- Text - Text you can edit and style
- Image - Adds just one image
- Images - Adds any number of images
- Youtube - Add Youtube video
- Button - Inserts a button
Backend serves as rendering engine for all of the components. Components are rendered by laravel blade views and are embedded in themes at the runtime. Via Laravel blade files all html & responsive css needed for components to render correctly on the frontend is provided.