The sound of hammers and saws cuts through the morning air as nearly two dozen youths build a house on North Avenue, just off of Dudley Street. They’re attaching gray-blue siding, constructing the front deck, and installing insulation in what is to be a three-bedroom, single-family home.

But these men and women are building much more. Organizations like YouthBuild Boston are laying the foundation for community and opportunity, helping prevent what happened in Baltimore, where peaceful protests roiled into a night of rioting this week over the death of Freddie Gray from injuries sustained in police custody.

“Just imagine waking up every day and wondering ‘What am I going to do? When am I going to get a job?’ ” Greg Mumford, YouthBuild Boston’s deputy director, said Thursday. “There’s nothing to do, so you’re just hanging around.”

Advertisement

Frustration brews in those idle moments, he said.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

Both are port cities similar in population size. Both are defined by their neighborhoods. Both are places where the chasm is vast between the haves and the have-nots in housing, employment, education, and income. About 1 in 5 residents in both cities lives below the federal poverty line, according to Census data.

“It is Boston’s challenge to look ourselves in the mirror, instead of pointing fingers, to see similarities and a teachable moment in what’s happening in Baltimore,” said City Councilor Tito Jackson, whose district includes pockets of the city with double-digit unemployment. “What people should be seeing is not the physical destruction. What they should be viewing is the destruction that has already been caused in people’s lives, the disparities that are palpable.”

Total median assets — home, car, retirement fund, life insurance — for a white family in the Greater Boston area is about $256,000; while total median assets for a black family is $700, according to a recently released report by the Federal Reserve Bank of Boston.

Advertisement

And according to the Boston Public Health Commission, black and Latino residents are more likely to be hungry and unable to buy food; become victims of homicide; have higher rates of HIV; and suffer at higher rates from a host of medical conditions.

“We have to be thoughtful about these types of disparities in Boston because this level of underdevelopment, this level of under-education, and this level of disparity is the actual cause of the problem,” Jackson said.

Because, community leaders say, unless they are dealt with these issues simmer below the surface for decades, fueling hopelessness and anger that often overflows during contentious interactions with police.

“If it goes to the level of someone being killed and there are no consequences for the police, it’s a natural fuse for the despair that’s been turned into rage,” said Dorothy Stoneman, chief executive of YouthBuild USA, the organization’s national umbrella. “This is totally a national crisis.”

The Roxbury-based nonprofit helps 14- to 24-year-olds, many of whom dropped out of school and some who have criminal records, earn GEDs and enter the trades. It is part of the city’s network of community organizations that city leaders say serve as a release valve to mounting tensions in Boston’s impoverished neighborhoods.

Kayana Szymczak for The Boston Globe

Rember Ochoa at the end of his shift at a YouthBuild, which helps young people earn GEDs and enter trades.

Advertisement

These groups teach marginalized youths collective action and civic engagement, said James Jennings, a noted specialist in race, politics, and urban policy at Tufts University.

“They give young people alternative responses in how to deal with their anger,” Jennings said. “When that happens, young people are less inclined to pick up a brick and throw it because they have been involved in community.”

The irony, he said, is that many of the groups that play a vital role in impoverished communities often find themselves struggling to keep the lights on and the rent paid.

There was a YouthBuild program in the Baltimore neighborhood where 25-year-old Freddie Gray was raised. It was shut down five years ago for lack of funds, Stoneman said.

Boston glimpsed these emotions in March after a gun-wielding suspect was killed by police, and some in the area reacted with rage. The city did not erupt in flames like Baltimore or Ferguson, Mo., which became the sight of nearly constant protests — some violent — after a black unarmed teen was killed in August by a white police officer who was not indicted.

Law enforcement officials released surveillance video showing the suspect shooting the officer in the face.

“But for that video being released showing that he shot the officer in the face . . . many of us would have stormed Humboldt Avenue,” said Michael Curry, president of the Boston Chapter of the NAACP. “The anxiety and the frustration are there.”

But Curry and other city leaders, while acknowledging Baltimore’s black police chief and majority-minority police force, say Boston has some things that Baltimore does not.

Here, Curry said, “we now have a police commissioner and African-American chief who are willing to start to explore the taint of race in law enforcement . . . who are willing to explore where the hiring practices and behavior of the officer have impacted certain communities.”

That, he said, can lead to significant shifts in policing.

But mistrust remains.

“The police don’t really do their job when a black person is shot. They don’t really investigate,” said Britney Hickson, 17, a senior at Madison Park High School. “But let a white person in Somerville get shot, they will find that person.”

Two of Hickson’s family members have been victims of gun violence — one a fatality — and neither assailant was caught, she said Thursday, moments after disassembling a door at the YouthBuild Boston construction site.