From AWS to a Single Server: 15 Engineering Lessons from Building an E-Commerce Platform
Building an e-commerce platform is about much more than creating product pages and a checkout button. Behind the user interface, there are architectural decisions, security concerns, data consistency challenges, and production problems that can make or break the entire system. My team and I built an e-commerce website for a Paris-based startup. Throughout the project, we faced different…
Building an e-commerce platform involves more than just creating product pages and a checkout button. This article explores the architectural and engineering decisions made during the development of a platform for a Paris-based startup.
The team started with an AWS-based architecture, utilizing several managed services. However, after some time, they migrated to an Infrastructure-as-a-Service (IaaS) platform, ultimately running most services on a single high-resource compute machine. This transition highlighted the importance of aligning infrastructure decisions with actual requirements, operational constraints, and trade-offs rather than following architectural trends alone.
Choosing an API-first architecture was a key decision, separating the frontend from the backend. This approach provided flexibility, as the backend could serve different clients without requiring a complete redesign. The team opted for React for the frontend and an API-first strategy, which allowed the backend to expose the application's business capabilities through REST endpoints.
Authentication was another crucial aspect of the project. To mitigate the risk of Cross-Site Scripting (XSS) attacks, the team utilized HttpOnly cookies. HttpOnly cookies prevent client-side JavaScript from directly reading authentication cookies, reducing the risk of token theft. Additionally, the team implemented Role-Based Access Control (RBAC) to manage access to API endpoints based on user roles.
Inventory management across multiple stock locations proved to be an unexpected challenge. Initially, the application was designed for a single stock location during checkout. However, the database model was flexible enough to accommodate the requirement of fulfilling a single product from one or multiple stock locations. This adaptation allowed the application to handle more complex inventory scenarios.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.