Skip to content

🧱 Modular Scala 3 app using sbt β€” showcases how to structure multi-module projects with a reusable library and an executable app, as part of the DIBS course.

License

Notifications You must be signed in to change notification settings

r8vnhill/echo-app-sbt

Repository files navigation

echo-app-sbt

A modular Scala 3 application built with sbt, developed as part of the DIBS course (DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software).

This project demonstrates the evolution of a basic Scala console application into a multi-module architecture, separating a reusable library (lib) from the main executable application (app). It's ideal for exploring best practices in modularization, dependency management, and scalable project structure with sbt.

πŸ—£ Although the course materials are in Spanish, this repository and its code are written in English to make the project more accessible to a wider audience.

πŸ“š About the Lessons

This repository supports two lessons from the DIBS course:

  • Learn how to install and use sbt
  • Generate a basic Scala 3 project using the official Giter8 template
  • Understand the standard src/main and src/test directory structure
  • Run a small console app using Scala 3's @main annotation
  • Convert the basic project into a multi-module layout
  • Define lib and app subprojects in build.sbt
  • Share settings across modules with commonSettings
  • Call a function defined in the library from the main application

πŸš€ Running the Application

From the root of the project, you can run the main module with:

sbt "app/run Alex Dim Nah Dim"

Expected output:

Alex
Dim
Nah
Dim

πŸ“ Project Structure

echo-app-sbt/
β”œβ”€β”€ build.sbt               # Defines common settings and declares modules
β”œβ”€β”€ project/
β”‚   └── build.properties    # sbt version
β”œβ”€β”€ lib/                    # Reusable library module
β”‚   └── src/
β”‚       └── main/
β”‚           └── scala/
β”‚               └── cl/ravenhill/echo/echoMessage.scala
β”œβ”€β”€ app/                    # Application module
β”‚   └── src/
β”‚       └── main/
β”‚           └── scala/
β”‚               └── cl/ravenhill/echo/app.scala
└── README.md

πŸ› οΈ Requirements

  • Scala 3.x
  • sbt 1.10+
  • Java 17 or later (tested with Java 23)

πŸŽ“ Part of the DIBS Course

This repository is part of the official examples used in the DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software (DIBS) course.
To explore more lessons and materials, visit dibs.pages.dev.

About

🧱 Modular Scala 3 app using sbt β€” showcases how to structure multi-module projects with a reusable library and an executable app, as part of the DIBS course.

Topics

Resources

License

Stars

Watchers

Forks