Package: catsnap
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.How it worksCatsnap 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 cancheck out my catsnap instanceto see what it looks like once running.Setting up CatsnapCatsnap 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 createan 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 cancreate a bucketin S3 where your images will be stored. Pick a name that makes sense to you–I use “catsnap-andrewlorente”.Optionally, you may wish tocreate a cloudfront distributionso 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 hasan excellent getting-started guide. Go ahead and follow the first few steps of that, until you can successfully runheroku login.Running a heroku app requires having a local checkout of your code. Clone Catsnap from Github:git clone git@github.com:AndrewLorente/catsnap.gitChange into the catsnap directory and use the heroku toolkit to create a new app:heroku createDeploy catsnap to Heroku:git push heroku masterNow create a free-tier Postgres database for Catsnap to use:heroku addons:addheroku-postgresql:devThe output from this command will include a line like:Attached as HEROKU_POSTGRESQL_REDPromote that database to production (replace “COLOR” with the correct color from the previous command’s output):heroku pg:promote HEROKU_POSTGRESQL_COLOR_URLHave Catsnap set the database up with the tables you need, and your database is ready to go:heroku runyoyo-migrate-bapply migrations '$DATABASE_URL'The last thing you’ll need to do is configure Catsnap for your personal use. Configure all of the following environment variables withheroku config:set VARIABLE_NAME valueCATSNAP_API_KEY is a secret key the client and server share for authentication. It can be any string of characters. You should keep it secret!CATSNAP_AWS_ACCESS_KEY_ID and CATSNAP_AWS_SECRET_ACCESS_KEY: find the values for these two variableson your AWS account page.CATSNAP_BUCKET: the S3 bucket that you set up earlier.CATSNAP_SECRET_KEY: a secret key to use when generating session identifiers. Like the API key, this can be any string of characters.CATSNAP_OWNER_ID: an OpenID provider that identifies you as the owner of this catsnap installation. I recommend using your Google account, in which case you would set this tohttps://www.google.com/accounts/o8/id.CATSNAP_OWNER_EMAIL: the email address associated with your OpenID url.CATSNAP_CLOUDFRONT_URL: (optional) the host for your cloudfront distribution, if you made one. Note this should be a full url, including “https://”.Now your catsnap server is all set up! Navigate to the url for your Heroku app and you’re ready to start adding images.Using CatsnapIt 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.