Commit Graph

110 Commits

Author SHA1 Message Date
DaX
9594ce56cb Diagnostic: find node binary and systemd service config on EC2
Some checks failed
Deploy / detect (push) Successful in 8s
Deploy / deploy-api (push) Failing after 27s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled
2026-03-05 01:55:05 +01:00
DaX
11dbea3536 Fix migration: use find to locate node binary on EC2
Some checks failed
Deploy / detect (push) Successful in 7s
Deploy / deploy-api (push) Failing after 26s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled
2026-03-05 01:53:17 +01:00
DaX
6d04e16cf6 Fix migration: use login shell to find node binary in SSM context
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 21s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled
2026-03-05 01:51:10 +01:00
DaX
85481512c8 Fix SSM parameter passing: use JSON files instead of inline parameters
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 22s
Deploy / deploy-frontend (push) Successful in 2m3s
Deploy / tag-deploy (push) Has been skipped
AWS CLI was misinterpreting inline --parameters with embedded paths.
Use file:// JSON parameters for all SSM commands to avoid shell quoting issues.
2026-03-05 01:48:40 +01:00
DaX
1e95455139 Fix migration step: run node as ubuntu user for correct PATH
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 14s
Deploy / deploy-frontend (push) Successful in 2m6s
Deploy / tag-deploy (push) Has been skipped
SSM runs as root with minimal PATH. Use sudo -iu ubuntu to get the
ubuntu user's login shell environment where node is available.
2026-03-05 01:46:16 +01:00
DaX
f929c384c1 Fix migration step: source nvm before running node on EC2
Some checks failed
Deploy / deploy-frontend (push) Successful in 2m5s
Deploy / tag-deploy (push) Has been skipped
Deploy / detect (push) Successful in 5s
Deploy / deploy-api (push) Failing after 22s
SSM runs with minimal PATH that doesn't include nvm-managed node.
Source nvm.sh before executing migrate.js.
2026-03-05 01:43:41 +01:00
DaX
291997caa5 Fix migration step: create api/ subdirectory and run migrate from project root
Some checks failed
Deploy / detect (push) Successful in 9s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-api (push) Failing after 26s
Deploy / deploy-frontend (push) Has been cancelled
mkdir -p the api/ and database/ directories before copying files since EC2
only has server.js at the project root. Run migrate.js from project root
so dotenv picks up the .env file correctly.
2026-03-05 01:42:01 +01:00
DaX
0741bd0d0e Fix tag-deploy condition to properly check individual job results
Some checks failed
Deploy / detect (push) Successful in 5s
Deploy / deploy-api (push) Failing after 29s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled
Use explicit job result checks instead of needs.*.result wildcard which
does not work in Gitea Actions. Prevent tagging when any deploy job fails.
2026-03-05 01:40:03 +01:00
DaX
746f0925d0 Fix CI/CD pipeline: use archive download for migrations, inline SSM paths
All checks were successful
Deploy / tag-deploy (push) Successful in 4s
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Has been skipped
Deploy / deploy-frontend (push) Successful in 2m5s
Replace complex Gitea API + python parsing in SSM with simple repo archive
download and extraction. Inline hardcoded paths in SSM commands instead of
shell variable expansion through single quotes to avoid quoting issues.
2026-03-05 01:33:19 +01:00
DaX
2985ea4457 Rewrite CI/CD pipeline with deploy-tag change detection and verified deployments
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 22s
Deploy / deploy-frontend (push) Successful in 2m5s
Deploy / tag-deploy (push) Successful in 3s
Replace HEAD~1 diff with git tag-based change detection to catch all changes
since last successful deploy. Split into 4 parallel jobs: detect, frontend,
API (with migrations, health check, and rollback), and deploy tagging.
2026-03-05 01:19:13 +01:00
DaX
f2ae608b01 Trigger API redeploy for customers and sales endpoints
All checks were successful
Deploy / deploy (push) Successful in 15s
2026-03-05 01:09:09 +01:00
DaX
65ae493d54 Align catalog with Bambu Lab product line, add conditional filters and admin sidebar
All checks were successful
Deploy / deploy (push) Successful in 2m24s
- Add master catalog (bambuLabCatalog.ts) as single source of truth for materials, finishes, colors, and refill/spool availability
- Fix incorrect finish-per-material mappings (remove PLA: 85A/90A/95A HF/FR/GF/HF, add ASA: Basic/CF/Aero, fix PETG/PC)
- Implement cascading filters on public site: material restricts finish, finish restricts color
- Add AdminSidebar component across all admin pages
- Redirect /upadaj to /dashboard when already authenticated
- Update color hex mappings and tests to match official Bambu Lab names
2026-03-05 01:04:06 +01:00
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
e9afe8bc35 Add temporary sales pause overlay until March 8
All checks were successful
Deploy / deploy (push) Successful in 1m58s
2026-02-27 20:09:53 +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
eff60436eb Clean up repo: remove amplify.yml, update gitignore
All checks were successful
Deploy / deploy (push) Successful in 1m29s
Delete deprecated Amplify config leftover from Gitea migration.
Update next-env.d.ts for Next.js 15.5 route types.
Add .mcp.json and *.png to gitignore.
2026-02-16 02:33:35 +01:00
DaX
6dda083ee9 Streamline CLAUDE.md: remove redundancy, fix inaccuracies
All checks were successful
Deploy / deploy (push) Successful in 1m22s
Remove exhaustive component/test/terraform listings that are easily
discoverable. Fix non-existent typecheck script reference. Consolidate
deployment info into single table. Add missing Matomo env vars and
single-test-file command.
2026-02-16 02:16:37 +01:00
DaX
bd27f7a9e4 Fix pip3 install on Ubuntu runner with --break-system-packages flag
All checks were successful
Deploy / deploy (push) Successful in 1m18s
2026-02-16 02:08:08 +01:00
DaX
145c2d4781 Optimize CI/CD pipeline for faster deploys
Some checks failed
Deploy / deploy (push) Failing after 1m12s
- Remove broken npm cache (was timing out ~5min per run)
- Replace AWS CLI v2 installer with pip3 install (~50MB less)
- Inline AWS credential config instead of separate action
- Merge steps to reduce overhead
2026-02-16 02:04:38 +01:00
DaX
28ba314404 Add missing filament colors and fix naming issues
All checks were successful
Deploy / deploy (push) Successful in 10m43s
- Add Silk Multi-Color gradients: Aurora Purple, Phantom Blue, Mystic Magenta
- Add Iron Gray Metallic alias (with space)
- Add Matte Latte Brown
2026-02-16 01:51:42 +01:00
DaX
0cfee1bda7 Update all dependencies to latest stable versions
All checks were successful
Deploy / deploy (push) Successful in 10m52s
Frontend: react 19.2.4, next 15.5.12, axios 1.13.5, jest 30.2.0,
typescript 5.9.3, tailwindcss 3.4.19, autoprefixer 10.4.24
API: cors 2.8.6, dotenv 16.6.1, express 4.22.1, pg 8.18.0,
jsonwebtoken 9.0.3, nodemon 3.1.11
2026-02-16 01:02:59 +01:00
DaX
7cd2058613 Add AWS CLI install step to deploy workflow
All checks were successful
Deploy / deploy (push) Successful in 10m52s
Runner image doesn't include AWS CLI by default.
2026-02-16 00:49:52 +01:00
DaX
c837af6015 Fix workflow: use env block instead of vars context
Some checks failed
Deploy / deploy (push) Failing after 5m59s
Gitea act runner doesn't resolve vars context properly.
Move all non-sensitive config to workflow-level env block.
2026-02-16 00:43:13 +01:00
DaX
58c165749d Migrate from GitHub to Gitea with CI/CD
Some checks failed
Deploy / deploy (push) Failing after 6m11s
- Add Gitea Actions workflow for automated frontend and API deployment
- Update all raw download URLs from GitHub to Gitea
- Remove deprecated Amplify config and GitHub-specific Terraform variables
- Clean up commented-out Amplify resources from Terraform
- Update documentation to reflect new repository and CI/CD setup
2026-02-16 00:35:08 +01:00
DaX
b7f5417e23 Move dashboard to root level route
- Dashboard now accessible at /dashboard instead of /upadaj/dashboard
- Updated all navigation links to use new /dashboard route
- Login page still at /upadaj, redirects to /dashboard on success
- Colors and requests remain under /upadaj prefix
- Updated test files to reference new dashboard path
2025-11-19 19:13:48 +01:00
DaX
17edfc8794 Fix CloudFront routing and TypeScript type safety
- Update CloudFront Function to handle Next.js static export .html files
- Fix TypeScript interface for color request service (add required user_phone field)
- Update ColorRequestForm component to include phone field
2025-11-19 18:56:08 +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
b1dfa2352a Add 76 missing Bambu Lab colors and expand filament type support
- Added comprehensive color migration with 76 new Bambu Lab colors
- Includes glow, metallic, sparkle, gradient, ABS, and translucent variants
- Added PAHT material type with CF and Bez Finisha finish support
- Added Tough+ finish option for PLA filaments
- Fixed refill/spulna restrictions for specific combinations:
  - ABS GF Yellow/Orange now refill-only
  - TPU 95A HF now refill-only
  - Removed spool restrictions for Galaxy and Basic finishes
- Updated frontend color mappings with all new colors
- All colors now available in admin panel for inventory management
2025-11-13 07:02:06 +01:00
DaX
987039b0f7 Optimize frontend deployment with proper cache headers
Update deployment script to set appropriate cache-control headers:
- HTML files: no-cache to prevent stale content
- Next.js static assets: 1 year cache with immutable flag
- Other assets: 1 day cache for optimal performance

This resolves chronic caching issues with admin panel updates.
2025-10-31 03:39:25 +01:00
DaX
6bc1c8d16d Add CloudFront Function for directory index routing
- Create CloudFront Function to rewrite directory requests to index.html
- Fix admin login page routing issue (/upadaj -> /upadaj/index.html)
- Attach function to CloudFront distribution default cache behavior
- Enables proper routing for all admin pages without .html extension
2025-10-31 02:54:46 +01:00
DaX
d3e001707b Fix admin panel authentication and navigation for static export
- Replace router.push with window.location.href for reliable redirects
- Fix auth check to wait for component mount before accessing localStorage
- Ensure proper redirect after successful login
- Fix redirect behavior on all admin pages (dashboard, colors, requests)
2025-10-31 02:45:47 +01:00
DaX
c0ca1e4bb3 Fix CloudFront domain configuration and add missing color definitions
- Configure CloudFront to accept filamenteka.rs with ACM SSL certificate
- Add Cloudflare Transform Rule for Host header rewriting
- Fix Matte Grass Green hex code (#7CB342 -> #61C680)
- Add PLA Wood colors: Ochre Yellow, White Oak, Clay Brown
- Add script for managing color definitions in database
2025-10-31 02:40:03 +01:00
DaX
1ce127c51c Remove deprecated Amplify resources after CloudFront migration
- Comment out Amplify app, branches, and domain association
- Remove Amplify-related outputs
- Add migration notes for reference
- Amplify app deleted from AWS (dd6qls201bf9n)
2025-10-31 02:07:14 +01:00
DaX
fc95dc4ed2 Migrate frontend from Amplify to CloudFront + S3
- Add CloudFront distribution with S3 origin
- Configure S3 bucket with website hosting
- Add Origin Access Control (OAC) for security
- Configure SPA error handling (404/403 -> index.html)
- Add Cloudflare DNS records (commented out due to invalid token)
- Add deployment script for future updates
- Update outputs to include CloudFront info
2025-10-31 02:04:47 +01:00
DaX
543e51cc3c Add 19 new Bambu Lab colors and fix sale banner display
Added 16 new PLA Matte refill-only colors and 3 PLA Wood spool-only colors.
Updated admin panel to automatically handle Matte prefix and Wood finish.
Fixed sale banner not displaying due to expired sale dates.
Updated all active sales to expire in 7 days (November 7, 2025).
2025-10-31 00:55:43 +01:00
DaX
56a21b27fe Add new Bambu Lab colors and update documentation
Add three new filament colors to support Wood and Matte finishes:
- Classic Birch (PLA Wood) - #E8D5B7
- Rosewood (PLA Wood) - #472A22
- Desert Tan (PLA Matte) - #E8DBB7

Update CLAUDE.md with improved documentation:
- Enhanced architecture details
- Added color requests schema
- Expanded deployment and database sections
- Added testing and security details
2025-10-07 17:57:34 +02:00
DaX
f99a132e7b Center phone number in footer 2025-09-30 15:01:13 +02:00
DaX
990221792a Translate table headers to Serbian (Finish -> Finiš, Spulna -> Špulna, Refill -> Refil) 2025-09-30 14:13:27 +02:00
DaX
6f75abf6ee Add selling by grams pricing information 2025-09-30 14:08:30 +02:00
DaX
01a24e781b Fix sale discount reset when updating filament quantities
Preserve sale fields when updating filament basic data
2025-09-30 11:58:45 +02:00
DaX
92b186b6bc Add reusable spool price notice above table 2025-09-30 10:57:53 +02:00
DaX
06b0a20bef Update phone number to 0631031048 2025-09-24 18:17:43 +02:00
DaX
747d15f1c3 Make email and phone fields required in color requests 2025-08-29 12:44:00 +02:00
DaX
6d534352b2 Add phone field to color request form and database 2025-08-29 12:41:34 +02:00
DaX
9f2dade0e3 Fix styling issues in color requests admin panel
- Add Serbian status labels instead of English status names
- Fix dark mode colors for better contrast
- Update date formatting to use Serbian locale
- Fix request count display to show proper total
- Improve text colors consistency across light/dark themes
- Tested all API endpoints (create, read, update, delete) - working correctly
- Build succeeds without errors
2025-08-06 00:20:26 +02:00
DaX
fd3ba36ae2 Add color request feature with modal and Safari styling fixes
- Implement color request modal popup instead of separate page
- Add Serbian translations throughout
- Fix Safari form styling issues with custom CSS
- Add 'Other' option to material and finish dropdowns
- Create admin panel for managing color requests
- Add database migration for color_requests table
- Implement API endpoints for color request management
2025-08-05 23:34:35 +02:00
DaX
52f93df34a Merge branch 'improvement' 2025-08-05 23:09:14 +02:00
DaX
5d1d05574f Fix refill-only colors to have 0 spools instead of 1
- Add migration to correct 14 colors that should be refill-only
- Create helper script for applying the fix
- Add frontend tracking for refill-only colors
- Update README with current project state
- Add development guidance documentation
2025-08-05 23:05:24 +02:00
DaX
470cf63b83 Merge pull request #1 from daxdax89/improvement
Improvement
2025-07-21 12:16:31 +02:00
DaX
4020bb4ab8 Clean up unnecessary migration files and outdated documentation 2025-07-21 12:10:45 +02:00