Akir4d / JACAT

A multi-tenant website template based on CodeIgniter and adminLTE3 with integration of some useful tools
MIT License
20 stars 12 forks source link
adminlte bootstrap codeigniter grocery-crud hmvc-extention ion-auth multi-tenant restserver

JACAT (Just Another CodeIgniter/AdminLTE template)

Latest Build: 2020-03-28

Note: This project is still in progress, but welcome for any issues encountered

A starter template that supports multi-tenant (Frontend / Admin Panel / API) website in a single application. This is a fork of abandoned CodeIgniter 3 Bootstrap. If you plan to upgrade form original you have to use sql/upgrade_from_old_codeigniter_3_bootstrap.sql and also check the changes inside application/modules/admin/config/ion_auth.php

This repository is developed upon the following tools:

Features

This repository contains setup for rapid development:

Demo Project

Server Environment

Below configuration are preferred; other environments are not well-tested, but still feel free to report and issues.

Setup Guide

  1. git clone this repo
  2. Create a database (e.g. named "jacat"), into MySQL server
  3. Inside /application/config/ copy "database.model.php" as "database.php" and make sure that database config is set correctly
  4. go to your-new-site/upgrade to install database with new tables and default configuration datas.
  5. You should be able to access Frontend Website, Admin Panel and API Site (with Swagger Doc) respectively
  6. Visit the Demo Controllers (exist in both Frontend / Admin Panel / API) for sample usage

Upgrade database from prevoius version

  1. go to your-new-site/upgrade to upgrade database tables

Admin Users (and default login accounts)

There are 4 preset users for Admin Panel:

Folder Structure

Explanation on the folder structure which supports HMVC (only showing the highlighted folders and files).

application/                    --- Main CodeIgniter source files
    config/
        production/             --- Configuration when ENVIRONMENT is set as "production"
        autoload.php            --- By default, some files are loaded for this repo
        jacat.php               --- Core configuration file for all sites
        database.php            --- Need to verify to ensure connection with MySQL database
        email.php               --- Created to centralize email configuration (default: using Mailgun)
        form_validation.php     --- Created to centralize validation forms for all forms, include ReCAPTCHA settings
        routes.php              --- Changed default controller from Welcome to Home
    controllers/                --- Controllers for Frontend Website; extends from MY_Controller (except Cli)
        Cli.php                 --- Utility function that can only be called from command line
        Home.php                --- Default controller for Frontend Website
    core/                       --- Extending CodeIgniter core classes; can also be used within modules
        MY_Controller.php       --- Important class which contains shared logic of all controllers
        MY_Loader.php           --- Required for HMVC extension
        MY_Model.php            --- Contains shared function for model classes
        MY_Router.php           --- Required for HMVC extension
    helpers/                    --- Contains custom helper functions being used throughout this repo
    language/                   --- Preset language files
    libraries/                  --- Custom libraries (e.g. Form Builder, System Message)
        MY_Email.php            --- Enhanced email library, includes work with Mailgun API
    models/                     --- Sample model extending from MY_Model
    modules/                    --- Each module can be accessed by http://{base_url}/{module_name}/{module_controller}/, etc.
        admin/                  --- Module for Admin Panel
            config/             --- Configuration for Admin Panel (overriding application/config/)
            controllers/        --- Controllers for Admin Panel; also extends from MY_Controller
            libraries/          --- Libraries specific for Admin Panel
            models/             --- Models only being used in Admin Panel
            views/              --- Views for Admin Panel; can reuse Frontend views, or override by using same path/filename
        adminlte/               --- Module with AdminLTE widgets
        api/                    --- Another module specific for API endpoints
    third_party/                --- 3rd party files (HMVC extension, Grocery CRUD, Rest Server, etc.)
    views/                      --- Views for Frontend Website, can also be used by modules unless overrided
assets/                         --- Folder for public files
    api/                        --- Swagger UI assets
    dist/                       --- Post-processed scripts and images via gulp tasks (don't manually edit files here!)
    grocery_crud/               --- Asset files from Grocery CRUD library
    image_crud/                 --- Asset files from Image CRUD library
    uploads/                    --- Default folder for upload files, where permission should set as writable
gulpfile.js/                    --- Task runner following gulp-starter practice
    tasks/                      --- Gulp tasks
    config.js                   --- Configuration for Gulp tasks
screenshots/                    --- Screenshot images for preview
sql/                            --- MySQL files
    backup/                     --- Files which will be created when backup database from CLI
    core/                       --- Files contains core data (e.g. Ion Auth)
    latest.sql                  --- Latest version of all preset data
src/                            --- Folder for non-public source files
    css/                        --- Custom CSS files append to each site
    images/                     --- Source image files before optimization
    js/                         --- Custom CSS files append to each site
    sass/                       --- SASS files for styling
    theme/                      --- Default folder for additional theme files
system/                         --- CodeIgniter core files (unchanged as clean CI3 installation)
.htaccess                       --- URL rewrite for Apache web server (require mod enabled)

Preset Gulp Tasks

The gulpfile.js folder is prepared with following tasks available:

Screenshots

Admin Panel - Home:

Frontend - Home:

More screenshots can be viewed from the screenshots folder under this repository.