How sametkayik/ecommerce-frontend works
Main Components
• UI / Presentation Layer:
• Pages: Represent the various views (e.g., Home, About Us, Blog, Product Detail, Cart, Checkout, Vendor Dashboard) defined in the pages/ directory.
• Layouts: Show the default layouts, error pages, and headless layout (layouts/ directory) that structure the visual presentation.
• State Management:
• Vuex Store: Indicate the global state in store/auth.js, store/darkmode.js, and modules like cart.js and products.js.
• Assets & Theme:
• Static assets like images, CSS stylesheets, and fonts (assets/ directory).
• Middleware:
• Auth and no-auth middleware (middleware/ directory) that protect routes and manage access.
• Plugins & Integration:
• Nuxt Plugins such as axios.js (for API calls), darkmode.js, persistence.js, signalr.js (for real‑time messaging) which integrate external services.
• External Services:
• Backend API: Represent the separate e-commerce microservices backend that this frontend interfaces with.
• Real-time Messaging/SignalR: Show the integration for live chat functionality.
Relationships and Interactions
• Pages use Layouts and Components to render views. They are the entry points (routing) tied to components that fulfill different functionalities.
• Components interact with the Vuex store to fetch and update state (e.g., handling cart operations, user authentication, dark mode settings).
• Plugins (like axios, signalr) serve as the integration layer between the application and external services (backend APIs, real-time messaging).
• Middleware runs before page transitions to enforce authentication or redirection policies, thus serving as a gatekeeper in the navigation workflow.
• Assets are used by both pages and components to render visual elements and maintain a consistent theme.
Architectural Patterns and Technologies
• MVVM/MVC Patterns: The separation of concerns is evident through clearly delineated pages (controllers/views), components (view logic), and Vuex (application state/model).
• Modular Design: The project’s modular file structure (components, pages, store modules, plugins) supports extensibility and maintainability.
• Integration via Nuxt Plugins: The use of axios for API communication, darkmode and persistence for user preferences, and signalr for real-time interactions.
• Nuxt.js Conventions: The framework’s convention-based routing (pages folder) and file-based component organization play a key role in system architecture.
Summary of How to Present It
• Supporting infrastructure: Vuex store (state management), middleware (security/route guarding), and the asset layer (styles, images, fonts).
• Data communications:
• Frontend sends requests via axios (in plugins) to the External Backend API.
• SignalR plugin enables real‑time messaging integration.