# Development Guide ## Quick Start ### 1. First-Time Setup ```bash # Clone repository git clone cd oms-wms-erp # Install dependencies (once) npm install # Or use Makefile make install ``` ### 2. Start Development **Option A: Using npm** ```bash # Terminal 1: Start Vite dev server npm run dev # → http://localhost:5173 # Terminal 2: Start Storybook npm run storybook # → http://localhost:6006 ``` **Option B: Using Makefile** ```bash # Terminal 1 make dev # Terminal 2 make storybook ``` ### 3. Quality Checks ```bash # Before committing, run: make verify # Or individual checks: npm run lint # ESLint + Prettier npm run type-check # TypeScript npm run test:unit # Unit tests npm run build # Production build ``` --- ## Project Structure ``` src/ ├── components/ │ ├── primitives/ # Layer 1: UI building blocks │ │ ├── Button/ │ │ ├── Input/ │ │ ├── Select/ │ │ └── ... (30 total) │ ├── fields/ │ │ ├── typed/ # Layer 2: Type-safe inputs │ │ │ ├── TextField/ │ │ │ └── ... (12 total) │ │ └── domain/ # Layer 3: Business-specific │ │ ├── OrderLineField/ │ │ └── ... (12 total) │ └── composites/ # Layer 4: Full workflows │ ├── Order/ │ └── ... (11 total) ├── stores/ # Pinia state management │ └── modules/ │ ├── orders.ts │ ├── inventory.ts │ └── ... (10 total) ├── views/ # Page components │ ├── Home.vue │ ├── Order/OrderList.vue │ ├── Order/OrderForm.vue │ └── ... ├── services/ # API client, validators, formatters │ ├── api/ │ ├── validators/ │ └── formatters/ ├── router.ts # Vue Router configuration ├── App.vue # Root component └── main.ts # Entry point ``` --- ## Creating New Components ### 1. Primitive Component (Layer 1) **Example: Create TextareaBase** ```bash # Create folder mkdir -p src/components/primitives/Textarea # Create component files cat > src/components/primitives/Textarea/TextareaBase.vue << 'EOF'