Missing target: production caused the API image to build the last
Dockerfile stage (nginx-frontend) instead of the Node.js server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The default :root styles (dark background, white text, centered #root)
were overriding Tailwind and making all pages appear blank/dark.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove localStorage from all 4 Redux slices (products, orders, expenses, customers)
- Layout fetches all data from API on mount; adds logout button with active nav highlighting
- Wire API calls in Products, Orders, Expenses pages for all CRUD operations
- DataImport uses POST /orders/bulk for CSV upserts and API for PDF slip orders
- MissingProductsModal creates products via API
- Relax Order model: optional customerId, embedded customer, fees, printingCost on items, default paymentStatus=paid
- Relax Expense model: free-string category, add taxDeductible/vendor/reference fields
- Add printingCost to Product model
- Add POST /orders/bulk endpoint for upsert-by-orderNumber
- Raise rate limit to 1000 req/15min for bulk imports
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Frontend:
- Login and Register pages wired up to API
- PrivateRoute redirects unauthenticated users to /login
- Token persisted in localStorage, restored on page load
- Axios instance automatically attaches Bearer token, redirects on 401
Backend:
- userId field added to all models (Product, Order, Customer, Expense)
- All queries scoped to authenticated user's userId
- Register/login return JWT token
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- User model with bcrypt password hashing
- Register, login, logout, and /me endpoints
- authenticate middleware applied to all API routes
- JWT_SECRET configurable via environment variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Enable MongoDB connection in server
- Add Customer and Expense models
- Implement full CRUD for products, orders, customers, expenses
- Implement analytics dashboard with revenue, sales chart, top products/customers
- Add MongoDB service to docker-compose.deploy.yml with persistent volume
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The runtime cp from etsy-tracker to a shared volume silently failed
because the nodejs user lacked write permissions on the root-owned volume.
Now a dedicated nginx-frontend Docker stage is built and pushed to GHCR
with the React client baked in, eliminating the volume-sharing approach.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fixed nginx 404 errors with enhanced file copying and fallback configuration
- Added docker-compose.simple.yml for streamlined first-time deployment
- Enhanced docker-compose.deploy-local.yml with detailed debugging and health checks
- Improved nginx.deploy.conf with fallback pages and auto-refresh
- Added comprehensive DEPLOYMENT_GUIDE.md with multiple deployment options
- Created validate-deployment.sh script for environment validation
- Updated container interface deployment documentation
- Added DEPLOYMENT_STATUS.md summary of ready features
Deployment improvements:
- Enhanced container startup sequence with health checks
- Detailed logging for troubleshooting file copying issues
- Multiple deployment strategies for different use cases
- Fallback nginx configuration prevents 404 errors during startup
- Auto-refresh functionality for seamless user experience
Ready for production deployment via container interfaces or command line.
🔧 Deployment Fixes:
- Change default compose file to docker-compose.deploy-local.yml
- Remove obsolete 'version' attribute from compose files
- Ensures deployment works immediately without GitHub Container Registry
✅ Ready to Deploy:
- Use docker-compose.deploy-local.yml (builds locally)
- No more 'version is obsolete' warnings
- No dependency on GitHub Container Registry access
This makes deployment work out-of-the-box while GHCR image access is resolved.
🔧 Fix Docker Compose YAML Issue:
- Remove duplicate 'command' key that was causing parse error
- Keep the cleaner command with better logging
- Ensures proper YAML structure for container interfaces
✅ Now Ready for Deployment:
- Valid YAML syntax for Portainer/Docker Desktop
- Single command block for container startup
- Clear logging for troubleshooting
This fixes the 'mapping key command already defined' error.
🔧 Container Interface Deployment Fix:
- Use nginx.deploy.conf for deployment-specific nginx config
- Add command to copy client files to shared volume
- Improve startup logging and error handling
- Ensure client files are available to nginx container
✅ Deployment Ready:
- Works with Portainer, Docker Desktop, and similar interfaces
- Copies React build files from API container to nginx volume
- Proper container startup sequence and health checks
- Clear logging for troubleshooting startup issues
This fixes the missing client files issue when deploying from container management interfaces.
🔧 Critical Fix:
- Remove --only=production from client build stage (needs devDependencies)
- Remove --only=production from server build stage (needs TypeScript, etc.)
- Add production dependencies install in final stage only
- Remove duplicate npm ci commands
🏗️ Build Process Fixed:
- Client: npm ci (all deps) → build with TypeScript/Vite → copy dist/
- Server: npm ci (all deps) → build with TypeScript → copy dist/
- Production: Install only runtime dependencies for final image
⚡ Why This Fixes It:
- Build tools (TypeScript, Vite) are devDependencies
- --only=production excludes build tools, causing 'npm run build' to fail
- Final production stage still gets minimal runtime dependencies
This should resolve the 'npm run build exit code 127' Docker build error.
Architecture Updates:
- Nginx serves static React files for optimal performance
- Nginx proxies API requests to Node.js backend (port 8080)
- Separation of concerns: static files vs API handling
- Professional production setup with proper caching
Features Added:
- nginx.conf with optimized configuration:
- Static file serving with long-term caching
- API reverse proxy with rate limiting
- Security headers and GZIP compression
- Health check proxying and SPA routing support
- Updated docker-compose.yml for multi-container setup
- build-deploy.sh script for automated deployment
- Updated environment configuration for container networking
Security & Performance:
- Rate limiting on API and auth endpoints
- Security headers (XSS, CSRF, clickjacking protection)
- GZIP compression for static assets
- Proper cache control headers
- Container-to-container communication
Deployment:
- Single command deployment with ./build-deploy.sh
- Nginx on port 80 (exposed as 3000) serving React app
- API server on internal port 8080 (not exposed)
- Persistent data volume mounting for business files
Features:
- Multi-stage Dockerfile for optimized production builds
- Docker Compose configuration with health checks
- Health check endpoint for container monitoring
- Production environment configuration template
- Comprehensive deployment guide for Mac Mini
- Docker ignore file for efficient build context
- Security: Non-root user, proper signal handling
- Persistence: Data directory volume mounting
- Performance: Alpine Linux base, optimized layers
- Future-ready: MongoDB service configuration (commented)
Deployment:
- Simple 'docker-compose up' deployment
- Automatic health monitoring and restart policies
- Persistent data storage with volume mounts
- Port configuration and environment customization
- Complete troubleshooting and management guide
- Create secure data/ directory structure for local business files
- Add comprehensive data organization guide with security notes
- Move all sensitive files to protected data/ directory
- Enhanced .gitignore to exclude entire data/ directory (except README)
- Provide clear instructions for local data file management
- Ensure no business data can accidentally be committed to public repo
- Remove Excel business tracker spreadsheet from git tracking
- Enhanced .gitignore to exclude all business documents:
- CSV files, Excel files, PDF documents
- Transaction statements and business trackers
- Preserve essential config files (package.json, tsconfig, etc.)
- Protect sensitive financial and customer data from public exposure
Features:
- React + TypeScript frontend with Tailwind CSS
- Node.js + Express backend with TypeScript
- Comprehensive order tracking and management
- Product catalog with inventory tracking
- Customer data management
- Expense tracking and categorization
- Advanced Profit Analysis Dashboard with:
- Real-time profit metrics and KPI visualization
- Detailed order-level profit breakdown
- Product performance analysis
- Enhanced time range filtering (monthly, quarterly, yearly)
- Interactive expandable order analysis
- Performance categorization and color coding
- CSV import functionality for Etsy statements
- PDF parsing capabilities
- Redux state management with persistence
- Responsive design with mobile support
- Australian date formatting and currency display