Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ZOMG Memes! Realtime! Node.js! Kittehs! memecached is a community meme generator website/app written with Node.js. Meme publishing and consumption is realtime thanks to Now.js.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 app.js
Octocat-spinner-32 index.html
README.md

Memecached

Love memes?

Want to generate memes and share them with everyone in real-time?

Use Memecached.

About

Memecached is an extremely lightweight meme sharing service, written entirely in Javascript. The server itself, app.js, is exactly 50 lines of code.
All meme images are stored in a public Dropbox directory. It differs from conventional meme generator apps in that there is zero server-side image handling code.
Memes are shared in real-time using now.js, so once you hit Publish, everyone who is connected will see your meme image pop itself into the list.

How it works

All meme template images are stored on Dropbox.

  • When a new meme is published, the server takes a JSON object from the client, containing the meme name and text. No image whatsoever.

  • The received meme object is inserted into the mongo collection memes with a date timestamp added to it. The object is also sent to all connected clients immediately so that they may update their timelines. This also means that no further database queries are required to retrieve new memes.

  • When a client connects, the last few (25) memes are queried from the database and sent back. This can further be optimized by having an in-memory queue of the most recent memes, in addition to the database.

  • All meme generation is done entirely client-side, by drawing the text over the images using Canvas. The client doesn't have to download images, and the server doesn't have to handle them at all.

How to run

  1. First, run mongod to start the Mongo daemon.
  2. Next, run the server: node app.js
  3. Point your browser to http://localhost:8080.
  4. Bask in Memetic paradise.
Something went wrong with that request. Please try again.