Context
Baghdad has had a lot of things, supermarkets were not one of these. We saw an opportunity to deliver groceries (and more) to customers in a city most companies considered too chaotic. Which is not wrong, but 8 million people call it home. “Peter, can you help us with technology? / Sure, which part? / All of it” I joined as founding CTO to build everything from scratch. Lemune set out to build quick-commerce in Iraq — a market with unreliable infrastructure, limited tech talent, and no successful playbook to copy. In 18 months, Lemune grew to four cities (Baghdad, Basra, Karbala and Najaf) and we served 600.000 customers.
Approach
The usual approach would have been to hire fast and throw people at the problem. I did the went the opposite — a small trusted team, as much automation as we could (later) and open-source software. Four mobile developers (in the beginning, later we ended up with two) as we built native apps. (Which I wouldn't do again in similar circumstances, but yet again, with AI, maybe I would.)
What made a difference
Built the entire stack — native apps, e-commerce backend, ERP and logistics integrations — with a team of 6 engineers. Besides building, handled the technical part of our series A at a $40M valuation. Most open source e-commerce software is built for a single store. We started with 4 dark stores, which meant 4 different inventories and product assortment. The list of systems we could use was small, I ended up choosing Saleor. Built by a small team in Poland, it's an excellent system and has a really good open-source community. Collected data religiously from the beginning. Even though most of our infrastructure was on AWS, I used Bigquery for the data warehouse, as (unless you run queries all the time) the economics is way better at this scale. Started to use an early version of OpenAI first to translate customer feedback (Google translate was not very useful for Arabic), analyse sentiment, later to write responses too. Helped us cut support costs by 25% and we saw operational and quality issues across cities in real time.
Fun technical details
Saleor was great, but used a GraphQL API that was very chatty. Also, beautiful, structured Python is not the best thing for speed. We used an early version with pretty much no caching. Oh, can't you just cache product pages? GQL uses POST requests, so I ended up building a POST response cache on Cloudflare (the only cloud service with servers in Baghdad). Cost us 20$ a month, saved about 8000$. Ran Saleor cheaper than their own cloud service.
We had to launch fast, so we did not have an ERP. Around month 6, managed to lure the team away from a very convincing SAP sales rep and ended up implementing Odoo. Until then, I realised why you should not build inventory management systems if you can avoid.
Our logistics system used the Google Maps API to check where the driver is 8-10 times for each delivery, just to show an ETA in the app. It cost us a small fortune. Since both our warehouses and customers' locations were fixed, we started saving ETA for customer locations in a hourly breakdown. Overlaid the data on a map (using Uber's excellent H3 mapping tool) and in a week we had all the ETA data we needed, for free. Later we just kept updating it based on the real start and arrival times.
Results
Got from 0 to 600.000 customers and over 7,000 daily orders in 18 months. Kept tech spend under 20% of what comparable operations run. The team never grew past single digits.