“Most people who live in our community say, ‘Thank you for being open when all the other stores are closed,’” Ms. Mikayelyan said. Customers have told her that “coming to your coffee shop makes me feel like everything is still OK.”

Other coffee shop employees described feeling that they weren’t just providing a service, but that their presence was symbolic.

“I know it’s not just the coffee,” said Sarah Madges, 29, a barista and manager at Swallow Cafe, which has three locations in Brooklyn. “Everyone who comes in, I can tell for the most part this is the one thing they do that day that contains a semblance of normalcy and provides comfort, even if that comfort comes through a mask and gloved hand. It’s the closest people can get to an organic human interaction.”

“But it’s also tough to keep on a brave face, especially when people don’t seem particularly grateful — not that they should be commending me,” Ms. Madges said. She described instances of customers regularly skipping tips, or becoming angry when a product they wanted was out of stock.

Her shop is running with a skeleton crew these days: Many of the baristas quit as the virus began to spread in the city, and only one employee works each shift, both as a safety precaution and out of necessity.

While Ms. Madges worries about her health and putting others at risk, “the backdrop is, this is what I have to do to pay rent,” she said. “Most days, I’m really trying to focus on how this is the nice part of people’s days.”