Igniter CMS Documentation

Comprehensive Documentation - Version 2.0


Introduction

Installation/Setup

Requirements

  • PHP (recommended version: 8.0 or higher)
  • Enable `zip`, `gd`, and `intl` extension in php ini
  • Composer installed.
  • MySQL, Postgre, SQLite or another supported database
  • Web server (Apache, Nginx, etc.)

Installation Steps

  1. Clone or download the project from the repository (GitHub).
  2. Navigate to the project folder and run composer install to install dependencies.
  3. Set the database config in the .env file to configure environment and database settings.
    database.default.hostname = localhost
    database.default.database = igniter_cms_db
    database.default.username = root
    database.default.password = db_password
    database.default.DBDriver = MySQLi
    database.default.DBPrefix =
    database.default.port = 3306
  4. Set the base URL in .env file. app.baseURL = 'http://localhost/igniter-cms/'
  5. Make sure you create the database in your local server.
  6. Generate App Key: php spark generate:key. This command will generate/update the application key (APP_KEY) in .env file.
  7. Run database migrations with php spark migrate.
  8. Open the base url in browser. E.g. https://localhost/igniter-cms/.

Note: To reset database you can use these commands php spark delete:tables and php spark migrate

Using the Installer

  1. Download the Igniter CMS (zip) from this zip file.
  2. Extract the contents into your local web server directory (e.g., htdocs, www, or public_html).
  3. Alternatively, clone to repo into your local web server directory.
  4. Open the installer in your browser (for example: http://localhost/igniter-cms-installer/).
  5. Follow the on-screen instructions to provide your database and application details.
  6. Once installation is complete, the installer will configure your application, generate the .env file, set up the database, install dependencies
  7. The /install folder should be deleted after installation. Note it would be automatically removed in "production" environment for security.
  8. You can now access your site at the base URL you configured during installation.

Permissions

Ensure writable and public/uploads directories are writable by the web server.

Dashboard

The dashboard is the landing page of the backend and includes the following features:

  • Summary cards of total Users, Blogs, Pages, and Themes.
  • Site Analytics:
    • Recent Visits (Last 7 Days - Chart).
    • Recent Visits (Last 6 Months - Chart).
    • Most Pages Visited (Table).
    • Top Browsers (Table).
  • Table of Recent Posts (10).

CMS Management

The CMS module allows you to manage the website's content, including blogs, pages, and navigations.

Blogs

Create, update, and remove blogs. Features include:

  • Form for blog details, including title, content, and tags.
  • Slug generation from the title.
  • Image selection via input icon (copy file path under the "Actions" tab).
  • Category selection and SEO data customization.
  • Status toggles (e.g., Published or Draft).

Categories

Manage blog categories. Features include:

  • Create, update, and remove categories.

Pages

Create, update, and remove pages. Features include:

  • Form for page details, including title and content.
  • Slug generation from the title.
  • SEO data customization.
  • Status toggles (e.g., Published or Draft).

Data Groups

Organize and manage structured data entries for various purposes. Features include:

  • Form for data group details.
  • Structured data categorization.
  • Export options for analytics.
  • Fetching filters (e.g., for different themes).

File Manager

Upload, manage, and organize files (images, videos, audios, documents, etc.) for use within the application.

Upload, manage, and organize files, including images and documents.

Content Blocks

Create reusable content blocks for other parts of the website.

Appearance

Themes

Manage application themes here. Add, Active or remove themes.

Theme Editor

Edit theme files here. Uses code editor to edit file contents.

Settings

This is the module for managing your account details and changing passwords

Update Details

Update your account information (name, bio, etc.).

Change Password

Change your account password.

Admin Management

The Admin module provides features for managing users, system configurations, and website functionality.

Manage Users

Create, edit, and manage user accounts and their permissions.

Account Roles

Module Admin Manager
Dashboard
CMS
  • - Blogs
  • - Categories
  • - Navigations
  • - Pages
  • - Content Blocks
  • - DataGroups
File Manager
Settings
  • - Update Details
  • - Change Password
Admin
  • - Users
  • - Configurations
  • - Codes
  • - API Keys
  • - Activity Logs
  • - Logs
  • - Visit Stats
  • - Blocked IP's
  • - Whitelisted IP's
  • - Backups
Manage Themes
Plugins
Documentation
AI Assistance

Configurations

Adjust application settings and configurations to suit your needs.

Codes

Edit header and footer JavaScript as well as custom CSS.

API Keys

Generate and manage API keys for accessing CMS data via the API.

Activity Logs

View a history of user actions and system events for tracking changes.

Logs

Track system events and actions with detailed logs. Features include:

  • Detailed logs for system events.
  • Export functionality.
  • Error tracking.

Visit Stats

Analyze website traffic statistics and view detailed analytics.

Blocked IPs

Manage and restrict access from unwanted IP addresses. Features include:

  • Form for adding blocked IP addresses.
  • Manual or automated blocking.
  • Search and removal options.

Whitelisted IPs

Allow specific IP addresses for privileged access. Features include:

  • Form for adding whitelisted IP addresses.
  • Search and removal options.

Backups

Create and manage backups for the database and website files.

File Editor

Edit theme files directly within the admin panel (use this feature with caution).

Plugins

Installed Plugins

Manage installed plugins.

Plugin Configs

Manage plugin's configuration data.

AI Assistance

Enhance productivity and streamline workflows with AI-powered features tailored for Igniter CMS.

Ask AI

Get instant AI-powered assistance for any questions related to Igniter CMS. Features include:

  • AI-powered responses for troubleshooting and best practices.
  • Instant answers for common CMS-related queries.
  • Guidance on module usage and integrations.
  • Recommendations for optimizing CMS performance.
  • Interactive search for documentation and support topics.

AI Text Generation

Generate content dynamically to improve site efficiency and SEO ranking. Features include:

  • Generate CMS titles based on best practices.
  • Automate description generation for pages and posts.
  • Create dynamic SEO metadata to improve search visibility.
  • Suggest relevant tags for categorization.
  • Enhance user engagement with AI-crafted summaries.

AI Analysis

Leverage AI to gain insights into site performance and operational data. Features include:

  • Analyze site statistics for visitor trends.
  • Review and interpret error logs for debugging.
  • Track file logs for audit trails and security monitoring.
  • Evaluate activity logs to monitor user engagement.
  • Provide actionable insights for site optimization.

Deployment Instructions

This section outlines various methods to deploy your Igniter CMS application to a live server. Regardless of the deployment method chosen, you will always need to create and restore your database on the server.

Prerequisites for all Deployment Methods:

  • Access to your hosting control panel (e.g., cPanel).
  • Your Igniter CMS project files.

FTP Deployment

Deploying via FTP involves manually transferring files and setting up your database.

  1. Database Setup:
    1. Log in to your hosting control panel (e.g., cPanel).
    2. Create a new database and a new database user.
    3. Grant the newly created user all necessary permissions on the database.
    4. Export your local Igniter CMS database from phpMyAdmin (or your preferred database management tool).
    5. Access phpMyAdmin in your hosting control panel and import the exported database file into the newly created database.
  2. FTP Connection:
    1. If you don't already have one, create an FTP user in your hosting control panel.
    2. Connect to your server using an FTP client (e.g., FileZilla) with your FTP credentials.
    3. Navigate to the desired directory on your server where your website files will reside (e.g., public_html or a subdirectory).
  3. File Transfer:
    1. Upload all Igniter CMS project files from your local machine to the chosen server directory.
  4. Configuration Updates:
    1. Open the .env file in your uploaded project root on the server and update the database connection details (database name, username, password).
    2. Open app/Config/Database.php on the server and ensure the database connection settings are correct.
    3. Open app/Config/App.php on the server and set the baseURL to your domain (e.g., https://your-domain.com/).

CI/CD Pipeline (GitHub Actions)

This method leverages a Continuous Integration/Continuous Deployment pipeline using GitHub Actions for automated deployment.

  1. Workflow File Preparation:
    1. Navigate to the .github/workflows/ directory in your local Igniter CMS project.
    2. Rename main.yaml.txt to main.yaml.
    3. Open the main.yaml file.
    4. Uncomment the YAML configuration by removing the # symbol from the beginning of relevant lines.
    5. Update the server key with your FTP server address (e.g., server: ftp.your-domain.com).
    6. Update the server-dir key with the path to your website's directory on the server (e.g., server-dir: /your-site-path).
  2. GitHub Repository Setup:
    1. Create a new Git repository on GitHub.
    2. Add two repository secrets: FTPUSERNAME and FTPPASSWORD, using your FTP account details.
  3. Local Configuration Updates:
    1. Update your local .env file with the production database connection details.
    2. Update app/Config/Database.php with the production database connection settings.
    3. Set the baseURL in your local app/Config/App.php to your domain.
  4. Vendor Folder Handling:
    1. Zip your local vendor folder (e.g., vendor.zip).
    2. Manually upload vendor.zip to your server's deployment directory (e.g., using FTP or File Manager).
    3. Extract the vendor.zip file in the server's deployment directory. The vendor folder is typically not pushed to Git due to its size and dynamic nature.
  5. Server .env File:
    1. Create an .env file directly on your server in the root of your deployed application directory. This file will not be pushed by Git. Configure it with your production environment variables, especially database credentials.
  6. Push to GitHub:
    1. Commit all your local changes (including the renamed main.yaml and updated configurations).
    2. Push your committed changes to your GitHub repository. The CI/CD pipeline will automatically trigger and deploy your application.
  7. Database Setup: (Same as step 1.a-d in FTP Deployment)
    1. Log in to your hosting control panel (e.g., cPanel).
    2. Create a new database and a new database user.
    3. Grant the newly created user all necessary permissions on the database.
    4. Export your local Igniter CMS database from phpMyAdmin (or your preferred database management tool).
    5. Access phpMyAdmin in your hosting control panel and import the exported database file into the newly created database.

File Upload (cPanel File Manager)

This method utilizes your hosting provider's file manager to upload your entire project as a compressed archive.

  1. Local Configuration Updates:
    1. Update your local .env file with the production database connection details.
    2. Update app/Config/Database.php with the production database connection settings.
    3. Set the baseURL in your local app/Config/App.php to your domain.
  2. Compress Project:
    1. Zip your entire Igniter CMS project folder on your local machine. Ensure the zip file contains all necessary files and folders.
  3. Database Setup: (Same as step 1.a-d in FTP Deployment)
    1. Log in to your hosting control panel (e.g., cPanel).
    2. Create a new database and a new database user.
    3. Grant the newly created user all necessary permissions on the database.
    4. Export your local Igniter CMS database from phpMyAdmin (or your preferred database management tool).
    5. Access phpMyAdmin in your hosting control panel and import the exported database file into the newly created database.
  4. Upload and Extract:
    1. Log in to your hosting control panel (e.g., cPanel).
    2. Open the "File Manager".
    3. Navigate to the directory where you want to deploy your website (e.g., public_html or a specific subdirectory).
    4. Click on the "Upload" button and select your zipped Igniter CMS project file.
    5. Once the upload is complete, select the uploaded zip file in the File Manager.
    6. Click on the "Extract" button and choose the target directory for extraction (usually the current directory).

For Developers

Frontend Format (Headless/MVC)

You can set the CMS as a headless CMS or use the Views to render data. To set the format for frontend, got the Admin > Configurations and search FrontEndFormat. Set it to either MVC or API

Endpoints

The app includes fetch-only APIs for retrieving CMS data.

  • Generic Model Data
  • /api/{api-key}/get-model-data?model=navigations&take=10&skip=0: Generic - Fetch navigations (10 items, skip 0).
  • /api/{api-key}/get-model-data?model=categories&where_clause={"status":1}: Generic - Fetch filtered categories (e.g., status = 1).
  • /api/{api-key}/get-model-data?model=blogs&where_clause={"blog_id":"{blog-id}"}: Generic - Fetch filtered blogs (e.g., blog_id = {blog-id}).
  • /api/{api-key}/get-model-data?model=blogs&where_clause={"blog_id":"{blog-id}","status":1}: Generic - Fetch multiple filtered blogs (e.g., blog_id = {blog-id} and status = 1).
  • Blogs
  • /api/{api-key}/get-all-blogs: Returns a complete list of all published blog posts.
  • /api/{api-key}/get-blog/{blog_id}: Fetches a specific blog post with detailed content, metadata, and related information.
  • /api/{api-key}/get-blogs?take=10&skip=0: Retrieves paginated blog posts with customizable limit and offset parameters.
  • Categories
  • /api/{api-key}/get-category/{category_id}: Retrieves detailed information about a specific content category.
  • /api/{api-key}/get-categories: Gets all available content categories.
  • /api/{api-key}/get-categories?take=10&skip=0: Returns a filtered list of categories with pagination.
  • Codes
  • /api/{api-key}/get-code/{code_id}: Fetches a specific code snippet or block with its metadata.
  • /api/{api-key}/get-codes: Retrieves all available code snippets and blocks.
  • /api/{api-key}/get-codes?take=10&skip=0: Gets a paginated list of code blocks with filtering options.
  • Content Blocks
  • /api/{api-key}/get-content-block/{content_id}: Obtains a specific reusable content block.
  • /api/{api-key}/get-content-blocks: Returns all available content blocks.
  • /api/{api-key}/get-content-blocks?take=10&skip=0: Retrieves filtered content blocks with pagination.
  • Data Groups
  • /api/{api-key}/get-all-data-groups: Returns a complete list of all data groups.
  • /api/{api-key}/get-data-group/{group_id}: Fetches details for a specific data group, including metadata and associated entries.
  • /api/{api-key}/get-data-groups?take=10&skip=0: Retrieves paginated data groups with filtering options.
  • Navigation
  • /api/{api-key}/get-navigation/{navigation_id}: Fetches a specific navigation menu structure and its items.
  • /api/{api-key}/get-navigations?take=10&skip=0: Returns a paginated list of navigation menus with their structures.
  • Pages
  • /api/{api-key}/get-all-pages: Retrieves all published static pages in the system.
  • /api/{api-key}/get-page/{page_id}: Obtains a specific static page with its full content and attributes.
  • /api/{api-key}/get-pages?take=10&skip=0: Gets a paginated list of static pages with filtering options.
  • Search
  • /api/{api-key}/search-results?key=the: Performs a global search across all content types.
  • /api/{api-key}/model-search-results?type=blog&key=the: Searches within a specific content type.
  • /api/{api-key}/filter-search-results?type=author&key=admin: Performs a filtered search with specific criteria.
  • Themes
  • /api/{api-key}/get-theme/{theme_id}: Fetches information about a specific theme configuration.
  • /api/{api-key}/get-themes: Gets all available themes.
  • /api/{api-key}/get-themes?take=10&skip=0: Returns a paginated list of themes.

Model Names

Model Name Corresponding Model
blockedIPsModel App\Models\BlockedIPsModel
blogs App\Models\BlogsModel
categories App\Models\CategoriesModel
codes App\Models\CodesModel
contentBlocks App\Models\ContentBlocksModel
dataGroupsModel App\Models\DataGroupsModel
navigations App\Models\NavigationsModel
pages App\Models\PagesModel
themes App\Models\ThemesModel
whitelistedIPsModel App\Models\WhitelistedIPsModel

Model Attributes

Model Name Model Fields
BlogsModel blog_id(VARCHAR), title(VARCHAR), slug(VARCHAR), featured_image(VARCHAR), excerpt(VARCHAR), content(TEXT), category(VARCHAR), tags(VARCHAR), is_featured(BOOLEAN), status(INT), meta_title(VARCHAR), meta_description(TEXT), meta_keywords(TEXT), created_by(DATETIME), updated_by(DATETIME)
BlockedIPsModel blocked_ip_id(VARCHAR), ip_address(VARCHAR), country(VARCHAR), block_start_time(DATETIME), block_end_time(DATETIME), reason(VARCHAR), notes(VARCHAR), page_visited_url(VARCHAR)
CategoriesModel category_id(VARCHAR), title(VARCHAR), description(VARCHAR), group(VARCHAR), parent(VARCHAR), link(VARCHAR), new_tab(BOOLEAN), order(INT), status(INT), created_by(DATETIME), updated_by(DATETIME)
CodesModel code_id(VARCHAR), code_for(VARCHAR), code(VARCHAR), deletable(VARCHAR), created_by(DATETIME), updated_by(DATETIME)
ContentBlocksModel content_id(VARCHAR), identifier(VARCHAR), author(VARCHAR), title(VARCHAR), description(VARCHAR), content(TEXT), icon(VARCHAR), group(VARCHAR), image(VARCHAR), link(VARCHAR), new_tab(BOOLEAN), order(INT), custom_field(VARCHAR), created_by(DATETIME), updated_by(DATETIME)
DataGroupsModel data_group_id(VARCHAR), data_group_for(VARCHAR), data_group_list(VARCHAR), deletable(VARCHAR), created_by(VARCHAR), updated_by(VARCHAR)
ThemesModel theme_id(VARCHAR), name(VARCHAR), path(VARCHAR), primary_color(VARCHAR), secondary_color(VARCHAR), other_color(VARCHAR), image(VARCHAR), theme_url(VARCHAR), footer_copyright(VARCHAR), category(VARCHAR), sub_category(VARCHAR), selected(BOOLEAN), deletable(BOOLEAN), home_page(VARCHAR), created_by(DATETIME), updated_by(DATETIME)
WhitelistedIPsModel whitelisted_ip_id(VARCHAR), ip_address(VARCHAR), reason(VARCHAR)

App Messages

Customize the messages in the app in app/Config/CustomConfig.php.

class CustomConfig extends BaseConfig
{
        #--------------------------------------------------------------------
        # MESSAGES
        #--------------------------------------------------------------------
        public $wrongCredentialsMsg = 'Sign In Failed. The provided username/email or password is incorrect.';
        public $loginSuccessMsg = 'Login successful.';
        public $logoutSuccessMsg = 'You have been successfully logged out.';
        public $pendingActivationMsg = 'Your account has not been activated yet or is no longer active. Please contact the administrator.';
        public $tooManyFailedLogins = 'Too many failed login attempts. Your IP has been blocked for 1 hour.';
        public $invalidAccessMsg = 'You do not have access to this area.';
        public $createSuccessMsg = 'Record created successfully.';
        public $editSuccessMsg = 'Record updated successfully.';
        public $deleteSuccessMsg = 'Record removed successfully.';
        public $missingRequiredInputsMsg = 'There are validation errors. Possible missing required inputs.';
        public $sentContactMsg = 'Message sent successfully.';
        public $failedContactMsg = 'Form submission failed.';
        public $notFoundMsg = 'Record not found.';
        public $alreadyExistMsg = '[Record] already exists in table.';
        public $errorMsg = 'Oops! Something went wrong. Please try again later.';
        public $resetLinkMsg = 'A password reset link has been sent to your email address. Please check your inbox and follow the instructions to reset your password. If you do not see the email in your inbox, please check your spam or junk folder.';
        public $invalidResetLinkMsg = 'Invalid or expired password reset link.';
        public $passwordResetRequiredMsg = 'For security reasons, you need to change your password before continuing. Your current password was either set by an administrator or is a default password.';
        public $passwordResetSuccessfulMsg = 'Your password has been reset successfully. You can now log in with your new password.';
        public $passwordResetFailedMsg = 'Unable to reset password. Please try again';
        public $nonExistingResetEmailMsg = 'We are sorry, but the email address you entered is not associated with any account. Please check the email address and try again.';
        public $exceptionMsg = 'There was an error processing your request. Please try again. If this error persists, please see or send an email to system administrator.';
        public $contactMessageSuccessful = 'Your message has been sent successfully.';
        public $contactMessageFailed = 'Oops! Something went wrong with your message submission. Please try again later.';
        public $bookingSuccessful = 'Your booking has been made successfully.';
        public $bookingFailed = 'Oops! Something went wrong with your booking submission. Please try again later.';
        public $subscriptionSuccessful = 'You have successfully subscribed!';
        public $subscriptionFailed = 'Sorry, something went wrong with your subscription. Please try again.';

        #--------------------------------------------------------------------
        # THEME CATEGORIES
        #--------------------------------------------------------------------
        public $themeCategories = [
            'Business' => 'Business & Corporate',
            'Ecommerce' => 'Ecommerce',
            'Portfolio' => 'Portfolio & Resume',
            'News' => 'Blog & News',
            'Events' => 'Event & Booking Websites',
            'Educational' => 'Educational & Membership Websites',
            'Restaurant' => 'Restaurant & Hospitality Websites',
            'Health' => 'Health & Wellness Websites',
            'Directory' => 'Directory & Listing Websites',
            'Entertainment' => 'Entertainment Websites',
            'General' => 'General',
        ];


        #--------------------------------------------------------------------
        # USER ROLES
        #--------------------------------------------------------------------
        public $userRoles = [
            'Admin' => 'Admin',
            'Manager' => 'Manager',
            'User' => 'User',
        ];
    }
                                    

Activity Types Message

Customize the data for activity types in logs in app/Constants/ActivityTypes.php.

class ActivityTypes 
{
    //AUTH LOGS
    const USER_REGISTRATION = 'user_registration';
    const FAILED_USER_REGISTRATION = 'failed_user_registration';
    const USER_LOGIN = 'user_login';
    const USER_LOGOUT = 'user_logout';
    const FAILED_USER_LOGIN = 'failed_user_login';

    //CONTACT LOGS
    const CONTACT_CREATION = 'contact_created';
    const FAILED_CONTACT_CREATION = 'failed_contact_creation';
    const CONTACT_UPDATE = 'contact_updated';
    const FAILED_CONTACT_UPDATE = 'failed_contact_update';
    const CONTACT_DELETION = 'contact_delete';

    //USER LOGS
    const USER_CREATION = 'user_created';
    const FAILED_USER_CREATION = 'failed_user_creation';
    const USER_UPDATE = 'user_updated';
    const FAILED_USER_UPDATE = 'failed_user_update';
    const USER_DELETION = 'user_delete';

    .........................................................

    /**
        * Gets the description for a given activity type.
        *
        * @param string $type The activity type.
        * @return string The description of the activity type, or "Unknown Activity" if not found.
        */
    public static function getDescription($type)
    {
        $descriptions = [
            //Auth
            self::USER_REGISTRATION => 'User Registration',
            self::FAILED_USER_REGISTRATION => 'User Registration Failed',
            self::USER_LOGIN => 'User Login',
            self::USER_LOGOUT => 'User Logout',
            self::FAILED_USER_LOGIN => 'Failed User Login',

            //Contact
            self::CONTACT_CREATION => 'Contact Creation',
            self::FAILED_CONTACT_CREATION => 'Contact Creation Failed',
            self::CONTACT_UPDATE => 'Contact Update',
            self::FAILED_CONTACT_UPDATE => 'Contact Update Failed',
            self::CONTACT_DELETION => 'Contact Deletion',

            //User
            self::USER_CREATION => 'User Creation',
            self::FAILED_USER_CREATION => 'User Creation Failed',
            self::USER_UPDATE => 'User Update',
            self::FAILED_USER_UPDATE => 'User Update Failed',
            self::USER_DELETION => 'User Deletion',

            .........................................................
        ];

        return $descriptions[$type] ?? 'Unknown Activity';
    }
}
                                

Theme Files

Customize the files by going to app/Views/front-end/themes/{theme-folder}.