Consolia API in Go w/ MySQL
Back-office API for Consolia, a webcomic. Back-office, as in only used by the admin panel and not by the website itself.
It's a simple REST API written in Go, backed by MySQL. It primarily uses:
- Negroni - HTTP middleware
- Gorm - ORM library
- Osin - Oauth2 server library
- Migrate - DB migrations
- Godep - Dependency manager
It is unit tested and can validate API output against the JSON schemas.
- The API uses environment variables to inject environment-specific stuff. Just add these environment variables to your
export consolia_db_host=127.0.0.1 export consolia_db_port=3306 export consolia_db_name=consolia export consolia_db_username=consolia export consolia_db_password=supersecretyouwillneverguessthishahaha export consolia_port=3000 export consolia_env=dev
- Provision the DB. Run the migrations:
$ make migrate_up
- The tool uses
godepto manage the dependencies. Install it:
$ go get github.com/tools/godep
- Build the API:
$ make build
$ make test
$ make run
Features of this API:
- Administer comics (basic CRUD)
- Notify on any updates in social media platforms, e.g. new upvotes in reddit, more likes on facebook.
- All-time social media scoreboard - the most popular comics on the most popular platforms
- Expose awesome statistics, like how long it's been running, how many square pixels have been drawn, etc.
- Notifications - put the comics through a validator, and expose any quirks the comics have.
The internal processes that update the database are not in this repo, processes like:
- Publishing comics on a set date
- Tracking likes/upvotes on social media platforms (supporting reddit, 9gag, cheezburger, tumblr, twitter, facebook)
- Tracking Google Analytics data