It was a good night for the Democrats. It wasn’t the liberal “blue wave” some hoped for, but it might be the beginning of one. It wasn’t a decisive referendum on President Trump, but it created a check on his authoritarian power.

Seizing control of the House of Representatives was a huge victory, even if expected. There were strong Democratic showings in rust belt states Donald Trump carried and big wins in gubernatorial races, especially in Kansas where the odious Trump clone Kris Kobach was defeated by a surprisingly big margin by Democrat Laura Kelly.

It was a dream deferred for Stacey Abrams in Georgia and Andrew Gillum in Florida, two African American rising stars. Beto O’Rourke will certainly be a Democratic force for years to come, having come so tantalizingly close to unseating Senator Ted Cruz. No Democrat has done as well as Beto did in Texas in decades. He’s already being talked about as a potential presidential contender.

Sign up to receive the latest US opinion pieces every weekday

The results made it clear there is trouble ahead for the president. There is the Mueller report still to come and House committee chairmen who will use their oversight power to investigate the ample trail of corruption already evident. The Democrats who will control the powerful House ways and means committee, promptly announced on Tuesday night that they intend to demand the president’s tax records, setting up another legal clash with the White House.

But Democrats have to be smart and not play on the president’s turf. It was heartening to see Democrats have a coherent message on the campaign trail and, with uncharacteristic discipline, focus on healthcare and the importance of coverage for pre-existing conditions. They need to keep it up.

Play Video 1:54 'I'm as hopeful as I've ever been': Beto O'Rourke fails to beat Ted Cruz – video

Democrats must also look forward and face a crucial test, whether to lean to the left, responding to the success of candidates like New York’s Alexandria Ocasio-Cortez or whether to stay closer to the middle, in hopes of cementing their 2018 success with suburban Republican voters, especially women, who deplore the racist, relentlessly negative tone their party has adopted in slavish devotion to Donald Trump. Democrats are still badly split, just as they were in 2016 with Bernie v Hillary. While former president Obama emerged late in the campaign and fired up the party troops, there is no clear future party leader.

Nancy Pelosi, the almost certain next House speaker, promised late on Tuesday night in her victory speech: “Tomorrow will be a new day in America.” But as she spoke, she was surrounded by the ageing members of her leadership, demonstrating the difficulty of making good on her pledge. Her immediate challenge is to usher in a new generation of Democratic leaders. (Ageing presidential dreamers like Joe Biden and even Hillary Clinton are said to be contemplating runs once again). Democrats would be silly to dispose of the effective Pelosi, who is a great vote-counter. Obamacare wouldn’t have passed without her.

Trump has been running for re-election since the day he was inaugurated and he’s been running as if Pelosi were his opponent. But the challenges he faces in the future are even more daunting. House defeats, particularly Virginia, where rightwing Barbara Comstock lost, in Pennsylvania and other once very red states, including Texas, were part of a stinging rebuke of the president. Another Trump clone, Steve King of Iowa, was fighting for survival in a district that Trump carried by more than 20 points. King was so out of control that he was denounced by the chairman of the House Republican Campaign Committee. He ended his repulsive candidacy at an election-eve rally where this bigot actually said that he hoped US supreme court justices Elena Kagan and Sonia Sotomayor “will elope to Cuba”.

There was so much bigotry in the Republican grand finale to the midterms, but the tone of Trumpism is still offensive to many voters, even if the base eats it up. It will take a long time to wash off the stain of Trump’s cascade of lies at his closing rallies, accompanied by Rush Limbaugh and Sean Hannity. Invoking the “caravan of invaders” at every stop, he insisted smallpox, crime and worse were massing on the south-western border, where he has so recklessly ordered up thousands of troops to face an entirely fake danger.

After the synagogue shootings in Pittsburgh, it seemed almost impossible that Republicans would toss out the most offensive antisemitic caricatures. But in campaign flyers sent out to get out the vote in many states, Jewish candidates were pictured holding fistfuls of cash.

In one of the most closely contested House races, the Washington Post found a Republican flyer showing Kim Schrier, a Democratic candidate for Congress who is Jewish, brandishing a wad of $20 bills fanned out in her hands. In another race, the Republicans went even further, showing a Jewish candidate for state assembly tinted green and holding $100 bills.

It’s been shocking to see almost no Republicans of conscience speaking out against these slurs or the president’s words. Will this hold for the next two years? Mitt Romney, coming to the Senate from Utah, forcefully denounced Trump in 2016. Could he emerge as a voice of conscience?

One of the most hopeful outcomes of the midterms was the election of a far more diverse Congress. Many more women were elected, though in the Senate Heidi Heitkamp and Claire Mccaskill were defeated. Still, a record 272 women ran for Congress, including 84 women of color, according to the New York Times. Colorado voters elected Jared Polis, the nation’s first openly gay governor.

In the New York Review of Books recently, Christopher Browning wrote a brilliant and disturbing article entitled Dismantling Democracy 1933 v 2018. Whether democratic values will be destroyed by the political crisis President Trump has created is still a haunting question. But on Tuesday, an answer began to emerge: it won’t happen here.