Skip to content

xronocode/kodex-marketplace-frontend

Repository files navigation

Kodex Frontend

License: MIT Vue 3.5 TypeScript 5.x Vite 6.x

AI-Ready Marketplace Platform β€” Vue 3 + TypeScript frontend with Agentic Commerce UI

Part of the Kodex open-source marketplace platform built entirely using AI tools under the GRACE methodology.

πŸš€ Features

  • Infinite Scroll Catalog β€” Seamless browsing with 100+ products
  • Product Detail Modal β€” Sortable offers by price or delivery date
  • Natural Language Search β€” Agent-powered product discovery
  • Voice Search β€” Web Speech API integration with graceful fallback
  • Admin Panel β€” Full CRUD for products and offers
  • JWT Authentication β€” Secure admin access
  • Feature-Sliced Design β€” Scalable, maintainable architecture

πŸ“¦ Tech Stack

Component Technology
Framework Vue 3.5.x
Language TypeScript 5.x
Build Tool Vite 6.x
Router Vue Router 4.x
State Pinia 2.x
HTTP Client Axios 1.x
Testing Vitest 2.x
Linting ESLint 9.x

🏁 Quick Start

Option 1: Docker Compose (Recommended)

# From the kodex-infra directory
cd ../kodex-infra
docker compose up --build

Frontend will be available at http://localhost:5173

Option 2: Local Development

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit VITE_API_BASE_URL=http://localhost:8000

# Start dev server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

πŸ§ͺ Testing & Quality

# Run tests
npm run test              # vitest run
npm run test:coverage     # vitest run --coverage

# Type checking
npm run type-check        # vue-tsc --noEmit

# Linting
npm run lint              # eslint .
npm run lint:fix          # eslint . --fix

πŸ— Feature-Sliced Design (FSD) Architecture

src/
β”œβ”€β”€ app/                  # Application bootstrap
β”‚   β”œβ”€β”€ App.vue           # Root component
β”‚   β”œβ”€β”€ router.ts         # Vue Router configuration
β”‚   └── index.ts          # App entry point
β”‚
β”œβ”€β”€ pages/                # Route-level components
β”‚   β”œβ”€β”€ catalog/          # Catalog page (infinite scroll)
β”‚   β”œβ”€β”€ product/          # Product detail modal
β”‚   └── admin/            # Admin panel + login
β”‚
β”œβ”€β”€ widgets/              # Composite components
β”‚   β”œβ”€β”€ product-card/     # ProductCard component
β”‚   β”œβ”€β”€ product-modal/    # ProductModal with offers
β”‚   └── products-table/   # Admin products table
β”‚
β”œβ”€β”€ features/             # User actions & interactions
β”‚   β”œβ”€β”€ infinite-scroll/  # useInfiniteScroll composable
β”‚   β”œβ”€β”€ product-sort/     # useSortOffers composable
β”‚   β”œβ”€β”€ voice-search/     # useVoiceSearch composable
β”‚   └── admin-auth/       # useAdminAuth composable
β”‚
β”œβ”€β”€ entities/             # Domain models & API calls
β”‚   β”œβ”€β”€ product/          # Product types + API
β”‚   β”œβ”€β”€ offer/            # Offer types + API
β”‚   └── seller/           # Seller types
β”‚
└── shared/               # Shared utilities
    β”œβ”€β”€ api/              # Axios client + API methods
    β”œβ”€β”€ ui/               # Reusable UI components
    β”œβ”€β”€ lib/              # Utility functions
    └── styles/           # Global styles & tokens

Import Rules

  • Each layer may only import from layers below it
  • Cross-slice internal imports are forbidden (ESLint enforced)
  • Public API only β€” import through index.ts files

🎨 UI Components

Shared UI (Primitive Components)

Component Description
Button Primary/secondary/ghost variants
Badge Status badges (success, warning, error)
Spinner Loading indicator with customizable size

Widgets (Composite Components)

Component Description
ProductCard Product image, title, price, delivery date
ProductModal Full product detail with sortable offers
ProductsTable Admin table with CRUD actions

πŸ€– Agent Integration

The frontend integrates with the backend's Agent layer for natural language search:

import { agentSearch } from '@/shared/api/agentApi'

const results = await agentSearch('cheap laptops delivered tomorrow')

See docs/ai/AI_WORKFLOW.md for the complete AI integration methodology.

πŸ€– AI Stack

This project was built 100% with AI coding assistants under human engineering supervision:

Category Tools
AI IDEs Antigravity / VS Code
Code Editors VS Code / Kilo Code / QwenCode / Codex
LLM Models Claude / Gemini / Qwen / GLM-5/5.1

Development Methodology

  • GRACE (Graph-RAG Anchored Code Engineering) β€” Contract-first development with semantic markup
  • Human-in-the-Loop β€” All AI-generated code reviewed and validated by senior engineer
  • Verification-Driven β€” Every module has contracts, tests, and knowledge graph links

🌐 Environment Variables

Variable Description Default
VITE_API_BASE_URL Backend API URL http://localhost:8000

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

πŸ”— Related Repositories

πŸ“– Documentation

πŸ›  Development Conventions

  • TypeScript strict mode β€” Full type safety
  • ESLint + Prettier β€” Consistent code style
  • Component specs β€” .spec.ts files for unit tests
  • Composables β€” Reusable logic with .test.ts coverage
  • No internal slice access β€” Features cannot import other features' internals

🎯 Implemented Use Cases

UC Description Status
UC-001 Browse catalog with infinite scroll βœ…
UC-002 Product detail with sortable offers βœ…
UC-003 Admin JWT authentication βœ…
UC-004 Admin catalog CRUD βœ…
UC-005 Seed script integration βœ…
UC-006 Agent search with NL parsing βœ…

Built with ❀️ using AI + Human Engineering Supervision

Releases

No releases published

Packages

 
 
 

Contributors