How meruemvn/ocop_fe works
Project type and purpose
• This is a Vue.js single-page application (SPA) serving as the front-end for an e-commerce “store” (“OCOP_FE”).
• It provides user flows for browsing products, viewing details, searching, cart management, checkout, user profile, admin/distributor dashboards, and recommendations.
• It communicates with back-end REST services for products, orders, authentication, and recommendations.
File structure
• Top-level config files: .env(.production), babel.config.js, jsconfig.json, vue.config.js, package.json, package-lock.json – indicate Node/NPM + Vue CLI + Babel build pipeline.
• public/: static assets (index.html, images).
• src/main.js: application entry point bootstrapping Vue, router, store.
• src/router/index.js: Vue Router for SPA navigation (views and nested routes).
• src/store/index.js + src/store/modules/: Vuex state management, split by domain (admin, auth, cart, distributor, order, product, recommendation, user).
• src/services/: abstraction over HTTP interactions (api.js generic Axios wrapper; auth.service.js; recommendation.service.js; other domain services via api.js).
• src/components/ & src/views/: UI layer—reusable components and page-level views organized by feature.
• src/directives/: custom Vue directives.
README
• Standard Vue CLI commands (serve, build, lint).
• No additional architecture details provided.
a. Main components
• Browser client (user’s browser)
• Vue SPA:
• Router
• Vuex store (modules: auth, cart, product, order, recommendation, user, distributor, admin)
• Components & Views (UI layer)
• Services layer (API client)
• Build pipeline (Node/NPM, webpack, Babel)
• External APIs (back-end microservices or monolith exposing REST endpoints for auth, products, orders, recommendations)
• Static asset host (CDN or public folder)
b. Relationships & interactions
• Browser <--> Vue SPA via HTTP/Webpack dev server (dev) or static assets + bundle (prod)
• Within SPA, Views dispatch Vuex actions → Services make HTTP calls → Backend APIs
• Responses update Vuex store → Views/components re-render
• Router defines navigational flows between Views
• Build tools (Vue CLI/webpack) take src/ and assets → produce dist/ bundle
c. Architectural patterns
• Modular Vuex store (domain-driven modules)
• Service layer abstracting HTTP (single Axios instance + domain services)
• Component-based UI (atomic/common, feature-specific, view-level)
• SPA with client-side routing
d. Relevant technologies
• Vue.js, Vue Router, Vuex
• Axios (in api.js)
• Babel, webpack (via Vue CLI)
• Node.js / NPM
• CSS assets