Giter Site home page Giter Site logo

chatty's Introduction

Chatty

build MIT

A chat demo that evaluates several technologies (and hopefully shows best practices)

Used Technologies

Requirements

  • Java 8 JDK (or later) installed

  • JavaScript tooling like Node.js, Grunt CLI, Bower and TSD (TypeScript Definition Manager) doesn’t have to be installed manually, it will be installed automatically (and project local) during the Gradle build.

Getting Started

  • ./gradlew build (builds all, both Java and TypeScript)

  • ./gradlew bootrun (starts a server using port 8080)

  • Open http://localhost:8080 in a web browser

  • Open http://localhost:8080 in another web browser

  • Play around with Chatty!

Screenshot

Screenshot

Hypermedia API

Here is an example what you get at http://localhost:8080/api/users. I am using HAL (Hypertext Application Language). The returned mime type is application/hal+json. To get a pretty print in Chrome, please install the Chrome extensions JSONView and application/…+json|+xml as inline.

{
  "_embedded" : {
    "chatty:users" : [ {
      "fullName" : "Jane Doe",
      "email" : "[email protected]",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/users/doe_ja"
        },
        "chatty:user" : {
          "href" : "http://localhost:8080/api/users/doe_ja{?projection}",
          "templated" : true
        },
        "chatty:messages" : {
          "href" : "http://localhost:8080/api/users/doe_ja/messages"
        }
      }
    } ]
  }
}

Spring Boot

To run the Spring-Boot based server, invoke gradlew bootrun

Then you can use http://localhost:8080/api as entry point for exploring the HAL based API.

{
  "_links": {
    "chatty:users": {
      "href": "http://localhost:8080/api/users{?page,size,sort,projection}",
      "templated": true
    },
    "chatty:messages": {
      "href": "http://localhost:8080/api/messages{?page,size,sort,projection}",
      "templated": true
    },
    "chatty:buildinfo": {
      "href": "http://localhost:8080/api/buildinfo"
    },
    "profile": {
      "href": "http://localhost:8080/api/profile"
    },
    "curies": [
      {
        "href": "http://localhost:8080/api/../docs/{rel}.html",
        "name": "chatty",
        "templated": true
      }
    ]
  }
}

HAL Explorer Integration

You can build and integrate the HAL Explorer. Then you have to invoke

  • ./gradlew build cloneHalBrowser

  • ./gradlew -p subprojects/hal-browser build

Live Demo

Currently, the Spring Boot based server is deployed to Heroku. You can try out a live demo of chatty at

The demos include a HAL browser for browsing Chatty’s RESTful hypermedia API, as well as documentation of the REST API created with Spring Restdocs. But please be aware that this is only a test installment and will be reset periodically.

Docker Integration

You find installation instructions at Docker. When you use Windows or MAC, install Docker Toolbox. To prepare the docker image creation you have to run 'gradlew build createDockerfile distTar'. Under Windows and MAC you want to create a VM with docker-machine and connect to it. Then you can create the images and start up a container for the Spring Boot based service (running on port 8080) by invoking: docker-compose up

Pebble Client

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.