An open API service indexing awesome lists of open source software.

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.

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/).