PRINTDECKDOCS

Architecture · Chapter 8

The apps

The iPhone and Watch app in watch/ reads the decks on the home network and the service away from home. docs/specs/iphone-app.md has its phases.

8.1 The deck API for apps

Both decks serve the OctoPrint-compatible API with the API keys of the deck. GET /api/plugin/printdeck has the status, the LCD panel, process (fdm or resin), and printer_id: the ID of the printer at the service. The queue routes list the files (GET …/queue), move a file (POST …/queue/<id>/move) and take a file out (DELETE …/queue/<id>). The API has no start of a queued file.

On the resin deck (newResinAPI) the API has the status, pause and cancel, the push pairing and the camera. It refuses uploads, each start and each resume, because the UV light goes on only after a press on the touch screen.

8.2 The iPhone and Watch app

  • Several printers. The app keeps a list of decks, each with its key in the keychain group of the app. The app has two tabs, Prints and Projects. The Prints tab has a card for each deck. The Live Activity shows the print that ends first. The widgets and the watch show the deck that prints.
  • Away from home. The app reads the service: the live prints of the projects, and for the owner the state of each printer. It matches them to its decks with printer_id.
  • Projects. The overview of a project, the approval of plates, Send to a printer, the marks Test, Ready, Delivered, In use and Rejected (with a note of why), notes, and photos from the camera. The 3D preview opens the web page in a web view, with the session. The Projects tab has the sign-in, and a card for each project with its prints that run, the prints ready for pickup, the plates that wait and the files in the queues. The app loads the photos and the models with the signed cookies that the replies of the API set.
  • The queue. The queue of each deck, with Up, Down and Remove, and no Start. A push message Next in the queue opens its deck. The app registers with the push relay at /api/v1/relay/ of the service, and the decks post their encrypted messages there.
  • The resin deck. The app has no Print and no Resume for a resin deck.

8.3 The sign-in in the app

The service serves /.well-known/apple-app-site-association with the webcredentials of the app. iOS then lets the app use the passkeys of printdeck.beetlebug.org: the passkeys of the iPhone and of a password manager, a passkey of another device with a QR code, and a security key. The app uses the routes of the web page (auth/login/begin and finish) and keeps the session token in its keychain. A session works for 14 days. A member gets the projects of the member, and no state of the printers.

Back: 7 The print queueContentsNext: 9 Updates