How weskat/stockmanager works
Main Components Identification
a) Frontend Layer:
• Client-Side Components (React/Next.js)
• Pages (/app directory - Next.js App Router)
• UI Components (Shadcn UI library)
• Styling (Tailwind CSS)
b) API Layer:
• Next.js API Routes (/app/api)
• Stock Management Endpoint
c) Data Layer:
• CSV Data Source
• Data Processing Utilities
┌─────────────────────────────────────────────────────────────┐
• Client Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Pages │ │ Layout │ │ UI │ │
• Overview │ │ - Header │ │ Components │ │
• Home │ │ - Footer │ │ (Shadcn UI) │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
• ▼ ▼
┌─────────────────────────────────────────────────────────────┐
• API Layer │
• ┌─────────────────────────────────────────┐ │
• /api/stock Route │ │
• ┘ │
• ┘
• ▼
┌─────────────────────────────────────────────────────────────┐
• Data Layer │
• ┌─────────────┐ ┌─────────────────────────────┐ │
• CSV Data │ -> │ Data Processing │ │
• Source │ │ (convertCsvData.ts, │ │
• divideProductsInSegments) │ │
• ┘ └─────────────────────────────┘ │
• ┘
Important Details
a) Client Layer:
• Next.js App Router structure
• Main pages: Overview and Home
• Component hierarchy with Layout components
• UI component library integration
b) API Layer:
• API route handling stock data
• Connection between client and API
c) Data Layer:
• Demonstrate CSV data flow
• Data transformation utilities
Flow Indicators
• Data flow from CSV to API
• API responses to client
• Component relationships
• Data processing pipeline