Code Monkey home page Code Monkey logo

printer-sample-app's Introduction

Printer Sample App

This app is (almost) the simplest possible Printer application. You should be able to use it to quickly get started building your own, much more interested application.

This app is designed to demonstrate automated scheduling of content for printers, as opposed to the human-driven mail and paint apps. People who register their printers with an application like this will have content delivered to their printer automatically on a regular basis.

You can take a look at the source.

If you don’t have a printer, why not find out how to get or make a printer for yourself?

How it works

All this happens automatically without user intervention, so in this way “publications” can be scheduled to appear at any time.

‘Registrations’ are created by storing a print URL alongside any other relevant information.

The rake run task is scheduled (in this case by Heroku, but possibly by cron or anything else) to run at 8 am. At this time, it will send a request for each job to its corresponding print URL, with the url parameter set to a unique job URL in this app.

The printer backend server takes this page and rasterises it for the destination printer to download.

Deploying to Heroku

First, create the heroku app:

heroku apps:create <app name>

Then, we'll need a few addons

heroku addons:add heroku-postgresql
heroku addons:add scheduler:standard

Next, set up the scheduler

heroku addons:open scheduler

You'll want to add a rake run task to run probably once a day, whenever is appropriate to send the data to the printer(s).

We need to set some configuration for the task. In this case, it's to tell the scheduler what the URL for our application is. Don't forget to change <app name> to whatever you chose above!

heroku config:set APP_URL="http://<app name>.herokuapp.com"

Finally, deploy the actual application

git push heroku master

Once everything starts running, you should be able to visit your application at the URL heroku reports (probably http://.herokuapp.com) and start registering printer(s).

More information

To find out more, you can take a look at any (or all) of the following:

printer-sample-app's People

Contributors

lazyatom avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.