“Being a scrappy startup, it’s funny to see some of our designers forklift once in a while,” chuckles Chieh Huang, CEO of Boxed. Unlike most of Silicon Valley, which seems obsessed with multi-billion-dollar valuations for whatever ephemera the kids are into these days, Boxed moves just as many atoms as bits. It’s an online store that, like Amazon, will deliver whatever you buy to your door—but only in bulk. If Amazon is the online Walmart, Boxed is the online Costco.

Boxed began building its e-commerce platform just six months ago, with a little over $1 million in initial funding. Three months later, it went live with an app for the iPhone (there’s now an Android app too but so far, at least, it’s not building a shopping website) and a pilot program delivering in New York and New Jersey. It rapidly expanded, and as of a week ago, it can now ship to everywhere in the lower 48 states of the US. Shipping is free on orders of $75 or more, and they are delivered overnight to Philadelphia, Washington DC, Boston, New York and Los Angeles, and within two days to everywhere else.

Boxed Boxed lets you save when you buy in bulk—and is only accessible through a mobile app.

Scaling at that rate is easy for software-only companies. Doing it for a nationwide retail operation, with supply chains and warehouses and delivery logistics, using a team of just 10 engineers and project managers who mostly came from building mobile games, feels like a minor miracle.

Part of the secret is that a lot of the physical work can be farmed out to others. UPS handles the “last mile” problem of delivery so well that Boxed doesn’t need a fleet of trucks, just some warehouse space in which to store goods before sending them out. (Amazon, likewise, relies on others for delivery.) The warehouse is rented. The wholesale goods themselves are ordered directly from manufacturers, and Boxed doesn’t re-package them.

That meant the main problems to be solved were software problems. One of those was inventory management. ”Early on, we realized most warehouse management software out there is utter crap,” says Huang, referring to the systems used by warehousing companies that aren’t giants like Target and Amazon. “Everything on the back end powering our logistics we built from scratch.”

In order to offer Costco-like prices and free overnight shipping, Huang and his team also had to figure out where to store goods so that they’d be a single UPS truck drive away from the biggest cities on the east coast. They settled on a warehouse in New Jersey. Their proprietary software manages the contents of the warehouse.

To accomplish the same thing on the west coast, Boxed contracted with a warehouse company in Las Vegas. That ensures overnight delivery to Los Angeles, and a hub from which to reach the rest of the country. Eventually, says Huang, Boxed will build its own warehouse. For perspective, Amazon has spent $14 billion on warehouses since 2010, in order to speed its own delivery times.

The other main problem to solve was the part customers see—the app and its underlying e-commerce platform. That took just three-and-a-half months to build, according to Huang. “It was actually a lot easier to build than a game.” The roots of Boxed in gaming—most of the company’s engineers and designers previously worked with Huang at Astro Ape, a games company he founded, or Zynga, which later acquired it—are apparent in the app, which has big, friendly icons and a mascot like a game character.

Stay away from the heavy stuff

Boxed has been generating revenue from the day it launched, and while it offers free shipping on orders above $75, it has kept costs low by carrying only a limited range—currently about 600 items. Those are the things people are most likely to buy, says Huang.

Except, that is, for things like bottled water and 50-pound bags of dog food. Items that are especially heavy and especially cheap break the business model. ”Bottled water selling for $3 apiece doesn’t make sense right now—we would lose $30 per order,” says Huang. “But detergent, we found a way to make that work.”

But what about Amazon?

New parents love Amazon for overnighting huge parcels full of diapers and other essentials. So it’s curious that something like Boxed needs to exist at all. But in Huang’s view, “Amazon doesn’t do wholesale. If you look up stuff we sell in sizes we sell, Amazon either doesn’t carry it, or they carry it through a reseller who marks it up 25-30% higher than we do. Online, there’s not many things per unit that are cheaper than what we sell right now.”

Like most new businesses, though, the concept isn’t the one it started with. When Huang and his team started Boxed, they thought their most avid buyers would be young, technologically savvy men in cities who would buy things like protein powder and energy bars—but those items barely moved. “It turns out the use case is actually… you’re a mom who would rather spend time with her kids on the weekend than burn a whole afternoon at Costco,” says Huang. As a result, the company’s customers skew heavily female.

In the future, no one shops for toilet paper

So what next? Having carved out a niche, Boxed now wants to help people shop in a smarter way. The basis of that is a predictive shopping algorithm that Huang’s engineers built from scratch.

Amazon has for years been suggesting things its shoppers might want to buy, based on comparisons between their shopping histories and those of others. Many other online stores do something similar. Huang wants to go further, and understand how customers are living their lives and how fast they consume the things they buy in bulk. The idea is that, as soon as you’re out of toilet paper or granola bars, Boxed will know, and offer to re-supply you before you even think to go shopping.

“With everything going into mobile devices, [in the future] I just can’t imagine us standing in line buying toilet paper,” says Huang. “It just won’t be a part of human behavior. We’re trying to get ahead of that game.”