Building an e-commerce storefront on Firebase and Angular
Most e-commerce tutorials start with an ORM decision and end three thousand words later without a working checkout. This one is the opposite: the goal is a real, working single-page storefront — product listing, cart, auth, and a checkout flow — using tooling you can actually ship with on day one.
Firebase earns its place here because it collapses three normally separate backend concerns — authentication, a database, and hosting — into one console. For a storefront that doesn't need bespoke backend logic on every request, that's not a shortcut, it's the right amount of infrastructure. Firestore's document model maps cleanly onto products, carts, and orders without forcing a schema migration every time you add a variant.
The architecture is intentionally boring: an Angular SPA talks directly to Firestore for reads (product catalog, categories) and to Firebase Authentication for session state, with a thin Cloud Function sitting in front of anything that touches payment — because client-side code should never be trusted with the final say on what a customer gets charged.
Cart state lives in a Firestore document keyed to the authenticated user, synced in real time, which — as a side effect of using Firebase at all — gives you cart persistence across devices for free. That's the kind of feature that would normally cost a sprint; here it falls out of the platform choice.
Checkout is where the 'thin Cloud Function' pattern matters most: the client submits an intent (cart contents, shipping address), and a server-side function is the only thing authorized to calculate the final total, apply discounts, and confirm the charge. Everything upstream of that function is UI. Everything at and after it is the part you actually have to get right.
The result isn't a toy — it's a storefront pattern that holds up past the demo, because the boundary between 'trust the client' and 'trust the server' is drawn in the one place it actually matters: money changing hands.