How dawydangcode/cakestore-microservice-frontend works
Project type and purpose
• This is a single‐page React frontend (“cakestore-microservice-frontend”) built with Create React App.
• It provides user-facing pages (home, search, product, cart, checkout), authentication flows (login, signup, forgot password, logout), admin dashboards (categories, orders, chat), and a chat widget, all communicating with a set of backend microservices.
File structure
• Top-level: public/ (static assets), src/ (application code), package.json, uml.puml.
• src/api: centralized Axios client for all HTTP calls (base URL, interceptors).
• src/auth & src/context: AuthService/AuthContext for JWT handling; CartContext for shopping-cart state.
• src/components & subfolders: reusable UI components organized by domain (login, products, orders, admin, chat, layout).
• src/pages: route components corresponding to URL paths.
Key insights from README
• Standard CRA setup; no explicit architecture notes.
• Implied deployment: static bundle served by a CDN or webserver; all dynamic behavior relies on REST/WebSocket calls to external APIs.
• Entry point (index.js) → App.js → Routes → Pages → Components
• Context Providers wrapped around App
• axiosClient configured once (base URL, interceptors)
• Microservice endpoint your frontend calls (e.g., /api/auth, /api/products, /api/orders, /api/categories, /api/chat).
• Flow of JWT tokens from AuthService to axiosClient headers.
• WebSocket handshake from ChatWidget to the Chat Service.
• Separation of concerns and scalability points (each microservice can deploy independently).