Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/robostorm/nametag-auto-printing

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/robostorm/nametag-auto-printing

  • v0.0.0-20210717123440-d30ec27bc389
  • Source
  • Go
  • Socket score

Version published
Created
Source

Nametag-Auto-Printing

Webapp to take names and autonametically generate nametags with Openscad, slice it with Slic3r, and upload and print it on an Octoprint enable 3d printer. Developed and used by the Robostorm Robotics club of Hunterdon County 4-H.

The name submission page will allow a name to previewed with Openscad, and submitted to the server. it will ensure that names are under ten characters.

The manager page is located at /manager.html and allows veiwing and editing of the nametags in queue and printers. The manager page uses backgrid.js to make nice, editable tables to show nametags and printers.

This is intended to be used on a private network, and there are no security measures in place

Installation

First, install Go. The server is written in go and must be compiled.

Make sure the your GOHOME environment variable is set correctly.

Get the source code by running go get github.com/Robostorm/Nametag-Auto-Printing. This will clone the source into go's src directory

Build and install the server into go's bin directory by running go install github.com/Robostorm/Nametag-Auto-Printing. Then run the resulting executable in $GOHOME/bin.

REST API

A RESTful API is used to communicate between the server and the client.

GET /

Gets the name entering page, also serves resources such as images and js. Go to /manager.html for the manager. Returns the resource specified if available, 404 NOT FOUND if the resource does not exist. If image requested is not yet generated, returns a 409 CONFLICT

POST /preview

Previews the nametag

{
"name": "Name on the nametag"
}

Returns that the image will be at once generated

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No name key or name is empty

POST /submit

Submits a nametag

{
"name": "Name on the nametag"
}

Returns nothing

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No name key or name is empty

GET /nametags

Gets the nametag queue Returns JSON list of nametags in queue and their properties

POST /nametags/update

Update a nametag

A JSON form of the printer and its properties If an ID is supplied, edit that nametag, otherwise add a new nametag with specifed fields and generate an ID

POST /nametags/delete

Deletes a nametag

{
"id": "id of the nametag"
}

Returns nothing

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No id key or id is empty

POST /nametags/done

The nametag is done printing. Sets the nametag's printer to Idle and deletes the nametag

{
"id": "id of the nametag"
}

Returns nothing

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No id key or id is empty

GET /printers

Gets the printers

Returns JSON list of printers and their properties

POST /printers/update

Update a printer

A JSON form of the printer and its properties If an ID is supplied, edit that printer, otherwise add a new printer with specifed fields and generate an ID

POST /printers/delete

Deletes a printer

{
"id": "id of the printer"
}

Returns nothing

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No id key or id is empty

POST /printers/done

The printer is done printing. Sets the printer to Idle and deletes the printer's nametag

{
"id": "id of the printer"
}

Returns nothing

Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No id key or id is empty

POST /printers/abort

Abort the current nametag. Sets printer and nametags to Idle.

{
"id": "id of the printer"
}

Returns nothing Return Codes:

  • InternalServerError: Error receiving request
  • BadRequest: Bad JSON
  • OK: Everything good
  • StatusNotAcceptable: No id key or id is empty

FAQs

Package last updated on 17 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc