solve-it-once / frost

Drupal 10 atomic construction kit
https://www.frostdrupal.com/
GNU General Public License v2.0
16 stars 4 forks source link
atomic-design composer drupal drupal-10 platformsh

License: GPL GitHub top language GitHub language count

Frost: Low-code Drupal for your whole team

Frost (even more info on drupal.org) is a component-forward Drupal install profile. It's made for teams and agencies that want to launch quickly, build Drupal-based functionality on top, and maintain the codebase in the long term with less frustration.

Inline editing right out of the  box

On installation, you have the components, configurations, content, and instructions to make a launchable brochure site without fuss, so your team can focus on advanced functionality.

Features

All the awesome stuff that comes with Drupal and contrib, plus:

One more thing: Heroes. Content, terms, and products all have a hero that shows the page title by default, but a Hero display mode can be used anywhere to override the hero layout, or a custom Paragraphs-based hero with all the styling options (including looped background videos!) can be dropped in, all without calling on a developer.

Installed entity types + bundles

Theses are the kinds of things every site should need, so frost makes them available on day one:

Content (node)

Node configurations can be cloned, and the common field settings are easy enough to add and remove from bundle to bundle.

Components (paragraphs)

By making most content use a consistent set of Atomic Design components, we can ensure content site-wide abides by the directives of your design system.

All the components are Paragraphs including the layout mechanism, so tools like Gutenberg and Layout Builder aren't required.

Sectioning

The "Stripe: Atomic" sectioning container gives you a lot of flexibility to build out experiences, but could be a ton of work if every section on the site is different. For designs with consistent-or-alternating sections you can easily take a "balanced breakfast" approach and create other 'Stripe' sections like "Stripe: Image + text" or similar.

Storytelling
Utility

Product

Taxonomy

Installation

This guide is intended to get you going with a site quickly, and assumes a moderate amount of technical knowledge, such as the ability to install dependencies using a nix-style package manager.

Prerequisites:

  1. git
  2. ddev (and docker, among ddev's dependencies)
  3. A text editor or IDE such as vscode, PHPStorm, etc.
  4. For additional advanced functions, a PHP CLI, composer, and other tools locally rather than in the containers

You'll probably have luck cloning the repo in step 2 of the local steps below, but if not then you'll want to make an account on GitHub and add a working SSH public key to your account.

Local machine installation

In the future we may automate more of these steps, but for now it's useful to walk through them all to ensure success, and to drill down into points where the process could tentatively fail for you.

If you follow these steps and run into difficulty, please add an issue to this repository with a detailed explanation of what went wrong, so we can fix it and amend the documentation further. Thank you.

  1. cd to where you want to store the repository on your computer (if unsure, cd ~ then mkdir htdocs then cd ~/htdocs)
  2. git clone git@github.com:solve-it-once/frost.git nameofyoursite (where 'nameofyoursite' is the site name with just letters/numbers/underscores)
  3. cd nameofyoursite to enter the repository
  4. vi .git/config (or use your text editor of choice) and save the file with "filemode = false" under core
  5. vi .ddev/config.yaml and change the 'name' (where the word 'frost' is) to be 'nameofyoursite' instead
  6. vi blt/example.local.blt.yml and change the two instances of 'frost' to 'nameofyoursite'
  7. ddev start to create and begin running the application's containers
  8. ddev composer install to ensure the dependencies are available. ddev start tries to do this but sometimes fails
  9. (optional, potentially frustrating) ddev blt blt:init:git-hooks to validate your commits (you may be prompted to provide feedback data to the BLT maintainers)
  10. ddev blt source:build to move the settings files into place, among other automated activities
  11. ddev drush sql:connect to confirm the mysql command has plausible looking database, user, and password values
  12. ddev drush si to install Drupal using the frost install profile/distribution. Say yes to delete the database, and ignore errors and warnings. This command will tell you the admin usernsmae and password. Copy these and retain them for your records
  13. ddev drush en frost_default_content to install the pages and examples for a head start
  14. (optional) ddev drush pmu frost_default_content to keep the installed modules clean
  15. ddev drush uli to get a URL you can copy and then paste into your browser to log into your new site. If this doesn't work, use the admin username and password from step 12
  16. When you paste the URL into your browser, you may get a warning about security. This is due to the local site using a self-signed certificate and is nothing to worry about. Open the advanced options accordion and click the link to proceed (this may take a few seconds)
  17. Once you've proceeded and see the first screen of the site as a logged-in admin user, it should be the path /user/1/edit. On the User #1 edit screen, be sure to at least enter a name in the name field, and ideally the other profile fields
  18. At the very top left of the User #1 edit screen, click the Drupal drop to go to the home page. You're frost-ing now!

Post-install

The exact steps to take your local dev site and turn it into a live website on the public internet varies by which hosting service provider you choose, but the following rough guidelines could help in setting up your site and workflow:

If you go through the process of deploying a frost site to a hosting service without detailed instructions in this readme, the project would love your contribution of tweaked configuration files and step-by-step instructions! Presently frost intends to support:

...though other services or a plain LAMP hosting server are also welcome.

Kill it with fire!

If you're done evaluating frost and want to delete the nameofyoursite instance off your laptop, you can do the following:

  1. ddev delete -y (this kills the crab)
  2. cd .. to leave the nameofyoursite folder
  3. rm -rf nameofyoursite/

Customizing

Much of the site-specific work you'll do is standard Drupal site-building, like making or cloning new content and other entity types and assigning fields, form widgets, and view modes for them, but there are a few places primarily in frost_theme where small tweak can really make the site look like your own:

Reasoning

Why would you choose frost instead of another installation profile, CMS, or SaaS product? Why does frost do things the way it does?

  1. Drupal is a great content management framework for building sophisticated applications
  2. However, Drupal does not have a built-in site builder tool like Wordpress's block editor
  3. Tools like layout builder that other Drupal install profiles use, in my (Brad's) opinion, are more frustrating than they are powerful, while the Paragraphs contrib module works great
  4. Most designs most of the time can be replicated using a component system of about 25 base-level components including stripe backgrounds and flex layouts
  5. Utility-first CSS works great with Drupal, albeit the buildout can be time-consuming, so frost is intended to save that time
  6. With the storytelling and base site-building out of the way, the development on a project can be branding and then advanced functionality. Previous time-sinks like frontend development are diminished that way
  7. JavaScript functionality can also be atomic, in a sense, by leaning on MutationObservers, bubbled events, and initialization in the lifecycle. See docroot/themes/custom/frost_theme/js/partials for lots of examples
  8. Having a bunch of structure and functionality built out in a best practices manner can help additional work follow the same good patterns
  9. By golly, every site's gonna have a Privacy Policy and stuff. Might as well include all these pages from the get-go, because making them again is a real drag