Graphique Client

A JVM client for Graphique

License

License

MIT
Categories

Categories

CLI User Interface
GroupId

GroupId

io.github.amrhassan
ArtifactId

ArtifactId

graphique-client
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

jar
Description

Description

Graphique Client
A JVM client for Graphique
Project URL

Project URL

https://github.com/amrhassan/graphique-client-java/
Source Code Management

Source Code Management

https://github.com/amrhassan/graphique

Download graphique-client

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.amrhassan/graphique-client/ -->
<dependency>
    <groupId>io.github.amrhassan</groupId>
    <artifactId>graphique-client</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.amrhassan/graphique-client/
implementation 'io.github.amrhassan:graphique-client:1.2'
// https://jarcasting.com/artifacts/io.github.amrhassan/graphique-client/
implementation ("io.github.amrhassan:graphique-client:1.2")
'io.github.amrhassan:graphique-client:jar:1.2'
<dependency org="io.github.amrhassan" name="graphique-client" rev="1.2">
  <artifact name="graphique-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.amrhassan', module='graphique-client', version='1.2')
)
libraryDependencies += "io.github.amrhassan" % "graphique-client" % "1.2"
[io.github.amrhassan/graphique-client "1.2"]

Dependencies

compile (5)

Group / Artifact Type Version
com.google.guava : guava jar 18.0
commons-io : commons-io jar 2.4
org.apache.commons : commons-lang3 jar 3.3.2
org.apache.httpcomponents : httpclient jar 4.3.6
org.javatuples : javatuples jar 1.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Stories in Ready Build Status

Graphique

An image management microservice built using the awesomeness of Scala, Akka and Spray.

It is built to handle:

  • the low level book keeping of storing the actual image files
  • the generation and caching of image variants in arbitrary sizes and formats
  • generating publicly-servable URLs for the managed images

Graphique stores and hosts its own images over HTTP by default and it can use a different storage and file serving system like AWS S3, if configured to do so. It exposes its functionality through RESTful APIs.

The actual image processing heavy lifting is done by the awesome Thumbnailator.

Dependencies

  • jdk 8
  • sbt 0.13

Spinning it Up

  1. Download the latest release from here.
  2. Execute the *.jar by doing java -jar *.jar
  3. .. or execute from extracted source by doing sbt run
  4. .. or install by doing make install as a privileged user

Example Usage

Submitting an image

[amr@marvin ~]$ http POST http://localhost:8980/images < an_image.jpg 

HTTP/1.1 201 Created
Content-Length: 0
Date: Wed, 24 Dec 2014 14:12:26 GMT
Location: /image/137a07962e49a58b6161ace95bb1b07d.jpg
Server: spray-can/1.3.2

Creating an image variant

[amr@marvin ~]$ http PATCH http://localhost:8980/image/137a07962e49a58b6161ace95bb1b07d.jpg?size-within=120x120

HTTP/1.1 200 OK
Content-Length: 106
Content-Type: application/json; charset=UTF-8
Date: Wed, 24 Dec 2014 14:13:47 GMT
Server: spray-can/1.3.2

{
    "url": "http://localhost:9806/137a07962e49a58b6161ace95bb1b07d-295696c3647869abf69783925c9616d7.jpg"
}

Client Implementations

Configuration

Graphique uses the XDG BaseDirectory specification for looking up configuration files named graphique/application.conf. The configuration files are written in the HOCON syntax. You can override any of the specified config parameters from the internal configuration file.

Backends

Graphique builds its functionality on top primitive operations provided by one of its Backend implementations.

The Local Backend

This backend enables Graphique to store its images on the local filesystem and it spins up an internal http server to serve the requested images.

The AWS S3 Backend

This backend enables Graphique to store its images on an S3 bucket as public files and delegate the image serving to S3.

Versions

Version
1.2
1.1
1.0