SLAED CMS Architecture

SLAED CMS is built on a modular architecture with clear separation of responsibilities between components.

Architecture Overview

SLAED CMS is designed with performance, stability, and security in mind. The system follows a layered architecture approach:

┌─────────────────────────────────────────────────────────────┐
│                    SLAED CMS Architecture                   │
├─────────────────────────────────────────────────────────────┤
│  Frontend Layer                                             │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐          │
│  │ Templates   │  │   Themes    │  │   Blocks    │          │
│  │   System    │  │   Engine    │  │   System    │          │
│  └─────────────┘  └─────────────┘  └─────────────┘          │
├─────────────────────────────────────────────────────────────┤
│  Application Layer                                          │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐          │
│  │   Modules   │  │   Routing   │  │   Security  │          │
│  │   System    │  │   Engine    │  │   Layer     │          │
│  └─────────────┘  └─────────────┘  └─────────────┘          │
├─────────────────────────────────────────────────────────────┤
│  Core Layer                                                 │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐          │
│  │    Core     │  │   Database  │  │    User     │          │
│  │   Engine    │  │   Access    │  │ Management  │          │
│  └─────────────┘  └─────────────┘  └─────────────┘          │
├─────────────────────────────────────────────────────────────┤
│  Data Layer                                                 │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐          │
│  │   MySQL/    │  │  File Cache │  │   Storage   │          │
│  │  MariaDB    │  │   System    │  │   System    │          │
│  └─────────────┘  └─────────────┘  └─────────────┘          │
└─────────────────────────────────────────────────────────────┘

Core Components

1. Core System

Location: /core/

The core handles basic functionality:

  • core.php - Main functions and constants
  • security.php - Security system
  • template.php - Template engine
  • user.php - User management
  • admin.php - Administrative functions

2. Configuration System

Location: /config/

All system settings are stored in separate configuration files:

  • config_db.php - Database settings
  • config_security.php - Security parameters
  • config_*.php - Module configurations

3. Module System

Location: /modules/

Each module represents separate functionality:

modules/
├── news/           # News system
├── pages/          # Static pages
├── forum/          # Forum
├── shop/           # E-commerce
├── files/          # File archive
├── media/          # Media gallery
├── users/          # User management
└── voting/         # Voting system

4. Template System

Location: /templates/

Supports multiple themes:

templates/
├── default/        # Default theme
├── lite/           # Lightweight theme
└── admin/          # Admin theme

Security Layer

SLAED CMS implements multi-layered security:

1. File Access Protection

if (!defined('MODULE_FILE') && !defined('ADMIN_FILE')) 
    die('Illegal file access');

2. Input Validation

function getVar($method, $name, $type, $default = '')

3. SQL Injection Prevention

Through prepared statements

4. CSRF Protection

Via tokens

5. CAPTCHA Integration

reCAPTCHA support

Caching System

Multi-level caching:

1. Browser Caching

function setCache($id = '') {
    if ($id === "1") {
        $max = $cached * 86400;
        header('Cache-Control: public, max-age='.$max);
    }
}

2. File Caching

  • CSS files: /config/cache/
  • JavaScript files: /config/cache/
  • Content: configurable lifetime

3. Resource Compression

function getCompressCss($css)
function getCompressCode($code)
function getCompressHtml($html)

Database Layer

Database abstraction layer supports:

  • MySQL/MariaDB (primary)
  • Prepared statements
  • Automatic escaping
  • Connection pooling

Table Structure

-- Main tables
{prefix}_modules        -- System modules
{prefix}_categories     -- Categories
{prefix}_users          -- Users
{prefix}_groups         -- User groups
{prefix}_blocks         -- Interface blocks
{prefix}_config         -- Configuration

Request Lifecycle

Request processing flow:

  1. Entry Point (index.php)
  2. Core Loading (core/core.php)
  3. Security Initialization
  4. Module Determination via name parameter
  5. Access Check
  6. Module Loading
  7. Content Rendering
  8. Template Application
  9. Output