This code repository holds all the code shown in the From Rules to Tools workshop at Design Matter 2021.
In order to run Mechanic, you need to install two things on your computer.
- Go to https://nodejs.org and click the green button on the left to download the version "recommended for most users".
- After downloading the file, double-click the installer package and finish the installation.
Skip this if you already have a text editor such as Atom, Sublime Text or VS Code installed
- Go to https://atom.io/ and click the "Download" button
- After downloading the file:
- Mac Drag the application to the Applications folder
- Windows Double-click the installer to install Atom
All instructions below are for Mac, but most explanations should work for Windows too
We are going to be creating a new Mechanic project.
First, get your Terminal / Command Prompt to be at the right folder
- Mac Open the Terminal application, write
cd ~/Desktop
(or copy-paste this command) and press Enter. - Windows
- Open the command prompt by pressing
Windows Key + X
and clicking onCommand Prompt (Admin)
. - Write
c:\Users\(username)\Desktop
(replacing(username)
by your username) and press Enter.
- Open the command prompt by pressing
Now you can run the command to create and run a new Mechanic project:
- Run
npm init mechanic@latest rules-tools-workshop
- Select
"template"
- Select
"React Image (SVG)"
- Call the function
my-first-function
Now you have created a Mechanic project and you can move into the folder and run the design tool:
- Run
cd rules-tools-workshop
- Run
npm run dev
- From the Terminal window, run
npm run new
- Choose "Example"
- Choose "Business Card Generator"
- From the Terminal window, run
npm run new
- Choose "Example"
- Choose "Instagram Story Generator"
To learn about what can be done and how to do it through Mechanic, visit the documentation site.