Project

Projects configure Polylith's deployable artifacts.

A project is the result of combining one base with multiple components and libraries.

This project has one library (grey), two components (green) and one base (blue).

The artifacts that are built based on the projects are the end goal of the Polylith architecture, which we deploy in our test, staging and production environments.

Each project lives in a separate directory under the projects directory, where it has a configuration file:

▾ workspace
▾ projects
▾ myproject
deps.edn

The only difference from projects we are already familiar with is that we specify not just one src, test and resources directory, but one per component and base. The configuration file also specifies all libraries needed for the project.

Example projects can be found in the RealWorld example app and in the Polylith Tool.

Some languages, like Clojure, support having more than one src directory out of the box, while other languages may need a plugin, like the build-helper-maven-plugin.

It's almost like magic, because all we have to do is to list all our building blocks used in e.g. a service, and everything will automatically "connect" without the need of dependency injection, annotations or any other "magic"!

This is also why the Polylith architecture can be used without tooling support and still give us most of its benefits.