All Projects → craftcms → spoke-and-chain

craftcms / spoke-and-chain

Licence: 0BSD license
Craft CMS + Craft Commerce demo site.

Programming Languages

Twig
543 projects
PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to spoke-and-chain

commerce-stripe
Stripe payment gateway for Craft Commerce
Stars: ✭ 21 (-12.5%)
Mutual labels:  craftcms, craft-commerce
digital-products
Sell digital products with Craft Commerce.
Stars: ✭ 14 (-41.67%)
Mutual labels:  craftcms, craft-commerce
DigitalProducts
Sell digital products with Craft Commerce
Stars: ✭ 48 (+100%)
Mutual labels:  craftcms, craft-commerce
craft-cpbodyclasses
Control Panel Body Classes plugin for Craft CMS
Stars: ✭ 24 (+0%)
Mutual labels:  craftcms
fastcgicachebust
DEPRECATED Bust the Nginx FastCGI Cache when entries are saved or created.
Stars: ✭ 20 (-16.67%)
Mutual labels:  craftcms
craft-guide
A CMS Guide for Craft CMS.
Stars: ✭ 62 (+158.33%)
Mutual labels:  craftcms
craft-webperf
Webperf helps you build & maintain high quality websites through Real User Measurement of your website's performance
Stars: ✭ 24 (+0%)
Mutual labels:  craftcms
SecureAssetDownload
Craft CMS plugin for secure asset download URLs
Stars: ✭ 22 (-8.33%)
Mutual labels:  craftcms
molecule
⚛️ Grab Twig components, CSS and JS files outside the primary template folder
Stars: ✭ 20 (-16.67%)
Mutual labels:  craftcms
craft.patrol
Patrol simplifies SSL and maintenance routing for sites built with Craft
Stars: ✭ 90 (+275%)
Mutual labels:  craftcms
craft-plugin-patrol
Patrol for Craft 3
Stars: ✭ 28 (+16.67%)
Mutual labels:  craftcms
craft-connect
Allows you to connect to external databases and perform db queries
Stars: ✭ 16 (-33.33%)
Mutual labels:  craftcms
craft-bulkedit
Bulk edit any set of elements
Stars: ✭ 22 (-8.33%)
Mutual labels:  craftcms
colorit
A slick color picker fieldtype plugin for the Craft CMS 3 control panel
Stars: ✭ 18 (-25%)
Mutual labels:  craftcms
craft-boilerplate
Starter project for Craft CMS & Tailwind CSS Sites
Stars: ✭ 18 (-25%)
Mutual labels:  craftcms
snipcart-craft-plugin
Craft e-commerce in a day.
Stars: ✭ 20 (-16.67%)
Mutual labels:  craftcms
padstone
Padstone is a Craft CMS starter kit with a curated configuration, Boilerplate templates, and handpicked plugins.
Stars: ✭ 18 (-25%)
Mutual labels:  craftcms
craft-3
Boilerplate with Craft CMS, Tailwind CSS, VueJS & Alpine.js used for internal projects.
Stars: ✭ 34 (+41.67%)
Mutual labels:  craftcms
query
Run SQL queries as an admin from the Craft CMS control panel.
Stars: ✭ 14 (-41.67%)
Mutual labels:  craftcms
linkit
Linkit Plugin for Craft 3
Stars: ✭ 25 (+4.17%)
Mutual labels:  craftcms

Spoke & Chain Craft Commerce Demo

Spoke & Chain homepage

Overview

Spoke & Chain is a fictitious bicycle shop custom-built to demonstrate Craft CMS and Craft Commerce. This repository houses the source code for our demo, which you can spin up for yourself by visiting craftcms.com/demo.

We’ve also included instructions below for setting up the demo in a local development environment with Craft Nitro.

Spoke & Chain shows core Craft CMS features and a fully-configured Craft Commerce store:

  • Articles and pages with custom layouts and flexible content.
  • Front-end global search for products and articles.
  • Categorized products with variants, categories, filtering, and sorting.
  • Customer membership area with subscription-based services, order tracking and returns, and account management.
  • Full, customized checkout process with coupon codes.
  • Configured for healthy SEO and built targeting WCAG AA compliance.

Development Technologies

Front End Dependencies

Local Development

Environment

If you’d like to get Spoke & Chain running in a local environment, we recommend using Craft Nitro:

  1. Follow Nitro’s installation instructions for your OS.
  2. Make sure you’ve used nitro db new to create a MySQL 8 or MariaDB 10 database engine.
  3. Run nitro create with the URL to this repository:
    nitro create craftcms/spoke-and-chain spokeandchain
    • hostname: spokeandchain.nitro
    • web root: web
    • PHP version: 8.0
    • database? Y
    • database engine: mysql-8.0-*.database.nitro (or mariadb-latest-*.database.nitro)
    • database name: spokeandchain
    • update env file? Y
  4. Restore the initial database
    nitro craft db/restore seed.sql
  5. Optionally seed demo data:
    nitro craft demos/seed

    ⚠️ The Craft site is offline by default, and the seeder turns it on when it’s finished. If you skip this step, you’ll need to manually bring the site online by navigating to SettingsGeneral Settings and switching System Status to “Online”.

  6. Move to the project directory and add a Craft account for yourself by following the prompts:
    cd spokeandchain
    nitro craft users/create --admin

💡 If you’re using a different local environment, see Craft’s Server Requirements and Installation Instructions.

Front End

Run npm ci with node 12. (If you’ve installed nvm run nvm use, then npm ci.)

If you’ve chosen a different environment setup, make sure your .env is configured for it. These environment variables are specifically used by webpack-dev-server:

  • DEVSERVER_PUBLIC
  • DEVSERVER_PORT
  • DEVSERVER_HOST
  • TWIGPACK_MANIFEST_PATH
  • TWIGPACK_PUBLIC_PATH

You can then run any of the development scripts found in package.json:

  • npm run serve to build and automatically run webpack with hot module reloading for local development
  • npm run build to build front end assets for production

💡 When using npm run serve, switch your site’s URL from https:// to http://.

PurgeCSS

This project uses PurgeCSS to automatically remove redundant or unused styles generated by Tailwind CSS.

PurgeCSS is disabled by default for the serve script, meaning your site will be loaded with every available CSS class. It also means you’ll need to check the site after running build to be sure important classes aren’t inadvertently stripped away.

Classes actively being used should be detected automatically, but you can encourage them to be recognized by making sure full class names appear in your template, stylesheet, and JavaScript files.

For example, don’t dynamically combine text-red- with a variable for this loop:

{% set classes = ['100', '500', '900'] %}
{% for class in classes %}
  <div class="text-red-{{ class }}"></div>	
{% endfor %}

Loop through complete class names like so they each appear in full:

{% set classes = ['text-red-100', 'text-red-500', 'text-red-900'] %}
{% for class in classes %}
  <div class="{{ class }}"></div>	
{% endfor %}

If you can’t avoid programmatic concatenation, use Tailwind’s safelist option in tailwind.config.js.

Testing

Cypress tests cover multiple parts of the website:

  • control panel – make sure the content structure is properly defined.
  • front end – check that the website’s different sections work as expected.
  • accessibility – evaluate the website for WCAG 2.0 compliance.

Set the environment variables Cypress needs to run by copying cypress.example.json to cypress.json and adjusting it:

cp cypress.example.json cypress.json

Open the Cypress Test Runner from the project root:

npx cypress open

Open accessibility tests only:

npx cypress open --config testFiles=./front/a11y/*.spec.js

License

The source code of this project is licensed under the BSD Zero Clause License unless stated otherwise.

The imagery used by this project is the property of Marin Bikes, and used with permission. You are not free to use it for your own projects.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].