Dropwizard REST API service that handles Teams, Checkins, Users, API Tokens, and authenticating against Facebook.
This is a maven project with three submodules: jailbreak-api
, jailbreak-client
and jailbreak-service
.
This module contains the Java representations of domain objects and error messages that the API exposes. This means if you are building a Java client against this API you can just maven install this sub modules to have all the required Java objects ready to go.
This module uses google-protobuf to for objects. Inside the root of this-submodule is a bash script compile-proto.sh
that recompiles the source src/main/resources/representations.proto
to src/main/java/org/.../api/representations/Represenations.java
.
This is where we store clients that call other services. It currently contains the simple java client that calls the Facebook /me
API endpoint.
This is the main core of this project. This sub-module depends on the other two submodules of this project: jailbreak-api
and jailbreak-client
. This is where the dropwizard service lives.
It has a simple pattern of objects: resources, that respond to requests from the user; managers, that handle building and managing domain objects (may call the database code, or an external service or merge information together etc); DAO classes that handle making queries to the database; Mappers, which handle mapping SQL results back into objects.
Each manager has both an interface and an implementation, this is because I'm using guice for dependency injection almost exclusively in this project. The main guice file is ServiceModule.java
, where you will find what provides what and how objects are bound.
This project is using Liquidbase to manage the database schema (similar to something like django's South project). The core of this is the src/main/resources/migrations.xml
that holds the steps Liquidbase uses to build the database tables.
The API docs are on apiary. There is also a mock API server setup over there that returns the response examples in the documenation when called. It can be a handy first step when trying to build against this API without setting up all the dependencies.