This is the makeabox application that generates laser-cut paths as a downloadable SVG or PDF file.
INFO: It runs on Rails 8.1 and Ruby 4.0, and draws with the laser-cutter gem, version 2.0.1, taken from GitHub until that version is on RubyGems. The front end is Propshaft, importmap and Stimulus with hand-written CSS, so the app itself needs no Node. The design notes are in .plans/001-dark-facelift/spec.md.
Assuming you develop on OS-X, it should be pretty trivial to get MakeABOX runnign locally using the provided Makefile:
make help
brew Installs Homebrew if on OS-X
bundle Installs the gems
deploy-quick Deploy makeabox to production using Capistrano, skips tests and git status
deploy Deploy makeabox to production using Capistrano
e2e Runs the Cypress suite against a local server on port 3055
git-status Ensures the local repo is clean
help Prints help message auto-generated from the comments.
lint-fix-all Runs rubocop with a more dangerous auto-correct
lint-fix Runs rubocop with auto-correct, then the specs
lint Runs rubocop
pre-commit Runs rspec and rubocop before the commit
ruby Installs Ruby if needed
server Starts the app on http://127.0.0.1:3055
test Run the local test suiteIf you don’t have make in your system, you should run xcode-select --install to install the XCode command line tools, which will install make for you, as well as git.
After that, you can try running:
make testRunning RSpecs via the Makefile depends on having bundle install ran, which in turn depends on having Ruby installed.
Ruby is installed via rbenv, which is installed via brew on OS-X, and via apt on Linux.
Finally, make pre-commit will run both specs and rubocop to ensure your changes are green on CI.
To run the app locally, run it via make:
make pumaThis should start Puma, and open a browser window to http://localhost:3000/ where you can see the app running.
You can also start puma via:
❯ bin/puma-startThe Cypress suite drives the real page: the live preview, the settings that are remembered in the browser, and the Generate dialog with its downloads. Node is needed for this and for nothing else.
make server # the app on http://127.0.0.1:3055, in one terminal
make e2e # the Cypress suite, in anotherThe discussion section embeds giscus once GitHub Discussions is enabled on the repository and the giscus app is installed. giscus.app then shows two ids; set them as GISCUS_REPO_ID and GISCUS_CATEGORY_ID in the environment of the server. Without them the section links to GitHub Discussions instead.
Before the next step, you need to have the private SSH key that Amazon gave you for your account, so that you can login as the user ubuntu and essentially — root.
Place this PEM file into a specific location: ${HOME}/.ssh/makeabox.pem and everything else will be easy.
Deploy is provided with Capistrano.
make deployOR, if you have locally modified changes you don’t want to check in yet, then:
make deploy-quickWe use NewRelic to monitor the application. The NewRelic dashboard is available here: