We Built a Full Shopify Clone in Three Days The Codename One team built Bazaar, an open-source MIT-0 Shopify clone, in three days from a single Java codebase and Java backend running on SQLite, PostgreSQL, MySQL or MariaDB. Bazaar spans shopper apps, a merchant back office, offline-capable point of sale, marketplace admin, a server-rendered web store, and an app platform with OAuth installs, webhooks, UI extensions and checkout functions, submitted as PR #6329. The team says every phase of its plan passed tests across SQLite, PostgreSQL and MySQL, and it published a row-by-row feature comparison against Shopify, WooCommerce, BigCommerce and Square. Two weeks ago I wrote that Shopify was wrong to dump React Native for two native codebases https://www.codenameone.com/blog/shopify-was-wrong-and-right-to-dump-react-native/ . Plenty of people told me it's easy to criticize a company that ships. Fair. So I put my money where my mouth is. What is Codename One? Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at codenameone.com https://www.codenameone.com/ . We built Shopify. Not the mobile app. All of it. A shopper app. A merchant back office on phone, tablet, desktop, and web. A point of sale that keeps selling when the network dies. A marketplace admin. A server-rendered web store that search engines index. A blog. An app platform with OAuth installs, webhooks, UI extensions and checkout functions. Inventory across locations, invoicing, B2B price lists, subscriptions, loyalty, marketing journeys and an AI assistant. One Java codebase and one Java backend, running on SQLite, PostgreSQL, MySQL, or MariaDB. It took three days of work. The first commit landed on Friday, November 20, every phase of the plan passed its tests on SQLite, PostgreSQL and MySQL the next day, and the rest went into matching Shopify's feature list row by row. It's called Bazaar https://www.codenameone.com/bazaar/ , the source is free under MIT-0, and it went in as PR 6329 https://github.com/codenameone/CodenameOne/pull/6329 while we shipped everything else in this post. io uring under virtual threads. Bazaar is four apps and a website over one backend. Shoppers browse many independent stores and check out on a phone or in a browser. Staff run the business from a back office. A cashier sells at a register. An administrator runs the marketplace. We keep a feature comparison https://www.codenameone.com/developer-guide/bazaar-feature-comparison/ in the developer guide that walks Shopify, WooCommerce, BigCommerce and Square row by row. Here is the short version. | Area | What's in Bazaar | |---|---| | Catalog | Variants, video and 3D models, bundles, digital downloads, combined listings, metafields and metaobjects, Google's product taxonomy, unit pricing, translations | | Inventory | Multiple locations, transfers, purchase orders, suppliers, stocktakes, committed and incoming stock, serial numbers and lots with expiry, barcode label sheets | | Checkout | One-page checkout, Apple Pay and Google Pay, Klarna and Afterpay, iDEAL and SEPA, saved cards, gift cards, store credit, tipping, post-purchase upsell, fraud rules | | Orders | Edits after placement, draft orders with pay links, authorize then capture on ship, PDF invoices, bulk actions, returns and exchanges with return labels | | Shipping | Zones, carrier-calculated rates, label buying, local delivery and pickup, routing rules across locations, CN 22 and CN 23 customs forms | | Point of sale | PIN sign-in, shifts and Z reports, split tender, card readers, ESC/POS printers and cash drawers, layaways, parked carts, offline mode with sync | | Marketing | Discounts of every shape, flash sales with countdowns, email and SMS campaigns, journeys drawn as flowcharts, points, VIP tiers, referrals, paid clubs | | B2B and markets | Company accounts, price lists, net terms, quotes, multi-currency, EU VAT with VIES checks, OSS reports, duties estimates | | Web | Themes, a blog with RSS and Atom, menus, redirects, JSON-LD, sitemaps, predictive search with synonyms, custom domains, a cookie banner | | Extensibility | OAuth apps, scoped API keys, REST and GraphQL, webhooks with retries, UI extensions, checkout functions, an app directory with billing | | Operations | Analytics with a report builder and cohorts, live chat and calls, TOTP, OpenID Connect sign-in, audit log, multi-store organizations | The demo seeds three stores with 90 days of history, and a demo pipeline keeps moving orders through to delivery so every screen has something happening on it. Here's the shopper app: And the back office the merchant runs it from: This is the table I'd show a merchant. Each row is a feature Shopify leaves to its app store, which usually means another monthly subscription and another vendor with access to your customers. In Bazaar they ship in the box: | Usually a paid Shopify app | In Bazaar | |---|---| | Product reviews and review requests after delivery | Built in | | Wishlists and back-in-stock alerts | Built in | | Bundles and digital downloads | Built in | | Subscriptions, pre-orders, try before you buy | Built in | | Points, VIP tiers, referrals, paid memberships | Built in | | Tiered and volume discounts, flash sales | Built in | | Browse abandonment and push to shoppers | Built in | | Serial and lot tracking, barcode label printing | Built in | | Staff commissions at the register | Built in | | B2B quotes | Built in | | Amazon, eBay and Walmart marketplace sync | Built in, behind a connector interface | | A Kanban fulfilment board with bins and pick lists | Built in | The sales pipeline puts every open cart next to every open order on one board: browsing, at checkout, reminded, paid, fulfilling, shipped, delivered, return requested. Dragging a card does the real thing. Drag a cart to "reminded" and the recovery mail goes out. Drag an order to "shipped" and it ships. The server refuses any move that doesn't make sense. Shopify keeps abandoned checkouts and orders on separate pages. Every cart on that board carries a purchase intent score , built from product views, return visits, time on product pages, cart value and past orders, with the reasons written in words on the card. A merchant knows which cart to chase before lunch. The assistant answers from the store's own numbers, through a fixed set of queries the model calls as tools. The owner picks the provider OpenAI, Anthropic, Gemini or any compatible server and the key never leaves the server. With no provider at all, the same screens answer by rules. And the whole thing is yours . Self-hosted, with the source, under a license that lets you copy it, change it and sell it. Retail floors have dead spots, and payment terminals go offline at the worst possible time. Bazaar's register keeps every sale on the device and uploads when it reconnects. The trick that makes it safe is boring and correct: each sale carries an id the register made, and the server stores it as unique. final String clientId = clientId storeId, sale.clientId .trim ; StoreOrder again = existing clientId ; if again = null { // The answer was lost and the register retried: record it once. return duplicate sale, again ; } Send a batch twice and every sale lands once, and stock moves once. A sale is never refused for lack of stock, because the goods already left with the customer. It's marked oversold and audited instead. The backend compiles ahead of time to a native server with no class loader, so a plugin can't be loaded into it. That's a feature. A plugin that shares your memory, threads and database connections is one slow plugin away from slowing every store on the platform. So a Bazaar app is a separate web service, in any language. It installs with OAuth and PKCE, reads and writes through scoped tokens, and hears about events through signed webhooks. Its UI extensions are JSON trees over a fixed set of blocks that the merchant app draws with its own components, so there is no script in a block. Checkout logic is a tiny language that Bazaar compiles, verifies and runs with a fixed instruction budget. Here's a pair deal and a bulk discount: for line in lines { if line.quantity = 2 { emit line discount line.index, line.total / 4, "Pair deal" ; } } if cart.quantity = 3 { emit discount 100, "Three and up" ; } Every loop walks a list, so every loop ends. Overflow stops the function. An app that doesn't answer in time is left out, not waited for. The Extending Bazaar https://www.codenameone.com/developer-guide/ extending-bazaar chapter walks through a complete sample app, Restock Alerts, from install to its checkout field. We could have shipped the storefront as the same Java app compiled to JavaScript. We do that for the back office in the browser, where it's the right call: it's an app, staff use it all day, and it's the same code as the tablet. A storefront is a different animal. It's a web page. It has to paint before a shopper loses interest, work without JavaScript, open from a link in an email, and rank on Google. For that, HTML is the best tool ever made. Better than React, better than any framework that ships a runtime to render the text that was already in the response. So product, collection, cart, checkout and account pages are server-rendered templates with titles, canonical links, JSON-LD and a sitemap. Small interactions use htmx https://htmx.org/ , and every one of them falls back to a plain form post. Changing the postal code at checkout refreshes the delivery rates and nothing else: