catalog and store images
Catsnap is a tool for managing your pictures. Never again will you lose your collection to a faulty hard drive. Never again will you run into upload limits, bandwidth maximums, or service closures.
Catsnap uses Amazon S3 and a PostgreSQL database to store and organize your images. Images are hosted for public access on S3, and each image can have one or more tags associated with it. Images can also be in an album, to organize sets of related images.
Once you store an image, you can look it up by its tags or album. Easy!
If you like, you can check out my catsnap instance to see what it looks like once running.
Catsnap uses a web service to provide you access to your images. Let’s walk through the process of getting it set up.
First, you’ll need to create an Amazon WebServices account, if you don’t already have one. This may take a bit of time, so be patient. Amazon will require a credit card, but the cost of running catsnap will be tiny–a few cents a month, at most.
Once you have an AWS account, you can create a bucket in S3 where your images will be stored. Pick a name that makes sense to you–I use “catsnap-andrewlorente”.
Optionally, you may wish to create a cloudfront distribution so people can download your images lightning-fast.
Now that you’ve got your S3 bucket set up, you’ll want a catsnap server. Catsnap is a snap to set up on Heroku, and this guide assumes you’ll do that. You can also run it on your own server, if you prefer.
To run catsnap on Heroku, you’ll first need to sign up. Like Amazon, Heroku will want your credit card information, but you’ll be able to run catsnap on their free tier. Heroku has an excellent getting-started guide. Go ahead and follow the first few steps of that, until you can successfully run heroku login.
Running a heroku app requires having a local checkout of your code. Clone Catsnap from Github:
git clone firstname.lastname@example.org:AndrewLorente/catsnap.git
Change into the catsnap directory and use the heroku toolkit to create a new app:
Deploy catsnap to Heroku:
git push heroku master
Now create a free-tier Postgres database for Catsnap to use:
heroku addons:add heroku-postgresql:dev
The output from this command will include a line like:
Attached as HEROKU_POSTGRESQL_RED
Promote that database to production (replace “COLOR” with the correct color from the previous command’s output):
heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL
Have Catsnap set the database up with the tables you need, and your database is ready to go:
heroku run yoyo-migrate -b apply migrations '$DATABASE_URL'
Now your catsnap server is all set up! Navigate to the url for your Heroku app and you’re ready to start adding images.
It is very straightforward to use the web interface. Search in the search box to find images you’ve previously stored. Use the upload or upload-by-url inputs to add new images.