Above the shops and restaurants that charm tourists in San Francisco's Chinatown, densely populated rooming houses with communal baths and kitchens overflow with old and immigrant residents of a community that has nowhere to grow.

Between two avenues that connect downtown NewarK, N.J., with its suburbs, a 12-block'square community of frame houses built in the 1930s by Ukrainian immigrants has become a kind of refugee camp for the black and Hispanic poor displaced by renewal in ohter parts of the city. An area of unemployed and low-paid waorkers, the West Side Park neighborhood is nearly half children and youths under 18.

Yesterday, community organizations from 21 such areas across the country came to Washington to claim the first share of federal money for cities ever entrusted directly to people who live in the neighborhoods.

The Department of Housing and Urban Development has awarded about $2.5 million in contracts for projects in the 21 communities ranging from rehabilitating a historic church in Boston's South End to setting up a home-repair industry in Buffalo.

"They are the third factor in urban partnership, the dimension that is neither public nor private sector, but one of the key ingredients in the 'urban partnership'" President Carter's urban policy called for last March, HUD Assistant Secretary Geno C. Baroni said yesterday.

In another action to increase the involvement of community groups, HUD Secretary Patricia Roberts Harris last week established an Office of Neighborhood's, Voluntary Associations and Consumer Protection, under Baroni.

Richard Fleming, formerly involved in developing the new town of Columbia, Md., and named to head the office, said it is a "brokerage for bringing community groups and resources from HUD and other federal agencies."

Leaders of the 21 contract organizations representing Hispanic, black, Chicano, American Indian, Asian and Puerto Rican communities reflective of many large cities' poor populations, came to Washington this week for guidance on managing the funds and to initiate "a camaraderie among them," Fleming said.

"Community organiations can work with city hall constructively and we can do a job that neither (government) nor private developers can. HUD is finally recognizing that," said Jorge Hernandez, head of predominantly Hispanic Inquilinos Boricuasen Action, which has completed several successful renewal projects in Boston since 1970.

The Chinatown Neighborhood Improvement Resource Center will use its $120,000 contract, in part, to prove that crowding can be alleviated among the 40,000 residents in 15 blocks without dispersing them from their cohesive community, language centers and familiar surroundings, the group's director, Sue Lee, said.

In Newark, where West Side Park's former residents abandoned many shops and the only thriving business is in tavern, the Tri-city Citizens Union plans to use its $130,000 contract to encourage reinvestment and homeownership.

Tucson's American Indian and Chicano community, located on "the other side of the freeway" from Sun Belt prosperity, needs a new mentalhealth center and apartment complex as well as the resulting jobs because the copper price decline put many workers from nearby mines out of work, said Ramon Leon, director of the Center for Economic Development and Business Assistance.

The community groups, many of them born out of opposition to crises such as urban renewal or highway projects in their neighborhoods, also represented: Bedford-Stuyvesant, in Brooklyn, Kansas City and St. Louis, Mo., Atlanta and Decatur, Ga.; New Haven and Hartford, Conn.; Minneappolis, Toledo, Chicago, Baltimore and Los Angeles.