Giter VIP home page Giter VIP logo

akka-services's Introduction

Akka Services

Travis CI Status License

Summary

This is a study project for playing with Akka ecosystem:

Project Description

Structure

This project applies extensively the (Thin) Cake Pattern:

// launches a HTTP server
object Main extends App with Services

// initializes the actors system
trait Services extends Config with Routes

// loads configuration parameters (e.g. HTTP interface and port, eventually DB connection settings...)
trait Config

// provides the routes directives (very similar to the ones from Spray)
trait Routes extends ErrorHandler with SysRoute with UserRoute with UrlRoute with StocksRoute

trait ErrorHandler
trait SysRoute extends DefaultJsonProtocol with SprayJsonSupport // system functions
trait UserRoute extends DefaultJsonProtocol with SprayJsonSupport 
trait UrlRoute // simple URL shortener
trait StocksRoute // stocks info

// provide the domain objects, later marshalled / unmarshalled thanks to the JSON Support from Akka HTTP Spray Json  
case class SimpleMessage // used in SysRoute
case class User // used in UserRoute

How to Run

  1. Clone the project: git clone [email protected]:flopezlasanta/akka-services.git
  2. Compile the code, generate a Docker image and publish locally: $ sbt docker:publishLocal
  3. Run the container akka-services together with redis via Docker Compose: $ docker-compose up -d
  4. Test with the different end points (see next section)
  5. Stop the containers via Docker Compose: $ docker-compose stop

How to Test

Note: when using VM / Docker Machine (this is my case) then use its corresponding IP address; otherwise localhost.

  • Check system health: curl -X GET http://192.168.99.100:9000/sys/health | jq .
  • Ping system: curl -X GET http://192.168.99.100:9000/sys/ping | jq .
  • ...

Another options is to: Run in Postman

Also in root there will be simple website (made with Bootstrap 3) listing all endpoints:

akka-services's People

Contributors

frank-lopx avatar

Watchers

 avatar  avatar

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.