How can I build a temporary support for rafters?
If you have space and there's any structure left near the ends, the easiest way is to not replace the existing rafters and joists, but to sister a second board on the side of each. Attaching the two with bolts every foot or two (50 cm). Use several bolts at the ends of the wider lumber (7x2).

If you don't have the space or the existing structure has rotted to the point that it won't hold a bolt, then a temporary support is very similar to the existing structure, built as close as possible to location you're working on. If there is a load bearing joint above your structure (unlikely for where you're working, this is typically seen with a load bearing wall and two joists meeting over top of the wall), you would build support for each side of the joint. If the existing structure has sagged, you'll want to jack it back up before installing your new support.

Note that when it comes to engineered joists and rafters, they are frequently designed with precisely engineered joints and webbing to carry the load. If you cannot match exactly what was done before, then I would recommend getting a professional, or at least the advice of an engineer.