Pillars

Build your backend service in Scala 3 the easy way

        
import ... // import your dependencies

object app extends pillars.IOApp(DB, DBMigration, FeatureFlags, HttpClient): //define your apps modules
  def infos: AppInfo = BuildInfo.toAppInfo // automatic description from your build

  def run: Run[IO, IO[Unit]] = // enjoy!
    for
      _ <- logger.info(s"📚 Welcome to ${Config[IO].name}!") // logging is included in pillars-core
      _ <- dbMigration.migrate("classpath:db/migrations")     // you can access directly your modules
      _ <- flag"feature-1".whenEnabled:                       // handy feature flag interpolation
            db.use: session =>
              for
                date <- session.unique(sql"select now()".query(timestamptz))
                _    <- Logger[IO].info(s"The current date is $date.")
              yield ()
      _ <- http.get("https://pillars.dev"): response =>
            logger.info(s"Response: ${response.status}")
      _ <- server.start(homeController, userController)        // start your server with your controllers
    yield ()
    end for
  end run
end app
        
    

Installation

  • sbt
  • mill
  • scala-cli
  • pants
  • Gradle
  • Maven
                libraryDependencies ++= Seq("com.rlemaitre" %% "pillars-core" % "0.4.2")
            
                ivy"com.rlemaitre::pillars-core:0.4.2"
            
                //> using dep com.rlemaitre::pillars-core:0.4.2
            
                
scala_artifact(
    group="com.rlemaitre",
    artifact="pillars-core",
    version="0.4.2",
    packages=["pillars.**"],
)
                
            
                implementation 'com.rlemaitre:pillars-core:0.4.2'
            
                
<dependency>
    <groupId>com.rlemaitre</groupId>
    <artifactId>pillars-core</artifactId>
    <version>0.4.2</version>
</dependency>
                
            

Modularity

It offers a modular structure, allowing developers to use only the components they need, resulting in efficient and streamlined applications.

Observability

Using OpenTelemetry, Pillars includes built-in support for observability, allowing you to monitor and understand the behavior of your application. This can be crucial for identifying and resolving issues quickly.

Performance

Pillars uses Netty for HTTP servers and clients, which is known for its high performance and scalability. This can help to ensure that your application remains responsive under heavy load.

Admin Server

Pillars includes an admin server feature, providing a separate interface for administrative tasks. This can help to keep your main application server focused on serving user requests.

Database Access

Pillars provides a streamlined interface for interacting with databases. This can help to reduce the complexity of your codebase and make it easier to manage data operations.

Feature Flags

Pillars supports feature flags, allowing you to toggle features on and off without needing to redeploy your application. This can be particularly useful for testing new features or managing rollouts.

Read our documentation for how to use Pillars

Documentation