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
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
.
A RESTful API is used to communicate between the server and the client.
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
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
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
Gets the nametag queue Returns JSON list of nametags in queue and their properties
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
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
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
Gets the printers
Returns JSON list of printers and their properties
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
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
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
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