-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05819d4
commit eb00fe0
Showing
17 changed files
with
262 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Build Storm Shadow | ||
on: | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: read | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '19' | ||
distribution: 'graal' | ||
cache: 'sbt' | ||
- name: Run tests | ||
run: sbt test | ||
- name: Upload dependency graph | ||
uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
version = "3.7.3" | ||
runner.dialect = scala213 | ||
fileOverride { | ||
"glob:**/shadow/src/main/scala/**" { | ||
runner.dialect = scala3 | ||
} | ||
} | ||
version = 3.7.3 | ||
maxColumn = 120 | ||
|
||
align.preset = more | ||
align.multiline = true | ||
align.stripMargin = true | ||
|
||
continuationIndent.defnSite = 2 | ||
assumeStandardLibraryStripMargin = true | ||
danglingParentheses.preset = true | ||
docstrings = JavaDoc | ||
lineEndings = preserve | ||
includeCurlyBraceInSelectChains = false | ||
spaces.inImportCurlyBraces = false | ||
optIn.annotationNewlines = true | ||
|
||
rewrite.rules = [Imports, RedundantBraces, SortModifiers] | ||
rewrite.imports.sort = original | ||
|
||
docstrings.wrap = yes | ||
docstrings.style = Asterisk | ||
|
||
newlines.afterInfix = keep | ||
rewrite.rules = [RedundantParens] | ||
trailingCommas = "always" | ||
runner.dialect = Scala213Source3 | ||
docstrings.wrapMaxColumn = 80 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
# reactive-app-modernization-with-scala | ||
# reactive-app-modernization-with-scala | ||
|
||
## Project: Storm Shadow | ||
|
||
The business people have just decided, without talking to tech at all 🤮, that they want to ship their product in the | ||
next | ||
10 hours - we only have 2 tech guys around, and we don't want to get fired, so we need to get this done real quick. We | ||
will deliver this with [Nothing But Logic](https://www.kalix.io/) and remove all complexities of the back end by | ||
inferring all infrastructure needs from our code. | ||
|
||
Remember - We have to focus solely on the business logic of this extremely crude architecture they have provided us | ||
with. | ||
|
||
## Architecture | ||
|
||
```mermaid | ||
graph LR | ||
A[Ingetor] --> B[Processor] --> C[Carrier] | ||
D[Manager] -->|Manage Ingestion Rules| A | ||
D -->|Manage Processing Rules| B | ||
D -->|Manage Delivery Rules| C | ||
U[User] --> D | ||
``` | ||
|
||
> Seminar conducted for the graduating class of 2023[MCA] at Guru Gobind Singh Indraprastha University, New Delhi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,54 @@ | ||
import Dependencies._ | ||
|
||
ThisBuild / scalaVersion := "2.13.10" | ||
ThisBuild / organization := "extremeprogramming" | ||
ThisBuild / version := "1.0.0-M1" | ||
ThisBuild / licenses += ("GPL", url("https://www.gnu.org/licenses/gpl-3.0.en.html")) | ||
ThisBuild / developers += Developer( | ||
"girdharshubham", | ||
"Shubham Girdhar", | ||
"girdharshubham@hotmail.com", | ||
url("https://github.com/girdharshubham"), | ||
) | ||
|
||
lazy val auth = (project in file("auth")) | ||
ThisBuild / javacOptions ++= Seq( | ||
"-source", | ||
"1.19", | ||
"-target", | ||
"1.19", | ||
"-Xlint:unchecked", | ||
"-Xlint:deprecation", | ||
) | ||
|
||
ThisBuild / scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-encoding", | ||
"UTF-8", | ||
"-feature", | ||
"-language:existentials", | ||
"-language:higherKinds", | ||
"-language:implicitConversions", | ||
"-unchecked", | ||
"-Xlint", | ||
"-Ywarn-dead-code", | ||
"-Ywarn-numeric-widen", | ||
"-Ywarn-value-discard", | ||
) | ||
|
||
lazy val rams = (project in file(".")) | ||
.aggregate(manager, ingestor, processor, carrier) | ||
|
||
lazy val manager = (project in file("manager")) | ||
.enablePlugins(KalixPlugin) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"org.scalatest" %% "scalatest" % "3.2.15" % Test | ||
) | ||
libraryDependencies ++= Seq(scalatest), | ||
) | ||
|
||
lazy val ingestor = project in file("ingestor") | ||
// .enablePlugins(KalixPlugin) | ||
|
||
lazy val processor = project in file("processor") | ||
// .enablePlugins(KalixPlugin) | ||
|
||
lazy val carrier = project in file("carrier") | ||
// .enablePlugins(KalixPlugin) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package extremeprogramming.carrier | ||
|
||
object App { | ||
def main(args: Array[String]): Unit = { | ||
println("Carrier Subsystem") | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: 3 |
7 changes: 7 additions & 0 deletions
7
ingestor/src/main/scala/extremeprogramming/ingestor/App.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package extremeprogramming.ingestor | ||
|
||
object App { | ||
def main(args: Array[String]): Unit = { | ||
println("Ingestor Subsystem") | ||
} | ||
} |
This file contains 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
2 changes: 1 addition & 1 deletion
2
auth/src/main/proto/auth/domain/user.proto → ...remeprogramming/manager/domain/user.proto
This file contains 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
This file contains 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
This file contains 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
44 changes: 44 additions & 0 deletions
44
manager/src/test/scala/extremeprogramming/manager/UserEntitySpec.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package extremeprogramming.manager | ||
|
||
import org.scalatest.matchers.should.Matchers | ||
import org.scalatest.wordspec.AnyWordSpec | ||
|
||
class UserEntitySpec | ||
extends AnyWordSpec | ||
with Matchers { | ||
|
||
"UserEntity" must { | ||
|
||
"have example test that can be removed" in { | ||
val _ = UserEntityTestKit(new UserEntity(_)) | ||
pending | ||
// use the testkit to execute a command | ||
// and verify final updated state: | ||
// val result = service.someOperation(SomeRequest) | ||
// verify the reply | ||
// val reply = result.getReply() | ||
// reply shouldBe expectedReply | ||
// verify the final state after the command | ||
// service.currentState() shouldBe expectedState | ||
} | ||
|
||
"handle command Register" in { | ||
val _ = UserEntityTestKit(new UserEntity(_)) | ||
pending | ||
// val result = service.register(extremeprogramming.manager.api.User(...)) | ||
} | ||
|
||
"handle command Login" in { | ||
val _ = UserEntityTestKit(new UserEntity(_)) | ||
pending | ||
// val result = service.login(extremeprogramming.manager.api.LoginRequest(...)) | ||
} | ||
|
||
"handle command Logout" in { | ||
val _ = UserEntityTestKit(new UserEntity(_)) | ||
pending | ||
// val result = service.logout(extremeprogramming.manager.api.LogoutRequest(...)) | ||
} | ||
|
||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
...auth/api/AuthServiceIntegrationSpec.scala → ...ager/api/AuthServiceIntegrationSpec.scala
This file contains 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
14 changes: 6 additions & 8 deletions
14
.../src/test/scala/auth/UserEntitySpec.scala → ...c/test/scala/manager/UserEntitySpec.scala
This file contains 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
44 changes: 44 additions & 0 deletions
44
manager/src/test/scala/manager/api/AuthServiceIntegrationSpec.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package manager.api | ||
|
||
|
||
import extremeprogramming.manager.Main | ||
import kalix.scalasdk.testkit.KalixTestKit | ||
import org.scalatest.BeforeAndAfterAll | ||
import org.scalatest.concurrent.ScalaFutures | ||
import org.scalatest.matchers.should.Matchers | ||
import org.scalatest.time.Millis | ||
import org.scalatest.time.Seconds | ||
import org.scalatest.time.Span | ||
import org.scalatest.wordspec.AnyWordSpec | ||
|
||
// This class was initially generated based on the .proto definition by Kalix tooling. | ||
// | ||
// As long as this file exists it will not be overwritten: you can maintain it yourself, | ||
// or delete it so it is regenerated as needed. | ||
|
||
class AuthServiceIntegrationSpec | ||
extends AnyWordSpec | ||
with Matchers | ||
with BeforeAndAfterAll | ||
with ScalaFutures { | ||
|
||
implicit private val patience: PatienceConfig = | ||
PatienceConfig(Span(5, Seconds), Span(500, Millis)) | ||
|
||
private val testKit = KalixTestKit(Main.createKalix()).start() | ||
|
||
"AuthService" must { | ||
|
||
"have example test that can be removed" in { | ||
pending | ||
// use the gRPC client to send requests to the | ||
// proxy and verify the results | ||
} | ||
|
||
} | ||
|
||
override def afterAll(): Unit = { | ||
testKit.stop() | ||
super.afterAll() | ||
} | ||
} |
Oops, something went wrong.