It’s time to turn our attention toward producing releasable systems that can be deployed. To reach that goal, you need to learn about OTP applications, which let you organize your system into reusable components. Applications are a standard way of building Elixir or Erlang production systems and libraries. Relying on them brings various benefits, such as dependency management; simplified system starting; and the ability to build standalone, deployable releases.
In this chapter, you’ll learn how to create applications and work with dependencies. In the process, you’ll turn your to-do system into a proper OTP application and use some third-party libraries from the Erlang and Elixir ecosystem to expose an HTTP interface for your existing system. There’s a lot of work ahead, so let’s get started with OTP applications.
An OTP application is a component that consists of multiple modules and that can depend on other applications. This makes it possible to start the entire system with a single function call. As you’re about to see, it’s reasonably easy to turn code into an application. Your current version of the to-do system is already an OTP application, but there are some minor details you can improve. You’ll see this in action shortly; first, let’s look at what OTP applications consist of.