Pillars

Build your backend service in Scala 3 the easy way

        
import ... // import your dependencies

object app extends pillars.EntryPoint:
  def app: pillars.App[IO] = new: // define your app
    def infos: AppInfo = BuildInfo.toAppInfo // automatic description from your build

    def run: Run[IO, IO[Unit]] = // enjoy!
      for
        _ <- Logger[IO].info(s"📚 Welcome to ${Config[IO].name}!")
        _ <- DBMigration[IO].migrate("db/migrations")
        _ <- flag"feature-1".whenEnabled:
              DB[IO].use: session =>
                for
                  date <- session.unique(sql"select now()".query(timestamptz))
                  _    <- Logger[IO].info(s"The current date is $date.")
                yield ()
        _ <- HttpClient[IO].get("https://pillars.dev"): response =>
              Logger[IO].info(s"Response: ${response.status}")
        _ <- ApiServer[IO].start(endpoints.all)
      yield ()
      end for
    end run
end app
        
    

Installation

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