The School of Computing, in the National University of Singapore, provides each Computing undergraduate 50 pages of paper to print every month. However, printing using the school printers is a struggle, and students trying to print face the following inconveniences:

  • difficulty in setting up the printer drivers, having to spend hours especially configuring printer drivers in Mac laptops.
  • no place to check printer queues, unless you are in the school physically, where there is a screen that displays the printer queues
  • the school printers prints an extra page informing students of their remaining quota for the month after each printing session, which is a waste of paper for the school and a minor inconvenience for students

Being Computing students ourselves, we decided to put our skills to the test and create a printer app to help fellow Computing undergraduates print easily, without the hassle of setting up printer drivers.

What it does

Our solution is a web app where students can log in using their school account credentials, upload their files to the app, and print. The app has the following features:

  • ability to view printers, their locations, and existing printer queues
  • ability to print multiple files at a time
  • viewing each student's print quota, without wasting a piece of paper

How we built it

How it works

We can initiate a print by initiating a SSH connection with Sunfire, a UNIX machine in the School of Computing. Files can be transferred via the Secure Copy Protocol (SCP) from the user's protocol to Sunfire, and initiate commands for the printer drivers to print the file (based on the student manual provided to us).

Our web app is created using React and styled using the Material UI library. Users can log in with their credentials, and the app will initiate an SSH connection using the node-ssh library. When they upload files and choose their desired printer, the React app will send the corresponding UNIX command to the SSH connection to initiate a print.

Challenges we ran into

The first challenge was to set up the connection using node-ssh. It turns out that the library cannot be used in a React app directly, so we created a server. The server and client app will communicate via websockets.

The second challenge was to set up a websocket class that abstracts the calls from the frontend to the server. The websocket class has higher level methods like 'connect' and 'print', which can be called by the frontend. It tested my understanding of Promises in Javascript, so I can write websocket class methods that provides a cleaner syntax when used in the frontend.

The third challenge was to transfer files that the user uploaded to the Sunfire machine via SCP. Because web apps do not contain the file app of a local machine, we had to upload the files to the server before transferring it to the Sunfire machine. As of now, we have not managed to complete it.

Accomplishments that we are proud of

We managed to create a functioning web app using React and Material UI, with a beautiful user interface, and initiate printing by sending the relevant commands using SSH to print.

What we have learned

  • Learning how to use the NodeSSH library
  • Learning how to initiate printing with the university's printers, using SSH
  • Learning how websockets worked
  • Improving our understanding of React, Material UI and web design

What's next for SoC Printer App

  • Improve the user experience, as the websockets time out very quickly, thus providing a bad user experience
  • Get our friends in computing courses to try out the app, and improve the app based on their advice
  • Securely store and handle user credentials
  • Include more features, such as the ability to cancel printing jobs and the addition of more printing options

Built With

  • material-ui
  • node-ssh
  • react
  • websocket
Share this project: