SAN FRANCISCO was one of several cities dubbed the “Paris of the West” in the early 20th century. The description was inspired by the charms of the Tenderloin district, an area that bustled with commerce and high culture after it avoided the worst of the 1906 earthquake that levelled three-quarters of the city. From that high point the Tenderloin's reputation foundered, but its vibrancy did not. It became the place where San Francisco’s supposed undesirables—including a century’s worth of immigrants, as well as gay men in the 1950s and transgender women in the 1960s—found refuge in affordable, centrally located housing and a dynamic community. The area takes its name from the days when policemen working the area accepted sufficient bribes to be able to buy the best meat.

Today, descriptions of the neighbourhood tend more towards the gritty. But these miss the point. The Tenderloin—or simply “the TL”, as locals know it—does have its problems with crime and public drug use. But it is one of America’s most ethnically diverse communities, and its mural-adorned residential hotels and increasingly cleaned-up playgrounds are evidence of a community of long-term residents trying to improve their surroundings.

The Tenderloin Museum, which opened earlier this month, is dedicated to highlighting this history. Exhibitions draw attention to the spots that most visitors to the area would never know existed, such as the Black Hawk jazz club, where the likes of Thelonious Monk and Miles Davis recorded live albums. Until cable cars were removed from the area and gambling was outlawed in the 1950s, the neighbourhood’s cinemas and clubs were destinations that demanded fine attire.

It took years for the museum to be realised, explains Randy Shaw, the founder. A lawyer and activist for 35 years, he was one of the people who pushed to have the Uptown Tenderloin Historic District added to America's 90,000-strong National Register of Historic Places.

In a new book, “The Tenderloin: Sex, Crime, and Resistance in the Heart of San Francisco”, Mr Shaw notes that the Tenderloin has often been written out of history. Indeed, in a time of tumultuous change, fuelled by another tech-sector boom and subsequent rocketing rents, the TL is one of the few areas of the city to have been relatively untouched by gentrification.

When it came to stocking the museum, one big difficulty was the disappearance of much of the Tenderloin's mid-century history. Even photos or old playbills proved hard to find. Whereas Americans from areas characterised by family homes will often store mementos and heirlooms in an attic or basement, single people renting single rooms in residential hotels simply do not keep as much. “For the most part, no one saved anything,” says Mr Shaw.

The museum's opening night featured a showing of “Screaming Queens: The Riot At Compton’s Cafeteria”, a documentary about an uprising in 1966 of transgender women and drag queens against police harassment in the Tenderloin, three years before the Stonewall Riots in New York City visibly ignited America's gay-rights movement.

That vibrant past, when Muhammad Ali trained at Newman’s Gym and San Franciscan bands such as the Grateful Dead and Jefferson Airplane laid down albums in local recording studios, is hidden nowadays. But the museum should help bridge the gap between historic Tenderloin and the quarter's current, more troubled state. "We really do offer something you can't get anywhere else," says Mr Shaw.