https://github.com/r8vnhill/echo-app-sbt
π§± 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.
https://github.com/r8vnhill/echo-app-sbt
build-tool console-app dibs-course educational giter8 hello-world modular-architecture multi-module sbt scala scala3 software-library starter-template
Last synced: about 1 year ago
JSON representation
π§± 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.
- Host: GitHub
- URL: https://github.com/r8vnhill/echo-app-sbt
- Owner: r8vnhill
- License: bsd-2-clause
- Created: 2025-04-02T22:05:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T21:14:13.000Z (about 1 year ago)
- Last Synced: 2025-04-05T22:20:15.360Z (about 1 year ago)
- Topics: build-tool, console-app, dibs-course, educational, giter8, hello-world, modular-architecture, multi-module, sbt, scala, scala3, software-library, starter-template
- Language: Scala
- Homepage: https://dibs.pages.dev
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# echo-app-sbt
A modular Scala 3 application built with **sbt**, developed as part of the [DIBS](https://dibs.pages.dev/) 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:
### β
[Creating a Basic Project with sbt](https://dibs.pages.dev/docs/build-systems/init/sbt/)
- 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
### π§± [Structuring Multi-Module Projects with sbt](https://dibs.pages.dev/docs/build-systems/modular-design/sbt/)
- 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:
```bash
sbt "app/run Alex Dim Nah Dim"
```
Expected output:
```plaintext
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](https://dibs.pages.dev/).