An open-source image host, built using CouchDB. It's like Pinterest and Flickr, but without the service agreements. For a demo, check out my eggchair.
Before we begin, you'll need to install these:
Then get the repo and its dependencies:
git clone git://github.com/garbados/eggchair.git
cd eggchair
npm run setup
Next, we'll deploy our eggchair app to a CouchDB or Cloudant instance:
npm start
Then, we'll use quilter to map our image directory to wherever we want to host our app:
npm run sync
Now your app is live at http://localhost:5984/eggchair/_design/eggchair/_rewrite
! By default, it contains all the images in your ~/Pictures
folder. To modify where eggchair syncs images from and deploys the app to, do this:
npm run config
If you're using Cloudant, change the REMOTE_DB
variable to something like https://YOUR_USERNAME:YOUR_PASSWORD@YOUR_USERNAME.cloudant.com/eggchair
.
If you want to sync your images whenever you add new ones, check out the quilter project. It's what npm run-script sync
uses behind the scenes.
If you're using Cloudant, head to the permissions dashboard for your eggchair database and check "Read" for the row "Everyone else". This lets you share your images with the world.
If you're using CouchDB, open up Futon, go to your app, click "Security", and make sure under "Members" that "Names" is []
but "Roles" is ["reader"]
. That makes it publicly readable.
By default, your app will live at some url like user.cloudant.com/eggchair/_design/eggchair/_rewrite
, but that's not very pretty. To get pretty urls, like eggchair.maxthayer.org, go to your Cloudant dashboard, and create a Virtual Host pointing from some URL you control, to the _rewrite
url of your app, like this:
Use your DNS provider (ex: namecheap) to configure your subdomain settings. Here's what mine looks like: (note: only the part about sub-domains matters):
Egg Chair comes with a rewrites.json
file that takes care of all the URL rewrites. If you want to change the URL structure, change that file.