How kauadaviamaro/gabine works
Project type and purpose
• This is a Single-Page Application (SPA) e-commerce front-end called “Gabini Headset Store,” built in Vue.js. It provides an interactive catalog, user flows for browsing products, cart management, authentication, user profile, and an admin interface for managing categories and products.
File structure
• Top-level files:
• index.html – SPA entry point
• vite.config.ts, tsconfig*.json – build and TypeScript configs
• .env(.example) – environment variables (e.g. BACKEND_URL)
• src/ folder breakdown:
• src/App.vue, src/main.ts – application bootstrap
• src/router/ – Vue Router definitions (authRoutes, index)
• src/components/ – reusable UI components (cart card, modals, alerts, admin widgets)
• src/views/ – route-level view components (HomeView, LoginView, CartView, AdminViews, etc.)
• src/services/ – Axios wrappers for REST endpoints (UserService, ProductService, CategoryService, AddressService)
• src/stores/ – Pinia stores for global state (cart, user, alerts, loading)
• src/models/ – TypeScript data models/interfaces (User, Product, Category, Address)
• src/assets/ – static assets (CSS, images)
• src/utils/ – helper functions (debounce)
README for additional insights
• Technology stack: Vue.js, Vue Router, Pinia, Axios, CSS
• Backend API is external and configured via .env
• Intended as a modern, animated, fluid UI mapped from a Figma design
a. Main components to represent
• Client Browser / SPA Container
• Vue Application Core (main.ts + App.vue)
• Vue Router
• Route Views (Home, Products, Cart, Login, Register, Profile, Admin Categories, Admin Products)
• UI Components (Navbar, Hero, ProductCard, CartCard, etc.)
• Pinia Stores (cartStore, userStore, alertStore, loadingStore)
• Services Layer (Axios + service classes)
• External Backend REST API
• Static Asset Host (images, CSS served via Vite dev server or static CDN)
b. Relationships and data-flow
1. User interacts with a View via UI Components.
2. Components dispatch actions to Pinia stores or directly call service methods.
3. Services (Axios) send HTTP requests to the Backend API (CRUD endpoints for products, categories, user, addresses).
4. API returns JSON → Services unwrap and map to models → Stores update state or Components consume responses directly.
5. Pinia store mutations trigger reactive updates in UI Components.
6. Vue Router listens to navigation requests and mounts appropriate Views.
c. Architectural patterns and design principles
• Component-based architecture: small, reusable UI pieces
• Unidirectional data flow: user action → service → store → UI
• Separation of concerns: Services layer for HTTP, Stores for state, Components for presentation
• Route-level code splitting possible via Vue Router (dynamic imports in authRoutes)
• Configuration through .env for environment-specific API endpoints
d. Key technologies, frameworks, and libraries
• Vue.js 3 (Composition or Options API in .vue files)
• Vue Router for client routing
• Pinia for state management
• Axios for HTTP client
• Vite for build and dev server
• TypeScript for typing (models, services)
• CSS and static assets served under /src/assets