Capstone Projects

scala-cli app storing tasks as JSON (upickle + os-lib); commands via mainargs or decline.

Project 1 — CLI todo manager (beginner)

scala-cli app storing tasks as JSON (upickle + os-lib); commands via mainargs or decline. *Concepts: case classes, enums, collections, file I/O, JSON.*

Project 2 — Expression evaluator & REPL (intermediate)

Parser (fastparse or cats-parse) → AST (enum) → evaluator with variables, functions and error reporting via Either. *Concepts: ADTs, pattern matching, recursion, parser combinators.*

enum Expr:
  case Num(n: Double)
  case Var(name: String)
  case BinOp(op: Char, l: Expr, r: Expr)
  case Let(name: String, value: Expr, body: Expr)

def eval(e: Expr, env: Map[String, Double]): Either[String, Double] = e match
  case Expr.Num(n) => Right(n)
  case Expr.Var(x) => env.get(x).toRight(s"unbound variable $x")
  case Expr.Let(x, v, b) => eval(v, env).flatMap(vv => eval(b, env + (x -> vv)))
  case Expr.BinOp(op, l, r) =>
    for
      a <- eval(l, env)
      b <- eval(r, env)
      res <- op match
        case '+' => Right(a + b)
        case '-' => Right(a - b)
        case '*' => Right(a * b)
        case '/' => if b == 0 then Left("division by zero") else Right(a / b)
        case other => Left(s"unknown operator $other")
    yield res

Project 3 — Type-class-based JSON library (intermediate/advanced)

Your own JsonEncoder/JsonDecoder type classes with given instances and derives support via Mirrors. *Concepts: givens, derivation, inline, ADTs.*

Project 4 — REST API with http4s + Doobie (advanced)

CRUD service for a bookstore with Postgres, circe, Flyway migrations, Tapir docs, testcontainers tests, Docker image via sbt-native-packager. *Concepts: Cats Effect, Resource, tagless final, HTTP, SQL.*

Project 5 — Concurrent web crawler (advanced)

fs2 or ZIO Streams crawler with bounded parallelism, per-domain rate limits, deduplication via Ref[Set[Url]], graceful shutdown. *Concepts: streams, fibers, concurrency primitives.*

Project 6 — Spark analytics pipeline (advanced)

Ingest a public dataset (e.g., NYC taxi trips), clean it, compute aggregates, write Parquet, and visualize. *Concepts: Spark DataFrames/Datasets, partitioning, performance.*

Project 7 — Actor-based chat server (advanced)

Pekko Typed + Pekko HTTP WebSockets: rooms as actors, persistence of history, clustering. *Concepts: actors, supervision, streams, WebSockets.*

Project 8 — Full-stack Scala app (expert)

Shared domain models compiled for JVM + JS; backend with ZIO HTTP or http4s, frontend with Laminar; end-to-end type-safe API via Tapir. *Concepts: cross-building, Scala.js, API design.*