Javier Ortiz likes to look on the bright side in San Juan, the pretty and gritty capital of Puerto Rico. “I’m an optimist,” he says. “I’m the owner of a bookstore, so I have to be.”

My Maria story: six Puerto Ricans on surviving after the hurricane Read more

Ortiz has survived not only the onslaught of Amazon but also Hurricane Maria, which forced him to close for 10 days then manage the store without electricity – running a cash machine off a battery – for two months. Now, as the debt-ridden island finally gets an event to celebrate, the 50-year-old has one of the golden tickets.

The mega-hit musical Hamilton opens in San Juan on Friday night. Ortiz’s wife, Huarali, queued for 10 hours to get $150 tickets for them and their Hamilton-mad sons: Alejandro, 12, and nine-year-old Nicolas. “It is expensive: we’re having to make a sacrifice,” says Ortiz. “We will keep working hard and make a better island and better country. Hamilton’s a good sign but the hard work we will have to do ourselves.”

Facebook Twitter Pinterest Workers prepare the venue for the opening of Hamilton at the Centro de Bellas Artes in San Juan. Photograph: Erika P Rodriguez/The Guardian

With a score mixing hip-hop, jazz, blues, rap, R&B and Broadway, the show dramatises the life of Alexander Hamilton, a Caribbean immigrant who becomes an American founding father and the first treasury secretary, only to be wounded by scandal and die in a duel. It has swept awards shows and conquered cities across the US as well as London, but its arrival in the American commonwealth of Puerto Rico was always going to be special because of its composer, lyricist and star.

Lin-Manuel Miranda, born in New York to Puerto Rican parents, spent his childhood summers on the island. For the two-week San Juan run, which is raising money for arts communities on the island, the 38-year-old dynamo will reprise the title role for the first time since Broadway in July 2016. It will be a joyful and poignant homecoming; a moment to savour Miranda’s global success, and a symbol of the island’s slow return to normality after the September 2017 hurricane that killed nearly 3,000 people and caused what is thought to be the biggest blackout in US history.

And yet, this being Puerto Rico, it is also complicated, multi-layered and politically charged. There has been controversy over a last-minute change of performance venue. Some are also reluctant to regard Miranda, born and raised in New York, as one of their own. They are unhappy about his association with Barack Obama and a debt restructuring plan that imposed harsh austerity measures on the territory of 3.3 million people.

Facebook Twitter Pinterest Aryam Camacho, 24, is Lin-Manuel Miranda’s cousin. Photograph: Erika P Rodriguez/The Guardian

About 20 miles (32km) west of San Juan, traces of Miranda are inescapable in Vega Alta, an unglamorous town of 39,000 people where his extended family still lives. Its theatre was torn down in the 1970s to make way for a car park, but a small new plaza built by his father includes a bakery, bar, cafe, souvenir shop – hats, mugs, T-shirts, postcards, lifesize cardboard cutouts of Miranda – and a small museum showing off artwork, awards, cast recordings, family photos and theatre programmes. On the walls there are colourful tile mosaics that include Miranda’s face, the Hamilton logo and the Puerto Rican flag. Salsa music plays as tourists snap photos.

A short walk away, on a cul-de-sac of single-storey houses where the quiet is punctuated by squawks from tropical birds, is the home where the young Miranda and his sister would while away summers with their grandparents. He would often run over to see his neighbour Margo Rodriguez and enjoy her homemade limbers – a local treat that resembles a popsicle frozen in a plastic cup. “He spent a lot of time with me here, singing, drawing and making jokes,” says Rodriguez, now 85. “I would pretend to play guitar with a broomstick and he would sing. He was a good kid. He was priceless.”

Facebook Twitter Pinterest Merchandise at the store Tee Rico in the Placita de Guisin in Vega Alta. Photograph: Erika P Rodriguez/The Guardian

She is not alone in her pride. Elliot Knight Nater, a music director, says: “This town loves him. When they know he’s coming here, you can see 200 to 300 people waiting: people who used to see him as a kid running in the streets.” He added: “I hope he never gets into politics because people change as soon as they get in that position.”

And yet Miranda’s family is steeped in politics. His great-uncle, Gilberto Concepción de Gracia, was the founder of the Puerto Rican Independence party. His father, Luis Miranda, is a Democratic party consultant who left the island at 18 to chase the American dream and, despite speaking little English, found that New York “fit like a glove”. He settled in a Latino neighbourhood in Washington Heights – the inspiration for Miranda’s breakthrough musical In the Heights, which he brought to Puerto Rico in 2010. Luis Miranda was a special adviser to the New York mayor Ed Koch in the 1980s and helped manage Hillary Clinton, Chuck Schumer and Kirsten Gillibrand’s successful campaigns for the US Senate.

Facebook Twitter Pinterest Luis Miranda Jr, father of Lin-Manuel. Photograph: Erika P Rodriguez/The Guardian

His son has taken on the baton. Accepting a Tony award in 2008 for In the Heights, he waved a small Puerto Rican flag. Hamilton, which celebrates diversity by casting people of colour as the founding fathers of the US, was hailed by New Yorker magazine as “the Obama-era musical”. Its cast delivered a pointed statement to the vice-president, Mike Pence, after one performance, while Miranda has tweeted that Donald Trump will go to hell for criticising the mayor of San Juan after the hurricane. He has also gone to Washington to plead with Congress to help Puerto Rico with its economic crisis and appeared on the comedian John Oliver’s HBO show to rap: “Paul Ryan, I’ll come sing Hamilton at your house. / I’ll do-si-do with Pelosi, I’ll wear my Hamilton blouse. / Your citizens are suffering, stop the bleeding, stop the loss. / Help Puerto Rico, it’s just a hundred miles across.”

Facebook Twitter Pinterest People walk in Old San Juan. Photograph: Erika P Rodriguez/The Guardian

Amid the Spanish colonial buildings, cobbled streets and ornate balconies of old San Juan, where tourists disgorged by giant cruise ships wander among cats and pigeons, many are expressing their gratitude before opening night. Javier Santiago, 59, the director of the National Foundation for Popular Culture, has a small shrine to Miranda, including the red shirt he wore for the Broadway run of In the Heights, and invites young visitors to try on Miranda’s cap. Some burst into tears. “That’s something they will never forget,” he says.

Lin-Manuel Miranda: ‘A Trump musical? I don't know how to score that yet’ Read more

“We feel very proud of the work he did in In the Heights. He showed the soul of our community: the getting together, the importance of family. This is a side that West Side Story never showed. Hamilton coming here is symbolic of the Puerto Rican soul that will never die. He’s in the diaspora that left Puerto Rico to go to the United States; his parents brought him back every year and he never lost contact with his roots. The idiosyncrasy, the Latin way of being, is in him, pumping in his heart.”

Facebook Twitter Pinterest The University of Puerto Rico theatre building in Rio Piedras. Photograph: Erika P Rodriguez/The Guardian

But in Puerto Rico, neither a nation nor a state, where people can vote in US primaries but not in presidential elections, nothing is simple or straightforward. Hamilton was due to be performed at the University of Puerto Rico, where its producers spent $1m upgrading the theatre. Then, late last month, the show was abruptly switched to the Luis A Ferré Performing Arts Center because of concerns about student protests over budget cuts enforced by Washington. The Hamilton set was taken down, shuttled across town and hastily rebuilt.

Luis, 64, a former student at the university, was disappointed by the move but endorsed it. “There’s many things that you could compromise but security is not one of them,” he says. “If there is a minimum possibility that anything can happen, that should be enough for the production to move.”

Facebook Twitter Pinterest Nelson Rivera, a retired arts professor. Photograph: Erika P Rodriguez/The Guardian

But Nelson Rivera, a retired art history professor at the university, accuses the producers of losing their nerve. “I think the government threw shade at the students: ‘Oh, they’re a bunch of terrorists, get out of there.’ They fell for it. They should have won over the community, the university, and nothing would have happened. We’re very nice people.”

Rivera, 65, is sharply critical of Obama’s solution to Puerto Rico’s $70bn (£55bn) public debt load, a law known as Promesa that established a non-elected financial oversight and management board – supported at the time by Miranda but disparaged by many as “la junta”. He says: “We don’t really have a government of our own; we’re governed by this junta and they’re basically dismantling the country. One of the first things that they started to do was eliminate public education. A lot of public schools have been closed and the university has been really hit hard.

“So Hamilton has been used to strengthen the idea that the university is a difficult place that has to be eliminated or at least toned down. That’s exactly what they did when they moved the play instead of keeping it at the university. What is interesting about Hamilton is the way it’s been used for politics.”

Facebook Twitter Pinterest Banners promoting the original dates of Hamilton can still be found at the university. Photograph: Erika P Rodriguez/The Guardian

Rivera, a supporter of Puerto Rican independence, continues: “They call it the Obama-era musical. Give me a break. If Hamilton is anti-Trump, we’re also anti-Obama. For Puerto Ricans, there’s no difference at all between Obama and Trump. So I understand that Obama looks nicer and speaks better but his policies were as terrible to Puerto Rico as Trump’s are. Obama gave us the junta and Trump sent us paper towels. What is the difference?”

Ten thousand tickets are being sold for $10 each to residents of Puerto Rico via lottery but Rivera has no intention of trying to see the musical. “There’s a lot of mixed feelings for us. For artists, we have a strong theatre tradition here in Puerto Rico and American musicals are not really our thing. The subtitle of Hamilton is ‘An American musical’ and that’s as American as you can get. So for us, this is not a play that’s meaningful in terms of our culture. It really has nothing to do with us.

Facebook Twitter Pinterest A family portrait of the Mirandas. Photograph: Erika P Rodriguez/The Guardian

“Lin-Manuel was raised in the United States. He identifies as an American and when he chooses to do a play it’s about the American experience, not about the Puerto Rican experience. We work with Puerto Rican history and issues and things that Lin-Manuel cannot really know about because he does not live here, he was not raised here nor educated here, so I don’t see how you can talk about something that you don’t really know.”

Miranda’s father is aware of the identity politics and does not shy away from them. “The forever debate is who is Puerto Rican,” Luis Miranda says in an interview with the Guardian in the theatre foyer, hours before the first dress rehearsal. “You hear the debate among normal people: ‘But he’s not Puerto Rican, he’s from New York, he’s from Puerto Rican parents.’ But what we do know is that there is enormous pride in him, particularly since he’s so proud of being Puerto Rican. He has said many times that he is using the megaphone and the spotlight that he has gotten thanks to Hamilton to push forward things like the recovery of Puerto Rico.”

Luis Miranda also appears to embrace the complexities of his son’s forays into politics, having fought many such battles himself. “I hate Trump and anything I could do to defeat Republicans, even now my friends who are Republicans, I would do because they have allowed the party to be hijacked by this orange nut. When you do that, you know people are going to be with you and people are going to be against you. It’s no different in Puerto Rico, but the important part that I hope I taught my kids is that you make decisions and you take stands and some will applaud you and some will criticise you, but you take the stand you believe is right.”