Sam Katz is the most successful Republican in the chronically Democratic city of Philadelphia in a generation, which isn't saying much.

Tigre Hill made a movie about his loss to John F. Street amid an FBI investigation in the 2003 mayor's race, The Shame of a City. Now, Katz is making his own movie about another city's fiscal trauma, courthouse drama, and apparent redemption.

Katz's political reversals freed him to pursue service projects and profit schemes; he headed the state board that ensured that the city's bondholders got paid, helped Pomo Indians build a gambling house near San Francisco, bought South Philly real estate, and invested early in two Fort Washington companies — NutriSystem, which said Monday it can make a diet to fit your DNA, and Audience Partners, whose CampaignGrid taught Republican politicians how to merge Facebook data with voter rolls to target you with video, years before  Cambridge Analytica and Russian agents made such tactics famous.

Now, Katz is filming an urban morality movie of his own — in Detroit. His Philly-centric videos have won local Emmys, though not Oscars (the Stephen Girard in an early production reminded me of Inspector Clouseau). But he's convinced big Michigan players to back his latest project — We Are Alivea history of Detroit's bankruptcy and recovery, which could have lessons for Katz's own hometown, because here, too, spending and taxes can't rise faster than incomes forever.

The administration of Katz's fellow Republican, Michigan Gov. Rick Snyder, has been enthusiastic. So have the philanthropic foundations that helped Detroit salvage its finances. "This is really high drama — a great city, on its knees, figures out a way of dodging a bazooka shot," said Alberto Ibarguen, head of the Knight Foundation, which is kicking in $200,000 for Katz's movie.

"It's a movie about leadership. It's a movie about the grit and determination of a city. And in a way that hasn't been told, it's a movie about the genius of the bankruptcy law."

Pennsylvania doesn't allow its cities to become bankrupt: we have more government than almost anyplace; its municipal debt is a profitable industry; and state leaders will cheerfully sell city parks or impound cop cars before letting bond buyers suffer the loss of an interest payment.

But in Michigan, after Detroit lost a million people, a string of mayors went to jail, and retiree pensions ate half the city budget,  Snyder in 2013 decided Chapter 9 bankruptcy was the least-bad way out. He sent manager Kevyn Orr to take control from elected officials, aided by what Ibarguen calls a "Murderer's Row" of advisers, headed by Judge Jerry Rosen, to divide city assets among creditors.

Ibarguen credits Mariam Noland, head of Detroit's community foundation, with rallying donors to help Rosen review city assets, which included a lot of  rundown real estate — plus city art museum Picassos and Rembrandts, worth as much as $1 billion.

Creditors wanted the art. That could mean years in court: "Donors will say, 'We didn't give our Picasso for it to end up being sold by some creditor to hang in Dubai," Ibarguen said.

What if the foundations bought the paintings and put them in an independent trust, and the city used the proceeds to refloat its pensions? Noland's Community Foundation of Southeast Michigan committed $10 million; Knight, $30 million; Ford, $125 million. "We ended up at $360 million," Ibarguen said. The state nearly matched the total. The museums added $100 million. The unions agreed to freeze pensions; some retirees took cuts of 4 percent. Bondholders were forced into much bigger cuts. "In a year and a half they were out of bankruptcy," Ibarguen concluded. "Phenomenal."

Paying down its debt has revived Detroit, Noland told me. "It's a city of construction cranes. There are waiting lists for apartments in the downtown. More restaurants. Developers — Dan Gilbert with Quicken Loans and the Illitches [Little Caesars Pizza] have been investing heavily. Housing values are increasing. They are lighting the streets again."

Katz sent me to the bankruptcy judge, Steve Rhodes, a Levittown native (his father designed RCA color TVs), who oversaw the case. Rhodes noted the conflicts: between city residents and the state they thought shortchanged them, then pushed them around; 20,000 mostly low-paid pensioners vs. Wall Street creditors; a civic leadership that saw the loss of cultural assets as an unraveling of their identity.

Detroiters called the deal the "Grand Bargain." Rhodes issued "sound bites" so news media could easily tell the people what happened daily. He was surprised reporters never asked to televise them, which Rhodes says he would have allowed.

Katz has USA Today business reporter Nathan Bomey, author of the book Detroit Resurrected, working on the screenplay. Detroit native James McGovern is a producer and a director, New York University historian Tom Sugrue is an adviser, and reporters Chastity Pratt Dawsey and Sandra Svoboda are associate producers.

Noland said she and others cried as Rhodes read his 2014 opinion ending the bankruptcy. He quoted Marian Wright Edelman: "Democracy is not a spectator sport." He urged the crowd never to forget their anger that their city "had been taken from them." It is, he said, "your enduring and collective memory of what happened here, and your memory of your anger about it," that will keep politicians from wrecking Detroit again.

The larger "Grand Bargain," Judge Rhodes concluded, "enshrined in our Constitution, is democracy. It is now time to restore democracy to the people of the city of Detroit. I urge you to participate."