Until a decade ago, this graceful antebellum city that witnessed the first shots of the Civil War did not look to Washington for help. "It was a philosophical thing," said Mayor Joseph P. Riley Jr. "They didn't believe in federal aid."

The city was considered an economic backwater, a place that looked more to the past than the future. "We are like the Chinese here," said one longtime resident. "We eat a lot of rice and worship our ancestors."

Today, Charleston is booming, thanks in part to the federal assistance the city once spurned. Unemployment is 5.0 percent, retail sales have jumped 92.5 percent since 1980 and U.S. News & World Report recently proclaimed that the city "ranks No. 1" among U.S. cities "where business is best."

But Riley, a Democrat who has been twice reelected mayor without opposition, said he fears "we may lose our momentum" because of further cutbacks in the federal aid that his administration has embraced.

Riley is an urban evangelist, a politician who takes great pride in his city. Federal aid, he said, "has saved us from mediocrity."

Such aid has dropped dramatically every year of the Reagan administration. In 1981, the first year of the Reagan presidency, 14.5 percent of Charleston's operating budget -- $3.3 million -- came from the federal government; this year the figure is $1.7 million, or 5.6 percent of the budget.

Most of this money has come from the federal revenue-sharing program, which will die Sept. 30 unless Congress acts to save it. Charleston has received millions more from other federal programs that have shrunk dramatically.

In 1981, the city received $2.3 million in community development block grants; it expects to get $891,480 this year, according to officials. During the last year alone, the city's share of urban mass transit funds dropped from $1.5 million to $1.1 million.

Charleston, with a population of only 72,000, has adjusted to the cuts the old-fashioned way. "Cities only have two choices," Riley said. "We can raise taxes or cut services."

Since 1981, Charleston has raised taxes twice, cut the number of city workers by about 5 percent and lengthened the city workday, the mayor said.

This has spread the pain of the cutbacks to the point that it is hard to find any single group that has dramatically suffered.

But Riley said his city now has very little room to maneuver.

"We've been operating a tight ship for a long time, so we have nowhere to turn," he said. "We don't have a big white-collar bureaucracy. Our government is a basic-service provider. I know the city of Charleston doesn't want less police or firemen. If we have less garbagemen, less garbage gets picked up and people don't want that. We could cut what we give the symphony or the library, but I consider those essential items, not frills."

Not everyone here agrees.

Last week, Frank Gilbreth, author of the 1950s best seller "Cheaper by the Dozen" and a longtime columnist for The News and Courier in Charleston, wrote that many of the federal programs are "insanely uneconomical" and could be eliminated "without creating any real devastation whatsoever."

Founded in 1670, Charleston is the quintessential city of the Old South, proud, nostalgic and self-possessed. It was and is called "the Holy City" by the reverent and irreverent alike. "Some say that's because we have so many churches; others say it's because of our holier-than-thou attitude," said one longtime resident.

For the first half of its history, the city was one of America's great trading centers, a port of departure for rich cargoes of cotton, rice and indigo cultivated by black slaves for white plantation owners and merchants who dominated South Carolina's economic and political life.

A city of picturesque mansions, wrought-iron balconies and wisteria-draped courtyards, it rivaled Philadelphia, Boston and New York in wealth and grandeur during the early years of the Republic. The Democratic Party held its 1860 national convention here, and the following year the first shots of the Civil War were fired at Fort Sumter in the Charleston harbor.

After the war, Charleston went into a long economic slide that did not end until World War II. Then came the L. Mendel Rivers military-industrial boom. Rivers was the city's congressman. During the South Carolina Democrat's years as chairman of the House Armed Services Committee, the Charleston area became one of the biggest military centers in the country.

But Wacon L. Stevens, a city councilman for 26 years, said, "We didn't really come out of the lethargy of the 19th century until the last 10 or 15 years."

"Charleston right now is on the verge of enjoying its greatest period," Riley declared last week.

This can't be dismissed as idle hometown boosterism. Charleston's downtown has become a model for urban revitalization. Dozens of tastefully renovated boutiques, restaurants and offices buildings line East Bay, Meeting, King, Market and Broad streets. Even some of the city's new parking garages look like something out of Architecture Digest.

Annual medium family income has jumped $6,000 since 1979. The city's Spoleto Festival, an annual 17-day art extravaganza, has won international acclaim. Crime is down 35 percent since 1980, and Reuben M. Greenberg, the city's black, Jewish police chief, was recently featured on CBS' "60 Minutes."

Part of the region's economic boom can be traced to the Reagan defense buildup. According to a report by the Charleston Trident Chamber of Commerce, the annual military payroll in the region has grown from about $750 million to more than $1 billion since 1980. One of every eight people in the region, 59,560 persons, works for the military.

But Riley argues that his city's boom is fueled by another type of federal money -- flexible block grants under the Urban Development Action Grant (UDAG) and community development programs. The city has received more than $36 million under the two programs during Riley's 10 years in office.

Community development money has been used, among other things, to build parks and renovate scores of old, dilapidated houses in the city's predominantly black East Side. UDAG, private and city money has been used to convert a long-empty former cigar factory in the same area into a business training center, which now houses 125 small businesses.

"Federal money has done wonders here," said City Councilman Jerome Kinkoch, who represents the area. "This neighborhood was slowly but surely deteriorating. Now it's come back."

The East Side is one of the few places where the impact of cutbacks already can be seen. In 1981, the city renovated 122 homes, many in the area, with community development money. Last year, that figure fell to 66. This year, officials estimate they will be able to do only about a dozen homes.

The city has used UDAG money to help finance two bank buildings in its downtown business district, several multilevel parking garages and a huge convention hotel, and to restore an old downtown warehouse into a picturesque inn and retail shop development, transforming several adjoining blocks in the process. The city is seeking an additional $9.9 million in UDAG money for a waterfront park development.

The city estimates that these projects, when complete, will have leveraged $52 million in private investment and produced about 1,400 permanent jobs. The Reagan budget released yesterday proposes elimination of the UDAG program.

Riley conceded a hotel and the bank buildings might have been built without U.S. help, but said they would have been more modest structures -- not in keeping with Charleston's historic character.

"What these programs have done is give us the ability to aspire to greatness, to be something beyond the mediocre," he said. "This is terribly important at a time when we are the most urban nation in the world, and more and more Americans live in the orbit of the central city. The central city, to a large part, dictates the quality of life, the interest in excellence and spirit for entire metropolitan areas."