Building a pergola is not that difficult. I built one myself, starting from digging the foundation posts. You need to align the posts correctly while keeping them up with temporary braces. Once they are straight and aligned, you connect the top of the posts with the main beams and then the cross beams (or joists). Then you can fill back the foundation holes.
If you build your pergola on a pre existing patio, then you do not need to worry about foundation holes. Instead, you secure the posts with metal braces to the bottom and cross braces at the top between posts and beams in order to increase structural stability.
For durability I suggest to paint your pergola with a resin based wood stain to protect it from UVA, rain, rot and termites. Cedar, western red cedar, treated pine or fir are also naturally weather and termite resistant.