So you have a bunch of images sitting in a folder somewhere. Maybe they're on your hard drive, or maybe they're in the cloud. You've decided that it'd be helpful if these images were organized and tagged with useful information. Google Photos is a great solution to this issue--upload everything and Google's machine learning models get to work on identifying everything in your personal photos. It's a great service, and millions of people use it; I use it. But what do you do when Google just doesn't cut it? Maybe Google's tags aren't specific enough to be useful, or maybe you're concerned about handing your personal data to the information giant. That's why I've made WTag.
WTag isn't as smart as Google, Microsoft, or Apple's offerings when it comes to photo storage, but that's not the point. It's meant to be used as a self-hosted, shared image-tagging service for personal images. Everything's open source, so you don't have to worry about your data falling into the wrong hands. Should someone want to add computer vision to help with automatic tagging, though, I'd be happy to see a pull request!
In the future (I always say this), I want to make it easier to deploy, say, by distributing a binary (built with Zeit's pkg, perhaps). Before you start, you will need a Google Cloud Storage Bucket in which to store images. Their prices are great, but I want to add other storage providers (i.e. S3, Azure, local) at some point (PRs welcome!). You will also need a MongoDB instance.
For now, though, follow these couple of steps:
- Clone the repository
- Set some environment variables
MONGO_URL: full uri of your MongoDB instance with username and passwordGCP_BUCKET_NAME: name of your bucketJWT_SECRET: secret to sign your JSON Web Tokens withGOOGLE_APPLICATION_CREDENTIALS: path to JSON file containing GCP authentication information- Tip: if you're deploying from a public GitHub repository, DO NOT push a json file with the configuration into the repo. It contains very sensitive information. Make another variable called
GOOGLE_CONFIGand set it to the entire contents of the JSON file. Then setGOOGLE_APPLICATION_CREDENTIALSto./config/gcp.json.
- Tip: if you're deploying from a public GitHub repository, DO NOT push a json file with the configuration into the repo. It contains very sensitive information. Make another variable called
- Install the dependencies with
npm i - Build the app with
npm run build - Start the app with
npm start
There's one available that anyone may use! Head to wtag.app/init to set up your server for the first time.
It will ask you for your deployment url, which is the url you go to that returns "Hello, world!" That should give you back your owner access code. When you register for an account with this code, your account will become the owner. Make sure no one knows your deployment URL or access code before you register, or you might lose the ability to make the owner account!