Back-end API for Consolia (https://consolia-comic.com/)
Go Scala Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Godeps
controllers
migrations
models
schemas
stresstests
utils
web
.gitignore
Dockerfile
Makefile
consolia-api
main.go
main_test.go
readme.md

readme.md

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:

It is unit tested and can validate API output against the JSON schemas.

Getting Started

  1. The API uses environment variables to inject environment-specific stuff. Just add these environment variables to your ~/.profile:
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
  1. Provision the DB. Run the migrations:
$ make migrate_up
  1. The tool uses godep to manage the dependencies. Install it:
$ go get github.com/tools/godep
  1. Build the API:
$ make build
  1. Test:
$ make test
  1. Run:
$ make run

Features

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