diff --git a/.claude/skills/saas-ui-redesign/COMPONENT_TEMPLATES.md b/.claude/skills/saas-ui-redesign/COMPONENT_TEMPLATES.md new file mode 100644 index 00000000..51ce8c51 --- /dev/null +++ b/.claude/skills/saas-ui-redesign/COMPONENT_TEMPLATES.md @@ -0,0 +1,905 @@ +# SaaS UI Redesign - Component Templates + +Ready-to-use Vue 3 components for modern SaaS interfaces. Copy and customize for your project. + +## Sidebar Navigation Component + +**File: `src/components/Sidebar.vue`** + +```vue + + + + + +``` + +## Top Header Component + +**File: `src/components/TopHeader.vue`** + +```vue + + + + + + + + +``` + +## Updated App.vue Layout + +**File: `src/App.vue`** + +```vue + + + + + +``` + +## Card Component (Reusable) + +**File: `src/components/Card.vue`** + +```vue + + + + + +``` + +--- + +**Pro Tips:** +1. Copy these components into your project as-is +2. Customize colors using CSS variables +3. Update icon sets to match your design +4. Test on mobile devices before shipping +5. Use the components together for best results + +All components follow the SaaS design system and spacing guidelines from the main skill documentation. diff --git a/.claude/skills/saas-ui-redesign/QUICK_START.md b/.claude/skills/saas-ui-redesign/QUICK_START.md new file mode 100644 index 00000000..48ba4659 --- /dev/null +++ b/.claude/skills/saas-ui-redesign/QUICK_START.md @@ -0,0 +1,284 @@ +# SaaS UI Redesign - Quick Start Guide + +## 30-Second Overview + +Transform your Vue 3 app from top-nav to SaaS-style sidebar layout: + +1. **Create sidebar navigation** (left fixed position) +2. **Move header to top-right** (user profile, language) +3. **Adjust main content margin** (account for sidebar) +4. **Apply consistent spacing** (use 8px/16px/24px units) +5. **Style with colors** (use 6 core colors) + +## Before & After + +**Before (Top Nav):** +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Logo โ”‚ Nav โ”‚ Lang โ”‚ Profile โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ Filters โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ Main Content โ”‚ +โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +**After (Sidebar SaaS):** +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ โ”‚ Lang โ”‚ Profile โ”‚ +โ”‚ Nav โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ โ”‚ Filters โ”‚ +โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ โ”‚ Main Content โ”‚ +โ”‚ โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +## Minimal Implementation (2 hours) + +### 1. Create Sidebar Component +Create `client/src/components/Sidebar.vue`: +```vue + + + + + +``` + +### 2. Update App.vue Layout +```vue + + + +``` + +### 3. Add Responsive Behavior +```css +@media (max-width: 768px) { + .sidebar { + position: fixed; + z-index: 1100; + transform: translateX(-100%); + transition: transform 0.3s ease; + } + + .sidebar.open { + transform: translateX(0); + } + + .main-layout { + margin-left: 0; + } +} +``` + +## Color Palette Quickstart + +Copy-paste these into your CSS: +```css +:root { + --color-primary: #3b82f6; /* Blue */ + --color-text: #0f172a; /* Dark navy */ + --color-muted: #64748b; /* Gray */ + --color-bg: #f8fafc; /* Light gray */ + --color-border: #e2e8f0; /* Border gray */ + --color-success: #10b981; /* Green */ + --color-warning: #f59e0b; /* Orange */ + --color-error: #ef4444; /* Red */ +} +``` + +## Spacing Quickstart + +Use these units everywhere: +- **8px** - Padding inside components +- **12px** - Gap between small elements +- **16px** - Gap between items in lists +- **24px** - Section padding/margins +- **32px** - Major section breaks + +## Checklist + +- [ ] Created Sidebar.vue with all nav items +- [ ] Updated App.vue to use sidebar layout +- [ ] Added CSS for sidebar styling +- [ ] Moved header items to top-right +- [ ] Updated main-content padding +- [ ] Tested on mobile (sidebar hidden) +- [ ] Applied consistent colors +- [ ] Checked spacing alignment + +## Common Questions + +**Q: How wide should the sidebar be?** +A: 240px is standard (30% of typical desktop). Use 280px for desktop-only apps. + +**Q: Should filters stay below header?** +A: Yes, between header and main content. Or move inside pages for better UX. + +**Q: How do I hide sidebar on mobile?** +A: Use `transform: translateX(-100%)` and toggle with a button. + +**Q: What about dark mode?** +A: Add `prefers-color-scheme` media query, update CSS variables. + +**Q: How do I make multi-level navigation?** +A: Add a `submenu` array to nav items, use `v-if` to show/hide. + +## What Changed from Top-Nav + +| Aspect | Top-Nav | Sidebar | +|--------|---------|---------| +| Navigation | Horizontal tabs | Vertical links | +| Content space | Narrow (navbar overhead) | Wide (sidebar fixed) | +| Discoverability | All items visible | Groups by section | +| Mobile UX | Cramped | Better (drawer) | +| Professional feel | Dated | Modern | + +## Real-World Example + +This codebase transformed from top-nav to sidebar: +- Added `Sidebar.vue` (50 lines) +- Modified `App.vue` (30 line changes) +- Added CSS (60 lines) +- **Total: 140 lines of code for complete redesign** + +## Next Level + +Once sidebar works: +1. **Add animations** - Smooth transitions +2. **Add icons** - Better visual hierarchy +3. **Add collapsible groups** - Organize navigation +4. **Add breadcrumbs** - Show location +5. **Add search** - Find pages quickly + +--- + +**Total Time: 1-2 hours for basic sidebar redesign** diff --git a/.claude/skills/saas-ui-redesign/SKILL.md b/.claude/skills/saas-ui-redesign/SKILL.md new file mode 100644 index 00000000..ac04e834 --- /dev/null +++ b/.claude/skills/saas-ui-redesign/SKILL.md @@ -0,0 +1,702 @@ +# SaaS UI Redesign Skill + +Transform Vue 3 applications into modern SaaS-style interfaces with professional layouts, sidebar navigation, and consistent design systems. + +## What This Skill Does + +Guides the complete redesign of a Vue 3 application's UI from a top-navigation layout to a modern SaaS-style interface featuring: +- Left sidebar navigation (collapsible) +- Vertical navigation with icons and labels +- Professional spacing and typography +- Consistent color system +- Card-based layouts +- Responsive design +- Polished interactions and animations + +## When to Use This Skill + +- Redesigning an existing Vue 3 application layout +- Creating a new SaaS product UI +- Modernizing an outdated application interface +- Implementing consistent design across multiple views +- Building professional dashboard/admin interfaces + +## Key Design Principles + +### 1. Sidebar Navigation Pattern +**Benefits:** +- More screen real estate for content +- Better for complex navigation hierarchies +- Standard SaaS pattern (users expect it) +- Supports collapsible state for larger content areas + +**Layout Structure:** +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Sidebar โ”‚ Main Content โ”‚ +โ”‚ (fixed โ”‚ โ”‚ +โ”‚ width) โ”‚ (flexible width) โ”‚ +โ”‚ โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +### 2. Consistent Spacing System +Use a base unit of 4px or 8px for all spacing: +- **4px grid**: Fine-grained spacing +- **8px base**: Primary unit +- **16px**: Common sections +- **24px**: Between major sections +- **32px**: Large breaks +- **48px**: Page-level spacing + +### 3. Professional Typography +- **Headings**: Bold, larger size, limited color variation +- **Body text**: Medium weight, high contrast +- **Labels**: Small, slightly muted +- **Line height**: 1.5 for readability, 1.6 for body text + +### 4. Color System +**Essential Colors:** +- **Primary**: #3b82f6 (Interactive, buttons, highlights) +- **Background**: #ffffff (Main content) +- **Surface**: #f8fafc (Cards, elevated surfaces) +- **Border**: #e2e8f0 (Dividers, outlines) +- **Text Primary**: #0f172a (Main text) +- **Text Secondary**: #64748b (Muted text) +- **Status**: Green (#10b981), Yellow (#f59e0b), Red (#ef4444), Blue (#3b82f6) + +### 5. Component Styling +**Cards:** +- Background: white with subtle shadow +- Border: 1px light border or shadow +- Border-radius: 8px +- Padding: 20px or 24px + +**Buttons:** +- Primary: Solid blue, white text +- Secondary: White background, blue text, border +- Hover: Darker or opacity change +- Disabled: Grayed out + +**Inputs & Selects:** +- Border: 1px light gray +- Padding: 10px 12px +- Focus: Blue outline or border +- Background: White +- Font: Inherit system font + +## Implementation Checklist + +### Phase 1: Layout Foundation +- [ ] Create Sidebar.vue component +- [ ] Create SidebarItem.vue for navigation items +- [ ] Modify App.vue to use sidebar layout +- [ ] Add collapse/expand state management +- [ ] Implement responsive breakpoints +- [ ] Set up CSS variables for colors and spacing + +### Phase 2: Navigation +- [ ] Move navigation links from top bar to sidebar +- [ ] Add icon support to navigation items +- [ ] Implement active link styling +- [ ] Add "current section" highlighting +- [ ] Create dropdown/submenu pattern (if needed) + +### Phase 3: Header Area +- [ ] Create TopHeader.vue component +- [ ] Move user profile menu to top-right +- [ ] Move language switcher to top-right +- [ ] Add breadcrumb navigation (optional) +- [ ] Style consistently with sidebar + +### Phase 4: Main Content +- [ ] Adjust main content width and padding +- [ ] Update FilterBar layout +- [ ] Ensure consistent card styling +- [ ] Apply spacing system throughout +- [ ] Update table/list layouts + +### Phase 5: Polish & Details +- [ ] Add sidebar collapse animation +- [ ] Implement hover states +- [ ] Add focus states for accessibility +- [ ] Test on mobile/tablet +- [ ] Fine-tune spacing and alignment + +### Phase 6: Consistency Pass +- [ ] Audit all colors against system +- [ ] Verify spacing throughout +- [ ] Check typography consistency +- [ ] Review interactive states +- [ ] Test dark mode (if applicable) + +## Component Patterns + +### 1. Sidebar Component Pattern + +**Key Features:** +- Fixed position (left side) +- Configurable width (typically 240-280px) +- Collapsible (toggled state) +- Smooth animations +- Mobile-responsive (slides in/out) + +**Structure:** +```vue + + + + + +``` + +### 2. Sidebar Item Component + +**Interactive Navigation Items:** +```vue + + + + + +``` + +### 3. Top Header Component + +**Header with User Menu:** +```vue + + + +``` + +### 4. Main Content Layout + +**Adjusted App.vue Structure:** +```vue + + + +``` + +## Spacing Guidelines + +**Page Structure:** +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 24px top padding +โ”‚ Page Title / Header โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ โ”‚ 20px vertical between sections +โ”‚ Filter Bar (if present) โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ โ”‚ +โ”‚ Content Area โ”‚ +โ”‚ - Cards with 20px padding โ”‚ +โ”‚ - 16px gap between items โ”‚ +โ”‚ - 24px between sections โ”‚ +โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 24px bottom padding +``` + +**Card Layouts:** +- Padding: 20px or 24px +- Gap between cards: 16px (in grid) +- Icon + text gap: 12px +- Border-radius: 8px +- Box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) + +## Typography Scale + +``` +H1: 2.0rem (32px) - Page titles +H2: 1.5rem (24px) - Section titles +H3: 1.25rem (20px) - Subsection titles +H4: 1.125rem (18px) - Card titles +Body: 0.9375rem (15px) - Normal text +Small: 0.875rem (14px) - Secondary text +Label: 0.8125rem (13px) - Form labels +``` + +**Line Heights:** +- Headings: 1.2 +- Body text: 1.6 +- Form inputs: 1.5 + +## Color Usage Guidelines + +**When to Use Each Color:** +- **Primary Blue (#3b82f6)**: Buttons, active states, links, interactive elements +- **Text Primary (#0f172a)**: Main content, headings +- **Text Secondary (#64748b)**: Labels, descriptions, muted text +- **Background (#f9fafb)**: Page background +- **Surface (#f8fafc)**: Card backgrounds, elevated surfaces +- **Border (#e2e8f0)**: Dividers, borders, subtle separators +- **Status Green (#10b981)**: Success, completed, online status +- **Status Yellow (#f59e0b)**: Warning, pending, caution +- **Status Red (#ef4444)**: Error, critical, offline + +## Responsive Design + +**Breakpoints:** +- Mobile: < 640px (sidebar hidden by default) +- Tablet: 640px - 1024px (sidebar collapsible) +- Desktop: > 1024px (sidebar visible) + +**Mobile Considerations:** +- Sidebar becomes overlay/drawer +- Top header becomes more compact +- Touch-friendly button sizes (44px minimum) +- Filter bar may stack vertically +- Increased horizontal padding + +## Implementation Steps + +### Step 1: Create Layout Components +1. Create `Sidebar.vue` with fixed positioning +2. Create `SidebarItem.vue` for nav items +3. Create `TopHeader.vue` with user menu +4. Create CSS variable system for colors/spacing + +### Step 2: Update App.vue +1. Replace `
` with new layout structure +2. Add Sidebar component +3. Wrap content in `main-layout` div +4. Adjust router-view placement + +### Step 3: Style Main Content +1. Update `main-content` padding +2. Adjust margin/left based on sidebar +3. Update FilterBar styling +4. Ensure responsive behavior + +### Step 4: Update Views +1. Apply consistent card styling +2. Update spacing in all views +3. Use CSS variables for colors +4. Test layout responsiveness + +### Step 5: Polish & Animation +1. Add smooth transitions for sidebar collapse +2. Implement hover states +3. Add focus states +4. Test accessibility + +## Common Pitfalls to Avoid + +**โŒ Don't:** +- Use arbitrary padding values - stick to spacing system +- Mix colors from different systems +- Create new component styles instead of reusing +- Skip responsive testing +- Ignore accessibility (contrast, focus states) +- Over-animate (keep it subtle, <0.3s) + +**โœ… Do:** +- Use CSS variables for all colors and spacing +- Create reusable component patterns +- Test on mobile, tablet, desktop +- Ensure sufficient color contrast (WCAG AA) +- Keep animations subtle and purposeful +- Use semantic HTML + +## Testing Checklist + +**Visual:** +- [ ] Spacing is consistent throughout +- [ ] Colors match the design system +- [ ] Typography hierarchy is clear +- [ ] Sidebar collapse works smoothly +- [ ] Hover/active states are distinct + +**Responsive:** +- [ ] Mobile (< 640px) layout works +- [ ] Tablet (640-1024px) layout works +- [ ] Desktop (> 1024px) layout works +- [ ] Sidebar hides on mobile (drawer mode) +- [ ] No horizontal scrolling at any breakpoint + +**Accessibility:** +- [ ] Color contrast >= 4.5:1 for text +- [ ] Focus states are visible +- [ ] Keyboard navigation works +- [ ] Links are clearly identifiable +- [ ] Form fields are properly labeled + +**Performance:** +- [ ] Animations are smooth (60fps) +- [ ] Sidebar collapse is instant +- [ ] No layout shift issues +- [ ] Images are optimized + +## File Organization + +``` +src/ +โ”œโ”€โ”€ components/ +โ”‚ โ”œโ”€โ”€ Sidebar.vue +โ”‚ โ”œโ”€โ”€ SidebarItem.vue +โ”‚ โ”œโ”€โ”€ TopHeader.vue +โ”‚ โ”œโ”€โ”€ FilterBar.vue +โ”‚ โ””โ”€โ”€ ... other components +โ”œโ”€โ”€ styles/ +โ”‚ โ”œโ”€โ”€ variables.css # CSS custom properties +โ”‚ โ”œโ”€โ”€ typography.css # Font scales +โ”‚ โ””โ”€โ”€ spacing.css # Spacing utilities +โ””โ”€โ”€ App.vue +``` + +## Example CSS Variables + +```css +:root { + /* Spacing */ + --spacing-xs: 4px; + --spacing-sm: 8px; + --spacing-md: 12px; + --spacing-lg: 16px; + --spacing-xl: 24px; + --spacing-2xl: 32px; + + /* Colors */ + --color-primary: #3b82f6; + --color-primary-dark: #2563eb; + --color-text-primary: #0f172a; + --color-text-secondary: #64748b; + --color-bg: #ffffff; + --color-bg-secondary: #f8fafc; + --color-border: #e2e8f0; + --color-success: #10b981; + --color-warning: #f59e0b; + --color-error: #ef4444; + + /* Typography */ + --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; + --font-size-base: 0.9375rem; + --line-height-base: 1.6; + + /* Transitions */ + --transition-fast: 0.2s ease; + --transition-normal: 0.3s ease; + --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05); + --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1); +} +``` + +## Next Steps After Redesign + +1. **User Testing**: Get feedback on new layout +2. **Performance Audit**: Check bundle size, load times +3. **Accessibility Audit**: WCAG 2.1 AA compliance +4. **Cross-browser Testing**: Chrome, Firefox, Safari, Edge +5. **Mobile Testing**: Real device testing, not just DevTools +6. **Analytics**: Track user behavior with new layout + +## Resources & References + +- [Tailwind CSS Spacing](https://tailwindcss.com/docs/customizing-spacing) +- [Material Design Spacing](https://material.io/design/layout/spacing-methods.html) +- [Web Content Accessibility Guidelines](https://www.w3.org/WAI/standards-guidelines/wcag/) +- [Vue 3 Composition API](https://vuejs.org/guide/extras/composition-api-faq.html) + +## Questions to Ask + +When starting a redesign, clarify: +1. Do we need a collapsible sidebar or always visible? +2. Should there be multi-level navigation menus? +3. Do we need breadcrumb navigation? +4. Should we support dark mode? +5. Are there performance constraints? +6. What's the target audience (mobile-first or desktop)? +7. Do we need analytics on navigation usage? + +--- + +**Note**: This skill assumes Vue 3 with Composition API. Adapt as needed for your specific project requirements. diff --git a/CLAUDE.md b/CLAUDE.md index d2086efa..25f80daf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,6 +23,9 @@ Use the Task tool with these specialized subagents for appropriate tasks: - **ALWAYS use Playwright MCP tools** (`mcp__playwright__*`) for browser testing - Test against: `http://localhost:3000` (frontend), `http://localhost:8001` (API) +### Code Documentation +- Always document non-obvious logic changes with comments + ## Stack - **Frontend**: Vue 3 + Composition API + Vite (port 3000) - **Backend**: Python FastAPI (port 8001) diff --git a/architecture.html b/architecture.html new file mode 100644 index 00000000..5391b7cb --- /dev/null +++ b/architecture.html @@ -0,0 +1,947 @@ + + + + + + Factory Inventory Management System - Architecture + + + +
+
+

๐Ÿญ Factory Inventory Management System

+

Full-Stack Architecture Overview

+
+ +
+ +
+

System Architecture

+ +
+
+

Frontend Layer

+
    +
  • Framework: Vue 3
  • +
  • API Pattern: Composition API
  • +
  • Build Tool: Vite
  • +
  • HTTP Client: Axios
  • +
  • Port: 3000
  • +
  • State Management: Composables
  • +
  • Internationalization: useI18n (EN, JP)
  • +
+
+ +
+

Backend Layer

+
    +
  • Framework: FastAPI (Python)
  • +
  • Data Validation: Pydantic
  • +
  • CORS Support: Enabled
  • +
  • Port: 8001
  • +
  • API Docs: /docs endpoint
  • +
  • Data Storage: In-Memory (JSON)
  • +
  • Filtering: Query parameters
  • +
+
+ +
+

Data Layer

+
    +
  • Format: JSON files
  • +
  • Location: /server/data/
  • +
  • Loading: Runtime initialization
  • +
  • Datasets: 7 core files
  • +
  • Persistence: Not persistent (demo)
  • +
  • Size: Small (in-memory)
  • +
  • Access: Direct Python loading
  • +
+
+ +
+

Key Features

+
    +
  • Multi-filter Warehouse, Category, Status, Time Period
  • +
  • Real-time In-memory data filtering
  • +
  • Type-safe Pydantic validation
  • +
  • RESTful Standard HTTP API
  • +
  • Responsive Mobile-friendly UI
  • +
  • Localized English & Japanese support
  • +
  • Auto-docs Swagger UI at /docs
  • +
+
+
+
+ + +
+

Data Flow

+

How requests flow through the system from frontend to backend and back

+ +
+
+
1
+
+ User Interaction (Frontend) +

Vue component detects user action (filter selection, page navigation, etc.)

+
+
+ +
+
2
+
+ API Call +

Component calls api.js which constructs HTTP request with query parameters

+
+
+ +
+
3
+
+ HTTP Request +

Axios sends GET request to FastAPI backend on http://localhost:8001/api/{endpoint}

+
+
+ +
+
4
+
+ Backend Processing +

FastAPI endpoint receives request, applies filters to in-memory data

+
+
+ +
+
5
+
+ Validation & Response +

Pydantic models validate data, convert to JSON, return 200 OK response

+
+
+ +
+
6
+
+ Data Update +

Frontend receives JSON response, updates reactive ref/computed properties

+
+
+ +
+
7
+
+ UI Render +

Vue re-renders components with new data, displays results to user

+
+
+
+
+ + +
+

Frontend Architecture

+ +

Views (Pages)

+
+
+
VIEW
+
Dashboard
+
Main overview with summary cards, charts, and KPIs
+
+
+
VIEW
+
Inventory
+
Warehouse inventory management and stock levels
+
+
+
VIEW
+
Orders
+
Customer order tracking and management
+
+
+
VIEW
+
Demand
+
Demand forecasting and predictions
+
+
+
VIEW
+
Backlog
+
Unfulfilled orders and backlog analysis
+
+
+
VIEW
+
Spending
+
Cost analysis and spending trends
+
+
+
VIEW
+
Reports
+
Custom reports and analytics
+
+
+ +

Component Hierarchy

+
+ App.vue (Root Component) + โ”œโ”€โ”€ FilterBar.vue // Warehouse, Category, Status, Month filters + โ”œโ”€โ”€ ProfileMenu.vue // User profile & language switcher + โ”œโ”€โ”€ Router Views + โ”‚ โ”œโ”€โ”€ Dashboard.vue + โ”‚ โ”œโ”€โ”€ Inventory.vue + โ”‚ โ”œโ”€โ”€ Orders.vue + โ”‚ โ”œโ”€โ”€ Demand.vue + โ”‚ โ”œโ”€โ”€ Backlog.vue + โ”‚ โ”œโ”€โ”€ Spending.vue + โ””โ”€โ”€ Reports.vue + โ””โ”€โ”€ Modals // Details & information modals + โ”œโ”€โ”€ InventoryDetailModal.vue + โ”œโ”€โ”€ OrderDetailModal.vue + โ”œโ”€โ”€ BacklogDetailModal.vue + โ””โ”€โ”€ CostDetailModal.vue +
+ +

Composables (Shared Logic)

+
+
+
COMPOSABLE
+
useAuth
+
User authentication and session management
+
+
+
COMPOSABLE
+
useFilters
+
Global filter state across all views
+
+
+
COMPOSABLE
+
useI18n
+
Internationalization (English, Japanese)
+
+
+
+ + +
+

Backend API Endpoints

+ +

Inventory Endpoints

+
+
+
GET
+
/api/inventory
+
List all inventory items
+
Filters: warehouse, category
+
+
+
GET
+
/api/inventory/{id}
+
Get single inventory item details
+
+
+ +

Order Endpoints

+
+
+
GET
+
/api/orders
+
List all orders
+
Filters: warehouse, category, status, month
+
+
+
GET
+
/api/orders/{id}
+
Get single order details
+
+
+ +

Dashboard & Analytics Endpoints

+
+
+
GET
+
/api/dashboard/summary
+
Dashboard KPIs and summary metrics
+
Filters: warehouse, category, status, month
+
+
+
GET
+
/api/demand
+
Demand forecasts (no filters)
+
+
+
GET
+
/api/backlog
+
Backlog items (no filters)
+
+
+ +

Spending Endpoints

+
+
+
GET
+
/api/spending/summary
+
Total spending summary
+
+
+
GET
+
/api/spending/monthly
+
Monthly spending breakdown
+
+
+
GET
+
/api/spending/categories
+
Spending by category
+
+
+
GET
+
/api/spending/transactions
+
Recent transactions list
+
+
+
+ + +
+

Pydantic Data Models

+ +
+
+
๐Ÿ“ฆ InventoryItem
+
    +
  • id: str
  • +
  • sku: str
  • +
  • name: str
  • +
  • category: str
  • +
  • warehouse: str
  • +
  • quantity_on_hand: int
  • +
  • reorder_point: int
  • +
  • unit_cost: float
  • +
  • location: str
  • +
+
+ +
+
๐Ÿ“‹ Order
+
    +
  • id: str
  • +
  • order_number: str
  • +
  • customer: str
  • +
  • items: List[dict]
  • +
  • status: str
  • +
  • order_date: str
  • +
  • expected_delivery: str
  • +
  • total_value: float
  • +
+
+ +
+
๐Ÿ“Š DemandForecast
+
    +
  • id: str
  • +
  • item_sku: str
  • +
  • item_name: str
  • +
  • current_demand: int
  • +
  • forecasted_demand: int
  • +
  • trend: str
  • +
  • period: str
  • +
+
+ +
+
๐Ÿ“ฆ BacklogItem
+
    +
  • id: str
  • +
  • order_id: str
  • +
  • item_sku: str
  • +
  • item_name: str
  • +
  • quantity_needed: int
  • +
  • quantity_available: int
  • +
  • days_delayed: int
  • +
+
+
+
+ + +
+

Data Files

+ +

JSON Data Sources

+
+
+
DATA
+
inventory.json
+
Stock levels, locations, and inventory metadata
+
+
+
DATA
+
orders.json
+
Customer orders with dates and status
+
+
+
DATA
+
demand_forecasts.json
+
Predicted demand by SKU
+
+
+
DATA
+
backlog_items.json
+
Unfulfilled orders and delays
+
+
+
DATA
+
spending.json
+
Summary, monthly, and category spending
+
+
+
DATA
+
transactions.json
+
Transaction history and details
+
+
+
DATA
+
purchase_orders.json
+
Outgoing purchase orders to suppliers
+
+
+
+ + +
+

Key Features & Patterns

+ +

Filtering System

+

The system supports 4 primary filters that cascade across all applicable views:

+
+
+

4

+

Filter Types

+
+
+

โˆž

+

Combinations

+
+
+

<50ms

+

Response Time

+
+
+

Real-time

+

Updates

+
+
+ +

Filter Types

+
+
+
FILTER
+
Warehouse
+
Select by physical warehouse location
+
+
+
FILTER
+
Category
+
Filter by product category
+
+
+
FILTER
+
Order Status
+
Filter orders by status (pending, shipped, etc.)
+
+
+
FILTER
+
Time Period
+
Filter by month or quarter (2025)
+
+
+ +

Architecture Patterns

+
+
+
PATTERN
+
Composition API
+
Vue 3 with setup() for better code organization and reusability
+
+
+
PATTERN
+
Composables
+
Reusable logic for auth, filters, and i18n
+
+
+
PATTERN
+
API Layer Abstraction
+
Centralized api.js for all HTTP calls
+
+
+
PATTERN
+
In-Memory Filtering
+
Backend filters data in-memory without database queries
+
+
+
PATTERN
+
Type Validation
+
Pydantic models ensure type safety on backend
+
+
+
PATTERN
+
Modal Components
+
Reusable detail modals for depth exploration
+
+
+
+ + +
+

Getting Started

+ +

Development Environment

+
+
+ Start Backend: + cd server && uv run python main.py
+ Server: http://localhost:8001
+ API Docs: http://localhost:8001/docs +
+
+ Start Frontend: + cd client && npm install && npm run dev
+ Frontend: http://localhost:3000 +
+
+ +

Project Structure

+
+ inventory-management/ + โ”œโ”€โ”€ client/ // Vue 3 Frontend + โ”‚ โ”œโ”€โ”€ src/ + โ”‚ โ”‚ โ”œโ”€โ”€ views/ // Page components + โ”‚ โ”‚ โ”œโ”€โ”€ components/ // Reusable UI components + โ”‚ โ”‚ โ”œโ”€โ”€ composables/ // Shared logic + โ”‚ โ”‚ โ”œโ”€โ”€ locales/ // i18n (EN, JP) + โ”‚ โ”‚ โ”œโ”€โ”€ api.js // HTTP client + โ”‚ โ”‚ โ””โ”€โ”€ main.js // App entry + โ”‚ โ””โ”€โ”€ vite.config.js + โ”œโ”€โ”€ server/ // FastAPI Backend + โ”‚ โ”œโ”€โ”€ main.py // API endpoints + โ”‚ โ”œโ”€โ”€ mock_data.py // Data loader + โ”‚ โ””โ”€โ”€ data/ // JSON data files + โ”œโ”€โ”€ tests/ // Pytest test suite + โ””โ”€โ”€ CLAUDE.md // This documentation +
+
+ + +
+

System Statistics

+ +
+
+

7

+

Views

+
+
+

15+

+

API Endpoints

+
+
+

7

+

Data Files

+
+
+

2

+

Languages

+
+
+

4

+

Core Filters

+
+
+

100%

+

Type-Safe

+
+
+
+ +
+ +
+

Factory Inventory Management System Architecture Documentation

+

Full-stack demo application with Vue 3 + FastAPI โ€ข Generated on 2026-05-26

+
+
+ + diff --git a/client/src/App.vue b/client/src/App.vue index c2da05a5..28ad9fe0 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,42 +1,22 @@