PHPackages                             charcoal/boilerplate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. charcoal/boilerplate

ActiveProject[Utility &amp; Helpers](/categories/utility)

charcoal/boilerplate
====================

A Charcoal Project Boilerplate

v1.3.0(2y ago)382MITPHPPHP ^7.4 || ^8.0

Since Apr 21Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/charcoalphp/boilerplate)[ Packagist](https://packagist.org/packages/charcoal/boilerplate)[ Docs](https://charcoal.locomotive.ca/)[ RSS](/packages/charcoal-boilerplate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (7)Used By (0)

Charcoal Project Boilerplate
============================

[](#charcoal-project-boilerplate)

A skeleton for creating Web sites with [Charcoal](https://github.com/charcoalphp/charcoal).

See below for an [overview](#overview) of this skeleton's structure and objectives.

Installation
------------

[](#installation)

This skeleton is available on [Packagist](https://packagist.org/packages/charcoal/boilerplate) and can be installed using [Composer](https://getcomposer.org/):

```
composer create-project charcoal/boilerplate example-project
```

After the skeleton is installed, point the document root of your Web server to the [`example-project/www`](www) directory.

By default, the skeleton includes an Apache [`.htaccess`](www/.htaccess) file. See below for examples on [configuring your Web server](#server-configuration).

From the command line, PHP provides a [built-in Web server](https://php.net/manual/en/features.commandline.webserver.php)for quickly serving your project:

```
cd www
php -S localhost:8080
```

Visit `http://localhost:8080` in your browser to see the following:

Example: Skeleton's default index page[![Screen capture of the skeleton's unstyled index page](docs/images/boilerplate-home.png)](docs/images/boilerplate-home.png)

Update
------

[](#update)

The skeleton does not provide any process for automated upgrades. You will have to port any updates manually.

This is because the skeleton is a starting point for your project and its various files are mainly present for demonstration and would otherwise be removed or modified for your purposes.

Application Configuration
-------------------------

[](#application-configuration)

Create a copy of the [`config/config.sample.json`](config/config.sample.json)file and name it `config/config.local.json`. This is your environment specific configuration file and it should be excluded from your project's source control repository. Edit this file to configure services such as the database, third-party services, logs, and caches.

Any other options relevant to your project should be changed in all other files in the [`config`](config) directory.

### Database Configuration

[](#database-configuration)

If your project does not require any database storage, use a database in-memory such as [SQLite](https://www.sqlite.org/) by adding the following to the `config/config.local.json` file:

```
{
    "databases": {
        "default": {
            "type": "sqlite",
            "database": ":memory:"
        }
    },
    "default_database": "default"
}
```

If your project uses MySQL, create an empty database and ensure a SQL user has the proper permissions for this database. Then add the following to the `config/config.local.json` file:

```
{
    "databases": {
        "default": {
            "type": "mysql",
            "hostname": "127.0.0.1",
            "database": "foobar",
            "username": "foo_bar",
            "password": "l337"
        }
    },
    "default_database": "default"
}
```

### Project Name

[](#project-name)

By default, the skeleton uses "Acme" as a dummy name. There are a few occurrences throughout the repository that should be changed to reflect your project:

- [`config/admin.json`](config/admin.json): See `admin.title`.
- [`config/config.json`](config/config.json): See `project_name` and `cache.prefix`.

You should also change the details of the Composer dependency manifest:

- [`composer.json`](composer.json): See `name`.

### Administration Dashboard

[](#administration-dashboard)

A quick-and-dirty command line script is provided to install the assets for the administration area:

```
./build/scripts/install-charcoal-admin.sh
```

Afterwards, visit `http://localhost:8080/admin/login` in your browser to see the following:

Example: Charcoal's administration login page[![Screen capture of Charcoal's administration login page](docs/images/admin-login.png)](docs/images/admin-login.png)

The administration area can be customized from the [`config/admin.json`](config/admin.json) file.

### Install Locomotive Boilerplate

[](#install-locomotive-boilerplate)

Optionally, another quick-and-dirty script is provided to install the Locomotive's [front-end development tools](https://github.com/locomotivemtl/locomotive-boilerplate):

```
./build/scripts/install-locomotive-boilerplate.sh
```

For more information, visit Locomotive's [Boilerplate repository](https://github.com/locomotivemtl/locomotive-boilerplate).

Server Requirements
-------------------

[](#server-requirements)

- [PHP](https://php.net/) &gt;= 7.4
- PHP Extensions:
    - [JSON](https://www.php.net/manual/en/book.json.php)
    - [MBString](https://www.php.net/manual/en/book.mbstring.php)
    - [PDO](https://www.php.net/manual/en/book.pdo.php)
    - [SPL](https://www.php.net/manual/en/book.spl.php)

Server Configuration
--------------------

[](#server-configuration)

### Apache Configuration

[](#apache-configuration)

Use the following configuration as a starting point for configuring the [Apache HTTP server](https://httpd.apache.org/). Note that this should be used instead of the skeleton's `.htaccess` file.

> Note that you should replace `path/to/example-project/www` with the actual path for `example-project/www`.

Example: Apache configuration```
# Set document root to be "example-project/www"
DocumentRoot "path/to/example-project/www"

        RewriteEngine on

        # If a directory or a file does not exist,
        # forward the request to the application controller
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php

```

### Nginx Configuration

[](#nginx-configuration)

Use the following configuration as a starting point for configuring the [Nginx HTTP server](https://nginx.org/).

> Note that you should replace `path/to/example-project/www` with the actual path for `example-project/www`.

Example: Nginx configuration```
server {
    listen 80;
    listen [::]:80;

    server_name example-project.test;
    root        /path/to/example-project/www;
    access_log  /path/to/example-project/logs/access.log;
    error_log   /path/to/example-project/logs/error.log;

    index index.php;

    charset utf-8;

    location / {
        # Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location = /favicon.ico {
        access_log off;
        log_not_found off;
    }

    location = /robots.txt  {
        access_log off;
        log_not_found off;
    }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~* /\. {
        deny all;
    }
}
```

Development
-----------

[](#development)

### Linting

[](#linting)

By default, the skeleton is developed with a number of coding style and static code analysis tools:

- [EditorConfig](https://editorconfig.org/) — Maintain consistent coding styles between different editors.
- [JSON Lint](https://github.com/Seldaek/jsonlint) — JSON coding style linter.
- [PHP Syntax Check](https://php.net/manual/en/features.commandline.options.php) — PHP syntax checker from the command line.
- [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) (PHPCS) — PHP coding style linter.
- [PHPStan](https://phpstan.org/) — Static PHP code analyser.
- [Psalm](https://psalm.dev/) — Static PHP code analyser.

PHPStan and Psalm are used together to take advantage of each one's specialties.

Linting can be executing by running one of the following commands:

```
# Run JSON Lint, PHP Lint, PHPCS, PHPStan, and Psalm
composer lint

# Run only JSON Lint
composer lint:json
./vendor/bin/jsonlint config/*.json

# Run only PHP syntax check
composer lint:php
php -l src/*.php

# Run only PHPCS
composer lint:phpcs
./vendor/bin/phpcs -ps --colors src/

# Run only PHPStan
composer lint:phpstan
./vendor/bin/phpstan analyse

# Run only Psalm
composer lint:psalm
./vendor/bin/psalm
```

Most of these tools can be configured from the following files:

- *EditorConfig* — The [`.editorconfig`](.editorconfig) file.
- *PHP\_CodeSniffer* — The [`phpcs.xml.dist`](phpcs.xml.dist) file or a `phpcs.xml` file.
- *PHPStan* — The [`phpstan.neon.dist`](phpstan.neon.dist) file or a local `phpstan.neon` file.
- *Psalm* — The [`psalm.xml.dist`](psalm.xml.dist) file or a local `psalm.xml` file.

### Testing

[](#testing)

By default, PHP tests are located in the [`tests`](tests) directory and developed with the [PHPUnit](https://phpunit.de/) framework.

Tests can be executing by running one of the following commands:

```
composer test
composer test:phpunit
./vendor/bin/phpunit
```

PHPUnit can be configured from the [`phpunit.xml.dist`](phpunit.xml.dist)or a local `phpunit.xml` file.

Optimization
------------

[](#optimization)

### Locked Dependencies

[](#locked-dependencies)

Your project's dependencies can be installed considerably faster when you include the `composer.lock` file in your project's source control repository. Composer automatically generates and keeps this file up to date.

### Autoloader Optimization

[](#autoloader-optimization)

When deploying to production, ensure that you are optimizing Composer's class autoloader map so Composer can rapidly find the corresponding file for a given PHP class:

```
composer install --optimize-autoloader --no-dev
```

Contributing
------------

[](#contributing)

We appreciate any contribution to the skeleton and Charcoal, whether it's a bug, typo, suggestions, or improvements.

Overview
--------

[](#overview)

Although it is ready to use, this skeleton is still incomplete.

It does not *yet* showcase all of the features of the Charcoal framework and therefore requires a lot of manual tinkering for options.

The following is a short "mission statement" of what is expected to be accomplished with this skeleton:

- A fully automated setup process.
    - Optional installation of [Locomotive Boilerplate](https://github.com/locomotivemtl/locomotive-boilerplate)for rapid front-end integration.
- Support for unilingual and multilingual applications.
    - Default data provided in English and French.
    - Easy internationalization (i18n) and localization (l10n).
- Support for Mustache and Twig templating.
    - Home page, with a few options and widgets (like carousel) or similar.
    - News list / news details, with attachment support.
    - Calendar (event list) with ajax options / event details, with attachment support.
    - Blog / article details, with attachment support and options to enable comments, and ajax actions
    - Contact, with a contact form that saves to a database and send a confirmation email depending to category options, with ajax actions.
    - Map, with locations by categories.
- A working administration dashboard.
    - User management.
    - With a default configuration that allows to manage CMS objects (sections, news, events, blogs, locations, etc.)
    - Permission system working and enabled.
    - Notification system working and enabled.
    - Revisioning system working and enabled.
    - Media library working and enabled.
    - Built-in help (doc) system working and enabled.
- Metadata 100% fully working on every pages and for every objects.
    - Use objects' metadata information, which all are editable in `charcoal-admin`.
- Provide an optimized set of SEO features.
- Search enabled
    - Results returned for all types of cms objects (sections, news, events, blogs, locations, etc.)
    - Used keywords, which all are editable in `charcoal-admin`.
    - Also search in attachments.
    - Auto-complete enabled and working.
- 100% tested with PHPUnit.

---

🚂

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance43

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Total

4

Last Release

781d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfb071c0ff7ce9500c528a003a2c53124248debc3e5bf367c17f89f5e6136125?d=identicon)[mducharme](/maintainers/mducharme)

![](https://www.gravatar.com/avatar/0a4f39523b4b2837562ba0848a0327b8d340118d1ba87cb0f5d59b1d5cb6beba?d=identicon)[mcaskill](/maintainers/mcaskill)

![](https://www.gravatar.com/avatar/f3f29e38395113e2400bdd7e51bea982b17f120d4d5a53d4473b53118ee46f8d?d=identicon)[JoelAlphonso](/maintainers/JoelAlphonso)

![](https://www.gravatar.com/avatar/4229f19eecd12c2b651b6502dcc5adfba48c5770db3d2dbea55fc92c7a246b2b?d=identicon)[BeneRoch](/maintainers/BeneRoch)

---

Top Contributors

[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (114 commits)")[![mducharme](https://avatars.githubusercontent.com/u/12157?v=4)](https://github.com/mducharme "mducharme (92 commits)")[![dominiclord](https://avatars.githubusercontent.com/u/1775204?v=4)](https://github.com/dominiclord "dominiclord (12 commits)")[![BeneRoch](https://avatars.githubusercontent.com/u/3017380?v=4)](https://github.com/BeneRoch "BeneRoch (5 commits)")[![veve40](https://avatars.githubusercontent.com/u/7537381?v=4)](https://github.com/veve40 "veve40 (5 commits)")[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (3 commits)")[![quentinhocde](https://avatars.githubusercontent.com/u/6057498?v=4)](https://github.com/quentinhocde "quentinhocde (3 commits)")[![Jerek0](https://avatars.githubusercontent.com/u/9463158?v=4)](https://github.com/Jerek0 "Jerek0 (2 commits)")[![jdacosta](https://avatars.githubusercontent.com/u/5209281?v=4)](https://github.com/jdacosta "jdacosta (2 commits)")[![hum-n](https://avatars.githubusercontent.com/u/4596862?v=4)](https://github.com/hum-n "hum-n (1 commits)")[![devenini](https://avatars.githubusercontent.com/u/19838822?v=4)](https://github.com/devenini "devenini (1 commits)")

---

Tags

boilerplatecharcoalcmsphpskeletonboilerplateSkeletoncharcoalproject

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/charcoal-boilerplate/health.svg)

```
[![Health](https://phpackages.com/badges/charcoal-boilerplate/health.svg)](https://phpackages.com/packages/charcoal-boilerplate)
```

###  Alternatives

[phpoffice/phpproject

PHPProject - Read, Create and Write Project Management documents in PHP

20717.4k](/packages/phpoffice-phpproject)[markocupic/contao-bundle-creator-bundle

This bundle provides a bundle maker for Contao 4.\*. The extension will create a fully working backend- or/and frontend module after you have defined a few parameters in the contao backend.

224.7k](/packages/markocupic-contao-bundle-creator-bundle)[easycorp/easy-doc-bundle

Symfony application documentation generator

1031.0k](/packages/easycorp-easy-doc-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
