Giter Club home page Giter Club logo

reactive-microservices's Introduction

Reactive microservices

Reactive microservices is an Typesafe Activator Template completely devoted to microservices architecture. It lets you learn about microservices in general - different patterns, communication protocols and 'tastes' of microservices. All these concepts are demonstrated using Scala, Akka, Play and other tools from Scala ecosystem. For the sake of clarity, we skipped topics related to deployment and operations.

Prerequisites

To feel comfortable while playing with this template, make sure you know basics of Akka HTTP which is a cornerstone of this project. We recently released an Akka HTTP activator template that may help you start. At least brief knowledge of Akka remoting, Akka persistence, Akka streams and Play Framework websockets is also highly recommended.

Structure

This activator template consists of 9 runnable subprojects — the microservices:

  • auth ones:
    • auth-codecard
    • auth-fb
    • auth-password
    • identity-manager
    • session-manager
    • token-manager
  • business logic ones:
    • btc-users
    • btc-ws
  • miscellaneous ones:
    • metrics-collector

They uses different communication methods, different databases, and different frameworks.

Setup

Review the configuration files

Take some time to review application.conf files that are located in resource subdirectory of each microservice.

Create and configure Postgres databases

The default names of the DBs that need to be created are: auth_codecard, auth_password, and identity_manager. If you want to use non-default names please tweak the application.conf files.

Scripts for quick setup:

createdb auth_codecard -U postgres
createdb auth_password -U postgres
createdb identity_manager -U postgres

Run migrations

For auth-codecard, identity-manager and auth-password you need to run the SQL migration scripts which are located in relevant resources directories. You can also tweak and use this script in your console

cd /where/this/activator/template/is/located/
psql auth_codecard -U postgres -f ./auth-codecard/src/main/resources/init.sql &&
psql auth_password -U postgres -f ./auth-password/src/main/resources/auth_entry.sql &&
psql identity_manager -U postgres -f ./identity-manager/src/main/resources/identity.sql

Running

Before starting anything make sure you have PostgreSQL, MongoDB and Redis up and running.

akka-http

You can run each service separately, but we also we provided a SBT task called runAll.

Play

Due to some issues with Play/sbt cooperation metrics-collector and btc-ws should be run separately. In order to run them in one sbt CLI instance use these commands:

; project btc-ws; run 9000
; project metrics-collector; run 5001

Everything else should work out of the box. Enjoy!

Author & license

If you have any questions regarding this project contact:

Łukasz Sowa [email protected] from Iterators.

For licensing info see LICENSE file in project's root directory.

reactive-microservices's People

Contributors

amichalo-zz avatar jglodek avatar luksow avatar mgosk avatar piotrtrzpil avatar

Watchers

 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.