Skip to content
kigsterPublic

About

MakeABox – use this app with a laser cutter to create a box with notches that connect all sides together.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

304 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Makeabox — Rails Application

Unit Tests Coverage

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.

1. Prerequisites

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 suite

1.1. Setup

If 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 test

Running 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.

2. Run the App Locally

To run the app locally, run it via make:

make puma

This 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-start

3. End-to-End Tests

The 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 another

4. Discussion Widget

The 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.

5. Deploying

5.1. Prerequisites

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.

5.2. Automatic Deploy

Deploy is provided with Capistrano.

make deploy

OR, if you have locally modified changes you don’t want to check in yet, then:

make deploy-quick

5.3. Manual Deploy

You can, of course, drive Capistrano by hand:

bundle exec cap production deploy --trace

About

MakeABox – use this app with a laser cutter to create a box with notches that connect all sides together.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages