|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Development Commands |
| 6 | + |
| 7 | +This is a **Vue Vben Admin 5.0** application built with Vue 3, Vite, and TypeScript in a pnpm monorepo workspace. |
| 8 | + |
| 9 | +### Core Commands |
| 10 | + |
| 11 | +- `pnpm dev` - Start development server with hot reload |
| 12 | +- `pnpm build` - Build for production |
| 13 | +- `pnpm build:analyze` - Build with bundle analysis |
| 14 | +- `pnpm preview` - Preview production build locally |
| 15 | +- `pnpm typecheck` - Run TypeScript type checking |
| 16 | + |
| 17 | +### Workspace Commands (from root) |
| 18 | + |
| 19 | +- `pnpm install` - Install all dependencies across workspace |
| 20 | +- `turbo dev` - Run development across all apps |
| 21 | +- `turbo build` - Build all applications |
| 22 | +- `turbo typecheck` - Type check all packages |
| 23 | + |
| 24 | +## Architecture Overview |
| 25 | + |
| 26 | +### Monorepo Structure |
| 27 | + |
| 28 | +This app is located at `apps/web-np` within a larger monorepo using pnpm workspaces and Turbo for build orchestration. The workspace includes: |
| 29 | + |
| 30 | +- Internal tools (`internal/*`) - Shared configurations (Vite, TypeScript, Tailwind) |
| 31 | +- Core packages (`packages/@core/*`) - Base UI components and utilities |
| 32 | +- Business packages (`packages/business/*`) - Domain-specific components |
| 33 | +- Multiple applications (`apps/*`) |
| 34 | + |
| 35 | +### Application Architecture |
| 36 | + |
| 37 | +Built on **Vue Vben Admin 5.0** framework with the following key architectural patterns: |
| 38 | + |
| 39 | +**Bootstrap Process:** |
| 40 | + |
| 41 | +1. `main.ts` → `initApplication()` - Sets up namespace-based preferences |
| 42 | +2. `bootstrap.ts` - Initializes core services (i18n, stores, router, directives) |
| 43 | +3. `app.vue` - Main application component |
| 44 | + |
| 45 | +**Core Systems:** |
| 46 | + |
| 47 | +- **Preferences System**: Namespace-based configuration (`@vben/preferences`) |
| 48 | +- **State Management**: Pinia with workspace stores (`@vben/stores`) |
| 49 | +- **Routing**: Vue Router with dynamic guards and meta-based permissions |
| 50 | +- **Internationalization**: Vue i18n with dynamic loading |
| 51 | +- **UI Framework**: Ant Design Vue with custom theming |
| 52 | +- **Component Adapter**: Pluggable UI component system |
| 53 | + |
| 54 | +### Key Directories |
| 55 | + |
| 56 | +- `src/api/` - API service layer organized by domain (core/, shop.ts) |
| 57 | +- `src/views/` - Page components (ads/, dashboard/, onboard/, reports/) |
| 58 | +- `src/store/` - Pinia stores (shop, currency, system-statistic, shopify-app-bridge) |
| 59 | +- `src/router/` - Route definitions and guards |
| 60 | +- `src/layouts/` - Layout components |
| 61 | +- `src/shared/` - Shared utilities and services |
| 62 | +- `src/adapter/` - Component adapters for UI framework integration |
| 63 | + |
| 64 | +### Configuration |
| 65 | + |
| 66 | +- **Vite**: Custom config extending `@vben/vite-config` with API proxy to `localhost:5320` |
| 67 | +- **TypeScript**: Extends `@vben/tsconfig/web-app.json` with path mapping (`#/*` → `./src/*`) |
| 68 | +- **Environment**: Multiple env files for development, production, UAT with Shopify app integration |
| 69 | +- **Build**: Turbo orchestration with dependency-aware builds and caching |
| 70 | + |
| 71 | +### Key Dependencies |
| 72 | + |
| 73 | +- **Framework**: Vue 3.5, Vite 6.3, TypeScript 5.8 |
| 74 | +- **UI**: Ant Design Vue 4.2, VXE Table, Radix Vue |
| 75 | +- **State**: Pinia 3.0 with persistence plugin |
| 76 | +- **Utilities**: VueUse, dayjs, lodash utilities |
| 77 | +- **Shopify**: `@shopify/app-bridge` for embedded app functionality |
| 78 | + |
| 79 | +### Development Notes |
| 80 | + |
| 81 | +- Uses hash-based routing by default (configurable via `VITE_ROUTER_HISTORY`) |
| 82 | +- Namespace-based preference isolation for multi-tenant scenarios |
| 83 | +- Crisp SDK integration for customer support |
| 84 | +- Dynamic title updates based on route meta |
| 85 | +- Comprehensive directive system (loading, access control) |
0 commit comments