CrafterCMS is a modern content management platform for building digital experience applications including:
- Single Page Applications (SPAs) using frameworks like React, Vue, and Angular
- Native mobile apps and headless applications (IOT, digital signage, wearables, etc.)
- HTML5 websites using Bootstrap or other HTML frameworks
- e-commerce front-ends
- OTT video experiences on AWS Elemental Media Services
- AR/VR applications using A-Frame
You can learn more about CrafterCMS here: https://craftercms.org
Try CrafterCMS using a pre-built AMI (use the authoring AMI): https://aws.amazon.com/marketplace/seller-profile?id=6d75ffca-9630-44bd-90b4-ac0e99058995
Download a pre-built binary archive here: https://craftercms.org/downloads
Read the docs here: https://docs.craftercms.org/current
This repository is for developers interested in contributing to CrafterCMS, customizing their own release, or building the latest. This parent project helps you build the following:
- Deployable CrafterCMS binaries
- Docker images
- Developer's environment so you can compile and contribute to CrafterCMS
WARNING: CrafterCMS source code development and building is only supported on Unix based systems. If you want to use CrafterCMS in Windows, install Windows Subsystem for Linux (WSL) by following the instructions here then use the WSL 2 terminal for all the commands below. Please refer to the documentation in Installing CrafterCMS on WSL 2.
Please make sure your system meets the prerequisites: https://docs.craftercms.org/current/system-administrators/requirements-supported-platforms.html
Let's begin :)
If you're building deployable CrafterCMS binaries, we'll clone the master branch:
git clone -b master https://github.com/craftercms/craftercms.gitOR
If you would like to contribute to CrafterCMS, to build a developer's environment, we'll need to clone the develop branch (default):
git clone -b develop https://github.com/craftercms/craftercms.gitdownloadDownload dependenciescloneClone CrafterCMS modulesselfUpdateUpdate the parent project (craftercms)updateUpdate modulescleanClean modulesbuildBuild modulesdeployDeploy modulesupgradeUpgrade modules (same asupdate,build,deploy)startStart CrafterCMSstopStop CrafterCMSstatusReport status on running environments if anybundleCreate deployable binaries
overwriteChangedFiles: Update and overwrite the deployed environment (authoring or delivery) files (binaries, configuration, etc.), defaulttruerefreshEnv: Update the deployed environment (authoring or delivery) with any changes to the scripts, defaultfalseoverwriteArtifact: Update and overwrite the downloaded artifacts (example: Elasticsearch, Tomcat, ...) that's cached in the downloads folder by downloading it again, defaultfalsegitRemote: Git remote name to use in cloned modules, defaultorigingitBranch: Git branch to use when cloning modules, defaultdevelop(for develop branch)gitUrl: Which Git URL to use, defaulthttps://github.com/craftercms/socialRequiredorcrafter.social: Include Social in the build, defaultfalseprofileRequiredorcrafter.profile: Include Profile in the build, defaultfalsestartElasticsearchorwithElasticsearch: start Elasticsearch, defaulttruestartMongoDB: start MongoDB, defaultfalseunless Profile or Social are enabled. This is automatic.unitTest: Run unit tests during build, defaultfalseshallowClone: Clone only the latest commits and not the entire history (faster, but you lose history), defaultfalsebundlesDir: Where to deposit binaries, default./bundlesdownloadGrapes: Download Grapes ahead of time (useful when no public Internet is available), defaultfalsedownloadDir: Where to store downloads, default./downloadsauthoringEnvDir: Where to store the authoring environment, default./crafter-authoringdeliveryEnvDir: Where to store the delivery environment, default./crafter-deliverycurrentPlatform: What platform to build to (linuxordarwin), default is the build machine's OS
To build deployable and distributable binaries of CrafterCMS, use the Gradle task bundle. This task will generate .tar.gz files ready to be deployed to any system.
Before using bundle task make sure that the environment has been created and deployed using gradle tasks build and deploy
Archives will be named crafter-cms-${environment}-VERSION.tar.gz and can be found in the bundles folder.
./gradlew build deploy bundleTo run CrafterCMS from the binary archive, unzip and follow the instructions in the binary archive's README.txt.
CrafterCMS is a decoupled CMS, and that means you have an authoring environment that caters to content creators, and a different environment, delivery, that handles the end-users that use the experience created by the former.
To build a binary archive for a specific environment:
./gradlew bundle -Penv=authoringArchive will be named crafter-cms-authoring-${version}.tar.gz and can be found in the bundles folder.
For the delivery environment, simply substitute the env=authoring with env=delivery.
To download, build and generate a binary archive from a given tag or branch of the source code,
- Clone the branch/tag of craftercms that you want to work with
git clone -b <tag or branch> https://github.com/craftercms/craftercms/- Download, build and bundle the tag/branch that you want to work with
./gradlew build deploy bundleNote: When using a tag-based build, you're essentially cloning a point in time to build that specific version of CrafterCMS. That implies that you won't be able to update/nor push changes back.
CrafterCMS comprises a number of headless API-first (GraphQL, REST, in-process) modules that work together to provide the final solution. In this section, we'll start with the simple case of build everything/run everything, and then move on to building/hacking individual modules.
Build all CrafterCMS modules
./gradlew build deployStart CrafterCMS,
./gradlew startYou can now point your browser to http://localhost:8080/studio and start using CrafterCMS. To get started with your first CrafterCMS experience, you can follow this guide: https://docs.craftercms.org/current/content-authors/index.html.
- The authoring environment runs on port
8080, a great place to start, while the delivery environment runs on port9080.
Stop CrafterCMS,
./gradlew stopYou might have noticed that you essentially have two environments built and running: authoring and delivery. CrafterCMS is a decoupled CMS, and that means you have an authoring environment that caters to content creators, and a different environment, delivery, that handles the end-users that use the experience created by the former.
As a developer, you can use an authoring environment for most tasks without the need to run a delivery environment. It's important to note that delivery essentially runs the same software that's in authoring except Crafter Studio (the authoring tools).
By default, this project will build both environments unless instructed otherwise. The authoring environment runs at http://localhost:8080/studio, whereas the delivery environment runs at http://localhost:9080/.
To build, start and stop one of the two environments is similar to building/starting/stopping All.
./gradlew build deploy -Penv=authoring
./gradlew start -Penv=authoring
./gradlew stop -Penv=authoring ./gradlew build deploy -Penv=delivery
./gradlew start -Penv=delivery
./gradlew stop -Penv=deliveryThe mechanics for working with a single module are similar to working with all, with one exception: You can deploy a module to one or both environments (authoring/delivery).
CrafterCMS comprises the following modules:
You'll find these projects checked out and ready for you to contribute to in the folder src/{modules}.
Start by forking the module you want to work on. You can follow the GitHub instructions.
The next step is to switch the origin url location to be the one just forked, to do so you can use these GitHub instructions.
The last step will be to add an upstream repository from the main craftercms repo to your own. Follow these steps
to make it happen.
You can now work in your local system, and build/deploy and ultimately push to your fork. We welcome code contributions, so please do send us pull-requests.
To update your project with the latest:
./gradlew updateYou can update, build, deploy, start or stop a module by:
./gradlew update -Pmodules=studio
./gradlew build -Pmodules=studio
./gradlew deploy -Pmodules=studio -Penv=authoring
./gradlew start -Pmodules=studio -Penv=authoring
./gradlew stop -Pmodules=studio -Penv=authoring- If you don't specify the
envparameter, it means all environments (where applicable). - In the current version of CrafterCMS, some services run in the same Web container, and that implies the stopping/starting of one of these services will cause other services to stop/start as well.
For more detailed information and advanced topic, please visit the detailed documentation.