Skip to content

Commit

Permalink
Finishing the documentation: how to, motivation, etc. (#74)
Browse files Browse the repository at this point in the history
* Refactor of the code to follow the diamond architecture guidelines.

Creation of the API layer.
Simplification of logic.
Execution of datagenerator and flink in 05-main and spark in 04-processor-spark using sbt.
Update of aliases.sbt

* Cleaning of overloaded dependencies from the three in build.sbt

* Changing module names in build.sbt to help reading the tree visually.

* WIP.

Updating documentation

* Change the -c- in data generator to -u-

* Delete runSpark.sh and finish the HowTo

* Try new anchor for going back to the index

* Update all the "go back to index" so they work on GitHub page.
remove the go to index under the tittle:
- "Run with Docker"
- "Data Generator image"

* Remove all the "Go back to Index for levels h4 and h5"

* Remove three files that are not needed anymore

* Fix style
  • Loading branch information
dagmendez authored Aug 25, 2023
1 parent 4dfc397 commit f9843e0
Show file tree
Hide file tree
Showing 89 changed files with 773 additions and 657 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.app
package com.fortyseven.domain.codecs.app

import cats.implicits.*

import com.fortyseven.core.codecs.ids.IdsCodecs.given
import com.fortyseven.core.codecs.types.TypesCodecs.given
import com.fortyseven.coreheaders.model.app.model.*
import com.fortyseven.domain.codecs.ids.IdsCodecs.given
import com.fortyseven.domain.codecs.types.TypesCodecs.given
import com.fortyseven.domain.model.app.model.*
import vulcan.Codec

/**
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.coreheaders.model.app.model]].
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.domain.model.app.model]].
*/
object AppCodecs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.ids
package com.fortyseven.domain.codecs.ids

import com.fortyseven.coreheaders.model.types.ids.{BicycleId, TripId, UserId}
import com.fortyseven.domain.model.types.ids.{BicycleId, TripId, UserId}
import vulcan.Codec

/**
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.coreheaders.model.types.ids]].
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.domain.model.types.ids]].
*/
object IdsCodecs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.iot
package com.fortyseven.domain.codecs.iot

import scala.concurrent.duration.*

import cats.implicits.*

import com.fortyseven.core.codecs.types.TypesCodecs.given
import com.fortyseven.coreheaders.model.iot.model.*
import com.fortyseven.domain.codecs.types.TypesCodecs.given
import com.fortyseven.domain.model.iot.model.*
import vulcan.Codec

/**
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.coreheaders.model.iot.model]].
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.domain.model.iot.model]].
*/
object IotCodecs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.iot
package com.fortyseven.domain.codecs.iot

import com.fortyseven.coreheaders.model.iot.errors.OutOfBoundsError
import com.fortyseven.domain.model.iot.errors.OutOfBoundsError
import vulcan.Codec

/**
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.coreheaders.model.iot.errors]].
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.domain.model.iot.errors]].
*/
object IotErrorCodecs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.types
package com.fortyseven.domain.codecs.types

import cats.implicits.*

import com.fortyseven.coreheaders.model.types.refinedTypes.*
import com.fortyseven.domain.model.types.refinedTypes.*
import vulcan.{AvroError, Codec}

/**
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.coreheaders.model.types.refinedTypes]].
* It contains the Vulcan codecs for the types (enums, case classes...) defined in the object [[com.fortyseven.domain.model.types.refinedTypes]].
*/
object TypesCodecs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.app
package com.fortyseven.domain.model.app

import com.fortyseven.coreheaders.model.types.ids.{BicycleId, TripId, UserId}
import com.fortyseven.coreheaders.model.types.refinedTypes.{Meters, Speed}
import com.fortyseven.domain.model.types.ids.{BicycleId, TripId, UserId}
import com.fortyseven.domain.model.types.refinedTypes.{Meters, Speed}

/**
* Contains case classes that represent aggregated data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.iot
package com.fortyseven.domain.model.iot

import scala.util.control.NoStackTrace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.iot
package com.fortyseven.domain.model.iot

import scala.concurrent.duration.FiniteDuration

import com.fortyseven.coreheaders.model.types.refinedTypes.*
import com.fortyseven.domain.model.types.refinedTypes.*

/**
* Contains case classes that represent atomic information captured by sensors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.types
package com.fortyseven.domain.model.types

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.types
package com.fortyseven.domain.model.types

import scala.compiletime.{error, requireConst}

import com.fortyseven.coreheaders.model.iot.errors.*
import com.fortyseven.domain.model.iot.errors.*

/**
* Contains the types of the business logic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

package com.fortyseven.core
package com.fortyseven.domain

import java.util.UUID
import scala.concurrent.duration.FiniteDuration

import com.fortyseven.coreheaders.model.app.model.*
import com.fortyseven.coreheaders.model.iot.model.*
import com.fortyseven.coreheaders.model.types.ids.*
import com.fortyseven.coreheaders.model.types.refinedTypes.*
import com.fortyseven.domain.model.app.model.*
import com.fortyseven.domain.model.iot.model.*
import com.fortyseven.domain.model.types.ids.*
import com.fortyseven.domain.model.types.refinedTypes.*
import org.scalacheck.{Arbitrary, Gen}
import vulcan.{AvroError, Codec}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.app
package com.fortyseven.domain.codecs.app

import com.fortyseven.core.TestUtils.codeAndDecode
import com.fortyseven.core.TestUtils.given
import com.fortyseven.core.codecs.app.AppCodecs.given
import com.fortyseven.coreheaders.model.app.model.*
import com.fortyseven.domain.TestUtils.codeAndDecode
import com.fortyseven.domain.TestUtils.given
import com.fortyseven.domain.codecs.app.AppCodecs.given
import com.fortyseven.domain.model.app.model.*
import munit.ScalaCheckSuite
import org.scalacheck.Prop.forAll

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.ids
package com.fortyseven.domain.codecs.ids

import scala.reflect.{ClassTag, classTag}

import com.fortyseven.core.TestUtils.codeAndDecode
import com.fortyseven.core.TestUtils.given
import com.fortyseven.core.codecs.ids.IdsCodecs.given
import com.fortyseven.coreheaders.model.types.ids.{BicycleId, TripId, UserId}
import com.fortyseven.domain.TestUtils.codeAndDecode
import com.fortyseven.domain.TestUtils.given
import com.fortyseven.domain.codecs.ids.IdsCodecs.given
import com.fortyseven.domain.model.types.ids.{BicycleId, TripId, UserId}
import munit.ScalaCheckSuite
import org.scalacheck.Arbitrary
import org.scalacheck.Prop.forAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.iot
package com.fortyseven.domain.codecs.iot

import scala.concurrent.duration.*

import com.fortyseven.core.TestUtils.codeAndDecode
import com.fortyseven.core.TestUtils.given
import com.fortyseven.core.codecs.iot.IotCodecs.given
import com.fortyseven.coreheaders.model.iot.model.*
import com.fortyseven.domain.TestUtils.codeAndDecode
import com.fortyseven.domain.TestUtils.given
import com.fortyseven.domain.codecs.iot.IotCodecs.given
import com.fortyseven.domain.model.iot.model.*
import munit.ScalaCheckSuite
import org.scalacheck.Prop.forAll

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.iot
package com.fortyseven.domain.codecs.iot

import scala.reflect.{ClassTag, classTag}

import com.fortyseven.core.TestUtils.codeAndDecode
import com.fortyseven.core.codecs.iot.IotErrorCodecs.given
import com.fortyseven.coreheaders.model.iot.errors.OutOfBoundsError
import com.fortyseven.domain.TestUtils.codeAndDecode
import com.fortyseven.domain.codecs.iot.IotErrorCodecs.given
import com.fortyseven.domain.model.iot.errors.OutOfBoundsError
import munit.ScalaCheckSuite
import org.scalacheck.Prop.forAll
import org.scalacheck.{Arbitrary, Gen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package com.fortyseven.core.codecs.types
package com.fortyseven.domain.codecs.types

import scala.reflect.{ClassTag, classTag}

import com.fortyseven.core.TestUtils.codeAndDecode
import com.fortyseven.core.TestUtils.given
import com.fortyseven.core.codecs.types.TypesCodecs.given
import com.fortyseven.coreheaders.model.types.refinedTypes.*
import com.fortyseven.domain.TestUtils.codeAndDecode
import com.fortyseven.domain.TestUtils.given
import com.fortyseven.domain.codecs.types.TypesCodecs.given
import com.fortyseven.domain.model.types.refinedTypes.*
import munit.ScalaCheckSuite
import org.scalacheck.Arbitrary
import org.scalacheck.Prop.forAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.types
package com.fortyseven.domain.model.types

import java.util.UUID

import com.fortyseven.coreheaders.model.types.ids.{BicycleId, TripId, UserId}
import com.fortyseven.domain.model.types.ids.{BicycleId, TripId, UserId}
import munit.ScalaCheckSuite
import org.scalacheck.Prop.forAll
import org.scalacheck.{Arbitrary, Gen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.model.types
package com.fortyseven.domain.model.types

import com.fortyseven.coreheaders.model.types.refinedTypes.*
import com.fortyseven.domain.model.types.refinedTypes.*
import munit.ScalaCheckSuite
import org.scalacheck
import org.scalacheck.Gen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders
package com.fortyseven.common.api

/**
* The classes that extend this trait will make available the configuration of type [Configuration] inside a wrapper of type [Effect].
Expand All @@ -26,11 +26,11 @@ package com.fortyseven.coreheaders
* @tparam Configuration
* This is the type of the configuration that wants to be loaded.
*/
trait ConfigurationHeader[Effect[_], Configuration]:
trait ConfigurationAPI[Effect[_], Configuration]:
/**
* @return
* An instance of the the class [Configuration] wrapped into an effect of type [Effect]. The return type of the method is mappable or flatMappable
* since it is wrapped into an effect. Thus, you can use it in a for-comprehension. If the value of the configuration fails to be loaded, the
* effect will handle the error gracefully.
*/
def loadConfiguration(): Effect[Configuration]
def load(): Effect[Configuration]
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
* limitations under the License.
*/

package com.fortyseven.processor.spark
package com.fortyseven.common.api

object SparkMain:
trait DataGeneratorAPI[F[_], Configuration]:

@main def run(): Unit =
val processor = new DataProcessor
processor.process()
def generate(configuration: ConfigurationAPI[F, Configuration]): F[Unit]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders.configuration
package com.fortyseven.domain.configuration

import scala.compiletime.requireConst
import scala.concurrent.duration.FiniteDuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* limitations under the License.
*/

package com.fortyseven.coreheaders
package com.fortyseven.input.api

trait KafkaConsumerHeader[F[_], Configuration]:
import com.fortyseven.common.api.ConfigurationAPI

def consume(config: ConfigurationHeader[F, Configuration]): F[Unit]
trait KafkaConsumerAPI[F[_], Configuration]:

def consume(config: ConfigurationAPI[F, Configuration]): F[Unit]

This file was deleted.

Loading

0 comments on commit f9843e0

Please sign in to comment.