Skip to main content

Updated for Fall 2026

CoffeeMaker Architecture

Software architecture is the “structure or structures of the system, which comprise software components, the external visible properties of those components and the relationships among them.” [BCK03] Architectures show a high-level overview of a complex software system and the components that make up the system. There are several architecture archetypes; CoffeeMaker is an example of a layered architecture.

Design, specifically, low-level design (LLD) represents the object-level view of a system. Viewing the entire LLD of a system, even one as small as CoffeeMaker, is difficult. Instead, we model the LLD of each layer, or a slice of functionality through the layers. You will do exactly that in the Backend Design Workshop, where you model the arbitrary-ingredient functionality as a class diagram and a sequence diagram.

The Two Applications

CoffeeMaker is a full-stack web application made of two projects that run side by side:

  • coffee_maker — the Spring Boot backend, which owns the business logic and the database. It serves a REST API on http://localhost:8080.
  • coffee_maker_frontend — the React frontend, built with Vite. It serves the user interface on http://localhost:3000 and calls the backend’s REST API.

The boundary between them is the REST API. That boundary is what makes it possible to design, implement, and test the two halves separately — and it is why the backend and frontend get their own milestones.

Backend Layers

The backend is implemented using the Spring Framework (frameworks are large sets of libraries created to simplify common development tasks). The standard Spring architecture consists of three layers that roughly correspond to the following CoffeeMaker packages.

  • Repository Layer: interfaces to the repository or data store and implementations of those interfaces.
    • edu.ncsu.csc326.coffee_maker.entity — persistent entities, annotated @Entity
    • edu.ncsu.csc326.coffee_maker.repository — interfaces extending JpaRepository
  • Service Layer: business logic that includes application services and infrastructure services.
    • edu.ncsu.csc326.coffee_maker.services — service interfaces defining key behaviors
    • edu.ncsu.csc326.coffee_maker.services.impl — the implementations of those interfaces
  • Web Layer: functionality, including controllers and exception handlers, that exposes the REST API.
    • edu.ncsu.csc326.coffee_maker.controller — the API endpoints

Three more packages support those layers:

  • edu.ncsu.csc326.coffee_maker.dto — Data Transfer Objects, the shapes the API sends and receives
  • edu.ncsu.csc326.coffee_maker.mapper — translates between entities and DTOs
  • edu.ncsu.csc326.coffee_maker.exception — custom exceptions

DTOs and mappers matter more than they first appear: they are what keeps the database representation of an object separate from the representation the API exposes, so the two can change independently. You will design both when you extend the system in Milestone 2.



Figure: Spring Web Application Architecture (from Understanding Spring Web Application Architecture (https://www.petrikainulainen.net/software-development/design/understanding-spring-web-application-architecture-the-classic-way/)


References

  • [BCK03] Len Bass, Paul Clements, Rick Kazman, Software Architecture in Practice, Addison Wesley, 2nd edition, 2003.