Specifically, what you’re looking for is an architecture document. Once you have every layer of the software properly documented, you can always refer back to it when you feel like you are getting lost in development.
If you start developing any piece of software before making an architecture document, there is a high probability you wouldn’t know when the product is done, and how other components (both internal and external) relate to each other.