The Utah Jazz won 51 games, made the playoffs as a No. 5 seed, won three road contests to oust the Los Angeles Clippers in the Western Conference first round before suffering a sweep at the hands of the Golden State Warriors in the second round a season ago.

They were an up-and-coming bunch in May 2017, but a franchise with caveats. Their point guard couldn’t stay healthy, and their best player was a free agent. And even with their best player enjoying an All-Star season, there was no doubt about what he wasn’t: A superstar.

The Utah Jazz are in a better place entering this offseason, which explains why Wednesday afternoon’s locker room clean­out was one of the most jovial ever for a team that lost to Houston in five games in the Western Conference semifinals.

Their story is one that would be turned down by movie directors for being unrealistic. The best player from a season ago — Gordon Hayward — left the franchise in free agency only to be replaced by Donovan Mitchell, a rookie who went on to have one of the best inaugural seasons in recent NBA memory.

He’s the superstar the Jazz lacked in Hayward.

“The kid is incredible,” TNT analyst Shaquille O’Neal said about Mitchell during a recent broadcast. “People know his name. Scary thing is he’s only gonna get better. In the next two or three years, he’ll be talked about as one of the best players in the game.”

As good as Mitchell proved to be, the 2017-18 Jazz went beyond his brilliance. Utah traded for a point guard — Ricky Rubio — who looked washed up in the first half of the season then played the best basketball of his career in the second half. Rudy Gobert boldly proclaimed the Jazz a playoff team, then missed most of the first half of the season due to injury before playing at an All-NBA level after his return. The Jazz received inspired play from veteran Joe Ingles and rookie Royce O’Neale, who was playing overseas last year.

Utah general manager Dennis Lindsey called this a pivotal season and tasked coach Quin Snyder with a roster hastily put together after Hayward’s departure.

Worst case? The Jazz could hit the reset button if the season went awry.

Best case? Maybe an offensively challenged group could ride a top-five defense into one of the last few postseason spots in the Western Conference before getting waxed in the first round.

The season seemed destined for the worst case. The Jazz couldn’t stay healthy. Shooting guard Rodney Hood balked at a sixth-man role and forced his way out of Salt Lake City via a trade to the Cleveland Cavaliers, who returned Jae Crowder. Joe Johnson, the hero in the first round against the Clippers, wanted to play for a contender and got dealt to the Sacramento Kings, eventually ending up with the Houston Rockets. And the Jazz couldn’t make shots on the offensive end and couldn’t stop anyone with Gobert out due to injury.

The Jazz were 19-28 overall and sitting 10th in the Western Conference on Jan. 22. But the turnaround from that point was dramatic as Gobert played like one of the best players in the league and the Jazz finished the season 34-12, including the playoffs.

This offseason promises less anxiety than last summer. Derrick Favors is an unrestricted free agent and Dante Exum is a restricted free agent. But the Jazz have a lot more team control than last summer. The Jazz were trying to keep their core intact a year ago — they are in position to add to it this time around.

The Jazz feature a dynamic roster. They are young in most spots, athletic, unyielding defensively and a resilient group. Most importantly, Mitchell proved to be a star at the highest level. When added up, one can make a solid argument that the Jazz are the third best team in the Western Conference.

“You always feel pressure to build a team that the Millers and the fans can be proud of,” Lindsey said. “What happened last offseason, with a few people leaving, that magnified the pressure. We feel pressure to give Ricky Rubio a good team. He’s fought hard through his career to be in this position. Rudy Gobert was always confident, and we appreciate that. We want to be committed to all of our players, 1 through 17.”

For as well as the Jazz ended the season, they have to make a leap if they want to compete with Houston and Golden State. Even without Rubio, who missed the Houston series with a balky hamstring, losing to the Rockets in five games should send a message that the Jazz aren’t yet where they need to be.

Internal improvement is an avenue to close the gap. One of the reasons the Jazz struggled was their newness as a group, taking half the season to gel on the floor. That learning curve won’t exist next season.

Rubio and Mitchell will enter the season entrenched as the backcourt. Gobert now knows how to catch Rubio’s passes. Most of the rotation spots already are spoken for. Plus Mitchell, Exum, O’Neale and even Rubio and Gobert all are young. Their desire to get better, coupled with Utah’s renowned player development staff, could help the Jazz improve without a roster move.

Counting cap holds, the Jazz could have as much as $17 million in space at the start of free agency. Sources say the Jazz covet another scorer in free agency to take some pressure off Mitchell.

But first, they will have to figure out what to do with Favors. They also have to make team-option decisions on Thabo Sefolosha, Ekpe Udoh and Jonas Jerebko. They also have to decide whether to extend Raul Neto a qualifying offer, which would make him a restricted free agent.

Regardless of what happens this summer, the Jazz are ahead of schedule. A franchise that suffered disaster last July couldn’t be happier with its current position. A franchise that has lacked a high-end superstar since John Stockton and Karl Malone now has one in Mitchell.

The Jazz have a chance to be an elite team because of Mitchell. And perhaps for the first time ever, they will be cool to the masses. Expect the Jazz to be on national television a lot next season. You even may expect them to be a free-agency destination to those who want to win at the highest level.

A lot has changed in 12 months.

THREE GREAT WINS

Utah 114, New Orleans 108 (Dec. 1)

Perhaps one of the first glimpses of what was to come from rookie guard Donovan Mitchell. He scored 41 points, including taking over down the stretch against DeMarcus Cousins and Anthony Davis.

Utah 97, Toronto 93 (Jan. 26)

The win over the Raptors on the toughest home court in the league to get a road victory on, proved key to what would be Utah’s 11-game winning streak to get back into playoff contention. Ricky Rubio hit the big shot in this one, a 3-pointer in the final minute to give the Jazz a lead.

Utah 112, Los Angles Lakers 97 (April 8)

A dominant win clinched a playoff berth for the Jazz behind 28 point from Mitchell, 13 rebounds from Derrick Favors and 10 assists from Joe Ingles. The Jazz qualified for their second consecutive postseason.

THREE BAD LOSSES

Phoenix 97, Utah 88 (Oct. 25)

The Jazz failed to show up and looked terrible. TJ Warren scored 27 points while the guard tandem of Tyler Ulis and Mike James somehow outplayed Ricky Rubio.

Atlanta 104, Utah 90 (Jan. 22)

The mother of all bad losses for the Jazz. The Hawks led for most of the game and polished off the Jazz down the stretch. Utah fell to 19-28 on the season. The draft lottery seemed inevitable.

Oklahoma City 100, Utah 94 (Dec. 5)

The Jazz, playing on a back-to-back, blew a double-digit lead in the fourth quarter at Chesapeake Energy Arena. The loss set off a streak that saw the Jazz lose seven of eight.

SEASON WRAPUP

• Won 48 games and advanced to the second round of the playoffs.

• The Jazz have three awards candidates in Donovan Mitchell (Rookie of the Year), Rudy Gobert (Defensive Player of the Year) and Quin Snyder (Coach of the Year).

• Utah will have the 21st pick in the upcoming NBA Draft.

• The Jazz have two primary free agents in Derrick Favors and Dante Exum.