• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PHP Project Starter/Boilerplate with Coderigniter 3 and Twitter Bootstrap 3

CodeIgniter Boilerplate

A PHP Project Starter/Boilerplate with Coderigniter 3 and Twitter Bootstrap 3.

Introduction

This repository is developed upon the following tools:

Server Requirements (Preferred)

Features

This repository contains setup for rapid development:

  • Multi-tenant (e.g. Frontend Website, Admin Panel, API) website in single application
  • Modular design by CodeIgniter HMVC extension
  • Custom config files (sites.php, locale.php) for easy configuration of website behavior
  • Admin Panel with AdminLTE v2 theme, and Grocery CRUD integration
  • Admin Panel includes usage of Sortable library
  • API Site to handle RESTful endpoints, with shortcut functions to grab parameters and display results
  • User authentication for Frontend Website (Sign Up, Login, Forgot Password, etc.)
  • User authentication for Admin Panel (Login, Change Password, etc.)
  • Preset layouts and templates
  • Preset asset pipeline (e.g. minify scripts, image optimization) via Gulp (reference from gulp-starter 2.0 branch)
  • Preset data structure for Blogging (with pagination) and Cover Photos (carousel), which can be managed from Admin Panel
  • Form Builder library to help with form rendering with Bootstrap theme, form validation, etc.
  • Breadcrumb and Pagination handling fit with Bootstrap theme
  • Custom 404 pages for Frontend Website and Admin Panel
  • Multilingual support
  • Email config setup
  • Functions to be called from CLI (e.g. daily cron job, database backup)
  • ... more coming!

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
        database.php            --- Need to verify to ensure connection with MySQL database
        email.php               --- Created to centralize email configuration (preset: using Mandrill service)
        form_validation.php     --- Created to centralize validation forms for all forms, include ReCAPTCHA settings
        routes.php              --- Changed default controller from Welcome to Home
        site.php                --- Core configuration file for Frontend Website; same format also applied to Admin module
    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        
        Language.php            --- Controller to handle language switching
    core/                       --- Extending CodeIgniter core classes; can also be used within modules
        MY_Controller.php       --- Important class which contains shared logic of all controllers
        MY_Form_validation.php  --- Contains additional rule for validation
        MY_Loader.php           --- Required for HMVC extension
        MY_Model.php            --- Contains shared function for model classes (can consider to replace by https://github.com/jamierumbelow/codeigniter-base-model)
        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. Data Importer, Form Builder)
    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
            helpers/            --- Helper classes, e.g. to generate AdminLTE widgets
            libraries/          --- Libraries from Grocery CRUD and Image CRUB
            models/             --- Models only being used in Admin panel
            views/              --- Views for Admin Panel; can reuse Frontend views, or override by using same path/filename
        api/                    --- Another module specific for API endpoints
    third_party/
        MX/                     --- Required for HMVC extension
    views/                      --- Views for Frontend Website, can also be used by modules unless overrided
assets/
    css/                        --- Custom CSS files append to each site
    dist/                       --- Minified scripts, stylesheets and optimized images via Gulp tasks
    fonts/                      --- Font files copied via Gulp tasks
    grocery_crud/               --- Asset files from Grocery CRUD library
    image_crud/                 --- Asset files from Image CRUD library
    images/                     --- Source image files before optimization
    js/                         --- Custom CSS files append to each site
    uploads/                    --- Default directory of upload files, where permission should set as writable
gulpfile.js/                    --- Task runner following gulp-starter 2.0 practice
screenshots/                    --- Screenshot images for preview
sql/                            --- MySQL files
    latest.sql                  --- Latest version of all preset data
system/                         --- CodeIgniter core files (unchanged as clean CI3 installation)
.htaccess                       --- URL rewrite for Apache web server (require mod enabled)

Asset Customization (e.g. additional js/css files)

A gulp file (gulpfile.js) is prepared for asset pipeline. To make use of it, you need to pre-install the following tools before building the template:

  • node.js: which includes a package manager (npm) for node modules
  • bower: package manager for bower components (to handle third-party assets)
npm install -g bower
  • gulp: task runner for lots of purposes, e.g. compile, combine and minify scripts

Afterwards, change directory from your terminal to where you cloned the repository.

  1. Update bower.json then call bower to download third-party packages: bower install
  2. Update package.json then install gulp packages: npm install
  3. Update gulpfile.js (which is written in CoffeeScript), then use gulp command to start preset tasks: gulp
  4. After all you will find the post-processed files under the "assets/dist" folder, means you have successfully configured it :)

Get Started

  • Git clone this repository to a LAMP / WAMP server
git clone https://github.com/jiji262/codeigniter_boilerplate.git
  • Install dependency software with npm
npm install
  • Install frontend packages with bower
bower install
  • Build resources with gulp
gulp build
  • Setup Database
  1. create a MySQL database (e.g. named "ci_bootstrap"), then import data from sql/ci_bootstrap.sql

  2. Update database config file (e.g. under applications/backend/config)

  • Done.

That's it. After that, we can visit this project like:

Frontend: http://localhost/codeigniter_boilerplate/

Backend: http://localhost/codeigniter_boilerplate/admin/ (login as admin/admin)

Screenshots

Frontend - Home:

Admin Panel - Home:

More Repositories

1

wooyun_articles

drops.wooyun.org 乌云Drops文章备份
HTML
1,017
star
2

tianya-docs

精心收集的天涯神贴,不带水印,方便阅读
429
star
3

xiaoetong-video-downloader

小鹅通资源下载工具
Python
184
star
4

wechat-miniprogram-login-boilerplate

微信小程序云开发示例:用户登录、授权(获取用户信息、获取手机号)
JavaScript
88
star
5

douyin-downloader

抖音批量下载工具,去水印,支持视频、图集、合集、音乐(原声)。免费!免费!免费!
Python
80
star
6

awesome-AIGC-tools

AIGC information including ChatGPT , GPT-4 and others.
44
star
7

web_admin_tools

PHP
22
star
8

awesome-react-boilerplate

A collection of React boilerplate / Starter Project
22
star
9

Codeigniter-Excel-Export

An Codeigniter library for exporting the data from database to Excel file. (支持中文)
PHP
17
star
10

react_boilerplate

A React Boilerplate with webpack, testing with Karma
JavaScript
16
star
11

PAOOP

Codes & Errata for PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
PHP
8
star
12

chatgpt-web

A pretty simple ChatGPT website built with astro
TypeScript
6
star
13

miniprogram-starter

JavaScript
6
star
14

FlipCard.js

FlipCard.js implements card filp animation with javascript, css3 and html5.
JavaScript
5
star
15

react-guide-tour

An fantastic step-based site tour written with React
JavaScript
5
star
16

jClip

jClip.js - 兼容多浏览器的文本复制插件。对zeroclipboard.js进行封装,使其更加易于使用的jQuery插件
JavaScript
4
star
17

xiaomingxiangce

使用百度bae云存储(BCS)的相册系统,包含文件上传、瀑布流展示
PHP
4
star
18

putian-baidumap

让百度为莆田事件做点实事吧 - 莆田医院百度地图版
4
star
19

jProfiler

A stand-alone version of YUI 2 Profile without YUI library included
JavaScript
4
star
20

jiji262.github.io

令狐葱@前端笔记
HTML
3
star
21

taobao-JD-1111

【淘宝、支付宝、京东 双11活动自动脚本】2020天猫淘宝双11自动领喵币吸猫脚本、京东JD双11全民营业瓜分10亿自动领金币辅助 无后门无推广过无障碍防检测原生Auto.js纯净版
JavaScript
3
star
22

github-speed-up

在国内优雅快速的使用Github的方法
3
star
23

phpLauncher

[deprecated] Enhancement for Codeigniter plus Twitter Bootstrap framework.
PHP
3
star
24

iUpload-bcs

使用百度bae上的云存储(BCS)进行文件上传
PHP
2
star
25

Higashino-Keigo-timeline

东野圭吾作品列表
2
star
26

iUpload-pcs

使用百度bae上的个人云存储(PCS)进行文件上传
2
star
27

WowUI

A Flat and Responsive Web Template based on Bootstrap
2
star
28

react-router-demo

react-router-demo with react-router v3 & v4
HTML
1
star
29

jiji262

1
star
30

zsxq_spider

Python
1
star
31

JDQiandao-Github-Actions

JavaScript
1
star
32

2019-ncov-news

2019-nCoV 疫情最新实时数据更新渠道!不传谣,不信谣!
1
star
33

react-flux-demo

tutorial in progress
JavaScript
1
star
34

puppeteer-demo

JavaScript
1
star
35

react-redux-demo

tutorial in progress
JavaScript
1
star
36

es6-web-starter

A tiny library demo converting an ip address to an integer
JavaScript
1
star
37

wechat-fake-chatting

JavaScript
1
star
38

one-click-links

[Chrome Extension] Opens selected links in new tabs with the context menu
JavaScript
1
star