12 Commits

Author SHA1 Message Date
DaX
ff6abdeef0 Add sales tracking system with customers, analytics, and inventory management
All checks were successful
Deploy / deploy (push) Successful in 2m26s
- Add customers table (021) and sales/sale_items tables (022) migrations
- Add customer CRUD, sale CRUD (transactional with auto inventory decrement/restore),
  and analytics API endpoints (overview, top sellers, revenue chart, inventory alerts)
- Add sales page with NewSaleModal (customer autocomplete, multi-item form,
  color-based pricing, stock validation) and SaleDetailModal
- Add customers page with search, inline editing, and purchase history
- Add analytics dashboard with recharts (revenue line chart, top sellers bar,
  refill vs spulna pie chart, inventory alerts table with stockout estimates)
- Add customerService, saleService, analyticsService to frontend API layer
- Update sidebar navigation on all admin pages
2026-03-04 23:58:57 +01:00
DaX
a854fd5524 Upgrade to Next.js 16.1.6, React 19.2.4, and update all dependencies
All checks were successful
Deploy / deploy (push) Successful in 59s
- Next.js 15.5 → 16.1.6 (Turbopack default, faster builds)
- React/React-DOM 19.1 → 19.2.4
- @types/react 18 → 19, @types/react-dom 18 → 19
- TypeScript 5.2 → 5.9
- CI Node.js 18 → 20 (required by Next.js 16)
- Replace removed next lint with standalone ESLint config
- Auto-updated tsconfig.json (jsx: react-jsx, dev types)
2026-02-16 02:39:22 +01:00
DaX
f6f9da9c5b Add bulk price editing features and fix quantity update price preservation
- Fix FilamentForm to preserve prices when updating quantities
  - Add isInitialLoad flag to prevent price override on form load
  - Only update prices when color is actively changed, not on initial render

- Add bulk filament price editor to dashboard
  - Filter by material and finish
  - Set refill and/or spool prices for multiple filaments
  - Preview changes before applying
  - Update all filtered filaments at once

- Add bulk color price editor to colors page
  - Edit prices for all colors in one interface
  - Global price application with search filtering
  - Individual price editing with change tracking

- Add auto-kill script for dev server
  - Kill existing processes on ports 3000/3001 before starting
  - Prevent "port already in use" errors
  - Clean start every time npm run dev is executed
2025-11-18 19:14:01 +01:00
DaX
57abb80072 Remove Serbian colors including Braon from database
- Remove Serbian color entries from schema.sql
- Add migration to delete Serbian colors from existing databases
- Add migration runner scripts for easier database updates
- Install pg package for PostgreSQL client support

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: DaX <noreply@anthropic.com>
2025-06-24 12:04:45 +02:00
DaX
18110ab159 Major restructure: Remove Confluence, add V2 data structure, organize for dev/prod
- Import real data from PDF (35 Bambu Lab filaments)
- Remove all Confluence integration and dependencies
- Implement new V2 data structure with proper inventory tracking
- Add backwards compatibility for existing data
- Create enhanced UI components (ColorSwatch, InventoryBadge, MaterialBadge)
- Add advanced filtering with quick filters and multi-criteria search
- Organize codebase for dev/prod environments
- Update Lambda functions to support both V1/V2 formats
- Add inventory summary dashboard
- Clean up project structure and documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 01:12:50 +02:00
DaX
a2252fa923 Fix production environment variables
- Remove old Confluence variables
- Add NEXT_PUBLIC_API_URL for API access

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 00:11:36 +02:00
DaX
2baac7be9f Add build testing and pre-commit hooks
- Add test-build.js script to verify standalone build locally
- Add pre-commit hook with security, build, and test checks
- Copy required-server-files.json to root of standalone for Amplify
- Add husky for automatic pre-commit validation

This ensures we test builds locally before pushing
2025-06-19 01:03:47 +02:00
DaX
21f6577592 Convert to Next.js with security features
- Migrate from Vite to Next.js 15 for server-side API support
- Add dynamic API route at /api/filaments that fetches from Confluence
- Implement security measures:
  - API credentials only accessible server-side
  - Security scan script to detect credential leaks
  - Tests to ensure no sensitive data exposure
  - Build-time security checks in CI/CD
- Update AWS Amplify configuration for Next.js deployment
- Update Terraform to use WEB_COMPUTE platform for Next.js
- Add Jest tests for API security
- Remove static JSON approach in favor of dynamic API

This provides real-time data updates while keeping credentials secure on the server.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:11:19 +02:00
DaX
4b39190251 Fix production data fetching with static JSON
- Add build-time data fetching from Confluence
- Create build-data.js script to fetch and save data at build time
- Update App.tsx to use static JSON in production, API in development
- Install tsx for running TypeScript build scripts
- Configure Amplify to fetch data during build process
- Add public directory configuration to Vite

This fixes the white page error by providing data at build time instead of runtime.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 00:00:26 +02:00
DaX
606a5136dc Clean up unused code and sync Terraform state
- Remove unused Express server (server.js)
- Remove unused API route (src/pages/api/filaments.ts)
- Remove Express dependency and related scripts from package.json
- Import existing AWS domain association into Terraform
- Add domain configuration to terraform.tfvars
- Update domain association to include www and dev subdomains
- Set wait_for_verification to false to avoid timeouts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 23:43:28 +02:00
DaX
7f20d342fc Fix Confluence integration and add sortable columns
- Fixed Confluence API authentication using Basic auth with email
- Added /wiki path to API URL for proper endpoint
- Improved HTML parsing with cheerio for better table extraction
- Made all table columns sortable (previously only 4 were clickable)
- Removed fallback to mock data - now always uses real Confluence data
- Only color Boja column instead of entire rows for cleaner look
- Added proper error handling and logging
2025-06-18 23:11:43 +02:00
DaX
c394d94bb0 Initial Filamenteka setup - Bambu Lab filament tracker
- React + TypeScript frontend with automatic color coding
- Confluence API integration for data sync
- AWS Amplify deployment with Terraform
- Support for all Bambu Lab filament colors including gradients
2025-06-17 22:39:35 +02:00