Image via Wikipedia
First Chinese immigrants, 2 man and 1 woman, arrived in San Francisco in 1848 onboard the American freighter "Eagle". They were recorded in local records as "Celestials".
In 1849, gold was discovered at Sutter's Mill north of San Francisco. The news spread like wildfire, starting the California gold rush of 1849. The news also spread across the ocean back to China, inspiring may residents of Taishan and Zhongshan, provinces of Guandong, the coastal province, to emigrate to the US in the next 100 years. Indeed, San Francisco's Chinese name today is "Old Gold Mountain" (the new Gold Mountain is in Alaska, in case you are wondering).
Unfortunately, the few that arrived do not speak English, and ended up mainly as railroad workers. Initially the railroad companies were very reluctant to hire non-whites, but when the Irish railroad workers went on strike, protesting lack of liquor, one company hired Chinese laborers, who turned out to be very hardworking. Eventually, up to 50% of all railroad builders were Asian, until there were no more railroads to build.
Chinese proved to be such hard workers, that the State of California deemed to pass a tax specifically on the Chinese, known as the "Anti-Coolie tax" of 1862, where each Chinese worker is taxed at $2.50 per day, and tax collectors have the authority to seize the person's property and sell it off in 30 minutes if the person does not pay up. Please remember, this is 1862.
The idea of Chinatown at the current location was not a nice decision. At the time, "downtown" is towards the water, i.e. current day piers and Fisherman's Wharf. One of the worst spots in town, known as "Barbary Coast" (after the pirate infested spot in the Carribean), is at the corner of Broadway and Columbus. It's bad enough that the San Francisco Police Department had the Central Branch just one block away, on Vallejo street. So where do you want the Chinese out of sight? Put them BEHIND the bad spot, away from the pier. Thus, the current day location of Chinatown.
And Chinatown is quite small, hemmed in on all four sides. To the north it is limited by "North Beach" (little Italy). To the east it's right on the edge of Financial District. To the west it is encroaching on Nob Hill, and to the south it's hemmed in by the tunnel and Union Square. One way Chinatown dealt with this is by creating alleys, basically even smaller streets between buildings. Many of the alleys are still here today.
You may have wondered why Chinese seem to be working in restaurants, or laundries, or as laborers. The truth is, the laws and other merchants don't permit them to do much else. At that time, only Chinese would eat in Chinese restaurants, and everybody needs laundry done. It wasn't until turn of the century that some of the restrictions were lifted. Fishing, and shrimping were allowed. Indeed, sun-dried shrimp is a Chinese delicacy, and San Francisco shrimp-fisherman exported hundreds of tons of dried shrimp back to China as some of the best dried shrimp available anywhere. Unfortunately, nowadays, with the Bay waters populated, only ONE shrimp fisherman is left up north.
Back to history... With the economy worsening post-Gold Rush, xenophobia is on the rise. In 1872, a panic on the stock market lead to full blown race riots and some parts of Chinatown were burned by angry mobs, who claimed that Chinese were stealing their jobs. In 1882, US Congress passed the Chinese Exclusionary Act, marking the Chinese as the ONLY specific race to warrant a law passed by US congress to limit immigration. The act was extended, and extended again, and made permanent, and was not repealed until 1943, in the middle of WW2. Other immigration acts, such as the Geary Act, restricted Chinese immigration to very low levels, and in theory, to single males only, though wealthy merchants may be able to get an exemption to get their whole family over.
The 1906 Earthquake and fire leveled much of San Francisco, and Chinatown was completely gutted. Many in city hall wanted to move Chinatown south to Hunters Point, perhaps as far as Daly City, or just erase it altogether, so that they can take the land and absorb it into Financial district. However, the local merchants, now united as Chinese Chamber of Commerce, along with the Chinese Government, and other local interests, complained loudly that the city relented. And Chinatown was rebuilt in the same location.
Most Chinese immigrants were processed on Angel Island (now a state park). Unlike Ellis Island to the East where immigrants are usually only held a week, immigrants on Angel Island can be held for several months, perhaps even over a year. They were interrogated closely in order to authenticate their identity. The barracks were the immigrants lived was recently restored and preserved as a historical monument.
Post WW2 saw a population boom in Chinatown, due to several factors. The repeal of Chinese Exclusionary Act, plus the passage of the War Brides Act, allowed many Chinese-American veterans to bring their wives to live in the US. Later, US Supreme Court ruled that it is was unconstitutional for property owners to deed their rights so that certain groups were excluded. Thus, this opened up many properties to be purchased by Chinese Americans. As Chinatown is so constricting, many moved to other parts of San Francisco, which lead to establishment of unofficial secondary Chinatowns, such as Clement Street (3rd Ave to 12th Ave), Irving St. (20th Ave to 28th Ave), and more.
Oakland has its own Chinatown, but none of the other cities in the Bay Area followed suit in spite a large increase of Chinese population in the 1900's.
In the 1960's and 1970's, the local merchants decided to remodel Chinatown to make it more tourist-friendly. Which is why today you see the street lamps decorated like lanterns held up by twin dragons, houses with swooping roofs and extra pagodas that are purely ornamental, and so on.
Today, the first and oldest Chinatown continues to wow tourists from everywhere, and will do so for the foreseeable future.