The TTN connection is LoRaWAN connection which is same with other LoRa Server connection actually.
This section is impleted in the LoRaWAN stack which is a part of RUI core, so you can’t find the source code of this section in the Product Practices. But there are many RUI APIs used for LoRAWAN connection, you can know how to use these RUI APIs to cofigure and connect LoRaWAN like TTN by looking the RAK5205’s practice source code:GitHub