Free agency hadn’t even officially started Sunday and the Nets had already shaken the NBA by landing two of its biggest targets: Kevin Durant and Kyrie Irving.

And Brooklyn’s night just kept getting better, adding more pieces and losing none of what now looks like a stellar roster.

How does it fit under the cap?

On top of signing close friends Durant and Irving on max deals, the Nets squeezed DeAndre Jordan (four years, $40 million) and Garrett Temple (two years, $10 million) under the cap. GM Sean Marks, the architect of Brooklyn’s rebuild, used some financial gymnastics.

Nets point guard Spencer Dinwiddie recruited Irving, and he in turn recruited Durant, who was already close with Caris LeVert, Taurean Prince and assistant Adam Harrington. The personal relationships made it all work.

When Durant and Irving agreed to take less money – converting 15% of their first-year salaries into bonuses – that opened up space for Jordan to come along. Temple signed outside the cap using the room exception.

How does it fit on the court?

Durant will be out for most, if not all, of next season with a ruptured Achilles. That leaves Irving and LeVert as sure starters, and presumably Joe Harris on the wing. The frontcourt is up for debate.

Jarrett Allen started in the middle last season, and Jordan found himself on the Knicks’ bench in favor of developing rookie Mitchell Robinson. But with Brooklyn’s bar now raised, it has to be more about production than development. The battle between the rising star and the former All-Star should be fun.

In Durant’s absence, the Nets have a hole at power forward. The Nets cycled through five different starters, with lanky Latvian Rodions Kurucs as the only holdover. But with the way the NBA is moving, Prince could fill stretch-four minutes as well; and they drafted Nic Claxton with the 31st overall pick.

How does it fit in the locker room?

Brooklyn overachieved through great chemistry last season. This was a roster upgrade, but is it also roster upheaval?

They’ve lost D’Angelo Russell, as well as good vets like DeMarre Carroll, Ed Davis and possibly Jared Dudley. And they’ve brought in the enigmatic Irving, whose tenure in Boston went sideways as the bickering Celtics crashed out of the playoffs.

Irving, Durant and Jordan are longtime pals, with Durant also close with Prince and Harrington. The hope is that they can build on pre-existing chemistry and keep things running smoothly.

Bidding adieu to D’Angelo.

Russell arrived as an immature kid who didn’t know how to be a professional. Get him alone in an introspective moment and he’ll admit as much. But the guard bought into everything the Nets asked of him, worked hard on his body and blossomed into an All-Star.

The fanbase was split on seeing him leave, but the Nets worked with him on a sign-and-trade to get him to the best landing spot possible. Golden State – who’ve made the last five NBA Finals, winning three – fit the bill, letting him go to a contender and still ink the max deal the Post had reported he was intent on getting.