This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo UPDATE THE VM LIBRARIES ======================================= \ | |
&& sudo apt-get update \ | |
&& echo INSTALL SNAP ================================================= \ | |
&& sudo apt-get install snapd \ | |
&& sudo snap install core; sudo snap refresh core \ | |
&& echo INSTALL GIT ================================================== \ | |
&& sudo apt-get -y install git-all \ | |
&& echo INSTALL DOCKER =============================================== \ | |
&& curl -fsSL https://get.docker.com -o get-docker.sh \ | |
&& sudo sh get-docker.sh \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
web: | |
image: utility-ussd-api | |
build: ./ | |
container_name: utility-ussd-api | |
ports: | |
- "7500:7500" | |
stdin_open: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos | |
#Install Java | |
RUN yum update -y && yum upgrade -y && yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel | |
ENV JAVA_HOME /etc/alternatives/jre | |
#Install SBT | |
RUN curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo && mv bintray-sbt-rpm.repo /etc/yum.repos.d && yum install -y sbt | |
WORKDIR /utility-ussd | |
ADD . /utility-ussd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.routes | |
import akka.http.scaladsl.model._ | |
import akka.http.scaladsl.server.Directives._ | |
import net.liftweb.json._ | |
import scala.util.{Failure, Success} | |
trait Routes extends LazyLogging with CORSHandler { | |
implicit val formats: DefaultFormats = DefaultFormats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.api | |
object RestAPI{ | |
// 1. STORE MENU | |
def storeMenu(languageMenu:LanguageMenu):Future[MenuUpdate]={ | |
val languageMenuActor = actorSystem.actorOf(LanguageMenuProtocol.props(languageMenu.language)) | |
(languageMenuActor ? languageMenu).mapTo[MenuUpdate] | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.models.africastalking.ussd | |
import akka.actor._ | |
import com.janikibichi.models.africastalking.ussd.USSDFSMProtocol._ | |
import scala.concurrent.Await | |
import scala.concurrent.duration.DurationInt | |
object USSDFSMProtocol { | |
def props(sessionId: String): Props = Props(new USSDFSMActor(sessionId: String)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.firstore | |
object LanguageStoreProtocol{ | |
def props(randomId:String):Props = Props(new LanguageStoreActor(randomId:String)) | |
// WE CAN ONLY USE THIS ACTOR TO STORE NEW MENUS, TO FETCH WE EITHER FETCH MENU CONTENT OR MENU OPTIONS FROM RESPECTIVE ACTORS | |
final case class LanguageStore(language: String, menucontent: List[MenuContent],menuoptions: List[MenuOptions]) | |
final case class StoreMenus(languageMenu: LanguageMenu) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.routes.marshalling | |
import akka.http.scaladsl.marshallers.sprayjson._ | |
import spray.json._ | |
object WebJSONSupport extends DefaultJsonProtocol with SprayJsonSupport { | |
implicit val MenuOptionFormat: RootJsonFormat[MenuOption] = jsonFormat8(MenuOption.apply) | |
implicit val MenuContentFormat: RootJsonFormat[MenuContent] = jsonFormat4(MenuContent.apply) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.janikibichi.routes | |
import akka.http.scaladsl.model._ | |
import akka.http.scaladsl.server.Directives._ | |
import net.liftweb.json._ | |
import scala.util.{Failure, Success} | |
trait Routes extends LazyLogging with CORSHandler { | |
implicit val formats: DefaultFormats = DefaultFormats |