Extract the user-input into a detailed markdown document that describes the architecture of the system. Based on user-input, extract the architecture of the system into a detailed markdown document Be sure to explain the primary data models and how they are used in the system Keep explanations thorough but concise Break down the system into major components and explain each one in their own section At the beginning of the document, include a explanation of the business value of this solution and then the high level overview of the system Design a basic e-commerce platform API API --> Auth API --> Products API --> Orders Products --> DB Orders --> DB Products --> Cache ``` ## Component Details 1. Frontend - React.js SPA for dynamic user experience - Server-side rendering for SEO - Trade-off: Added complexity vs better UX 2. API Gateway - Express.js/Node.js for high throughput - Handles routing and basic validation - Trade-off: Additional network hop vs cleaner architecture 3. Services - Microservices for independent scaling - Each service owns its data model - Trade-off: Deployment complexity vs team autonomy ## Key Decisions - Relational DB for orders (data consistency) - Redis cache for products (fast reads) - JWT auth for stateless scaling ]]> {{input}}