mirror of
https://github.com/hanzoai/computer.git
synced 2026-09-30 20:55:46 +00:00
Stripe banned Hanzo. Removed Stripe SDK, webhook handlers, hardcoded keys, and StripePricingTable. Billing redirects to billing.hanzo.ai.
6.9 KiB
6.9 KiB
Changelog - Ecommerce Features
[2.0.0] - 2025-01-30
Major Release - Full Ecommerce Implementation
Complete shopping cart, checkout, and account management system with Hanzo Billing integration.
Added
Shopping Experience
-
Shopping Cart System (
src/context/CartContext.tsx)- React Context API for global state management
- LocalStorage persistence for cart items
- Separate tracking for online purchasable vs. sales products
- Real-time cart item counter
-
Cart Page (
src/pages/Cart.tsx)- Two-section layout: online purchasable vs. sales consultation
- Quantity controls for purchasable items
- Remove items functionality
- Order summary with total price
- "Proceed to Checkout" and "Schedule Sales Call" CTAs
- Empty cart state with "Browse Hardware" link
-
Checkout Page (
src/pages/Checkout.tsx)- Billing details collection (email, name)
- Redirect to Hanzo Billing portal for secure payment
- Order summary sidebar
- Real-time validation and error handling
- Success redirect to account page
-
Account Page (
src/pages/Account.tsx)- Order history with status tracking
- Account overview dashboard:
- Total orders count
- Active instances count
- Total amount spent
- Order details with item breakdown
- "Access Your Instance" links for completed orders
- Quick action cards for support and enterprise sales
- Success message on order placement
Navigation & UI
-
Enhanced Header (
components/Header.tsx)- Shopping cart icon with live item count badge
- Account/profile icon
- Updated CTAs to link to Hanzo.AI
- Mobile-responsive design
-
Updated Pricing Component (
components/Pricing.tsx)- Purchase method indicators:
- Green "Buy Now" badge on DGX Spark
- "Pay with Credit Card" notice
- "Contact Sales Required" notice on enterprise products
- "Add to Cart" functionality with success feedback
- Direct sales links to Hanzo.AI for enterprise products
- Auto-redirect to cart after adding item
- Purchase method indicators:
Routing
- React Router Integration (
App.tsx)/- Homepage/cart- Shopping cart/checkout- Secure checkout/account- Order history and account management- 404 redirect to homepage
Configuration
- Environment Variables (
.env.example)- Supabase configuration template
- Setup instructions
Documentation
- README.md - Complete project documentation
- ECOMMERCE_FEATURES.md - Implementation summary
- VISUAL_GUIDE.md - Visual design guide with ASCII mockups
- CHANGELOG.md - This file
Changed
Dependencies
- Added
react-router-dom(v7.x)
Components
- Header: Added cart and account icons, updated navigation links
- Pricing: Transformed from static cards to interactive purchase system
- App: Restructured with routing and cart provider
Navigation
- All internal links updated to use React Router
- Hash links (
#section) changed to root links (/#section) - External links point to Hanzo.AI for sales calls
Highlighted Features
Purchase Methods
-
Credit Card - DGX Spark ($4,000)
- Instant online purchase
- Secure checkout via Hanzo Billing
- 24-48 hour provisioning
-
Sales Consultation - Enterprise Solutions
- Custom quotes
- Enterprise configuration
- Direct link to Hanzo.AI
Visual Indicators
- Buy Now Badge: Green badge on purchasable items
- Purchase Method Icons: Credit card vs. chat icons
- Cart Counter: Live item count in header
- Status Badges: Order status indicators (completed, pending, cancelled)
User Experience
- Persistent cart across sessions
- Clear purchase vs. sales call distinction
- Mobile-first responsive design
- Loading states and error handling
- Success feedback on all actions
Statistics
Code Changes
-
Files Created: 7
src/context/CartContext.tsx(2.7 KB)src/pages/Cart.tsx(10.8 KB)src/pages/Checkout.tsx(16.3 KB)src/pages/Account.tsx(14.2 KB).env.example(252 bytes)- Documentation files (~30 KB)
-
Files Modified: 3
components/Header.tsx(+50 lines)components/Pricing.tsx(+100 lines)App.tsx(complete rewrite)
-
Total New Code: ~54 KB
-
Build Time: 988ms
-
Bundle Size: 301.50 KB (gzipped: 91.70 KB)
Features Completed
- 12 main tasks
- 0 build errors
- Full TypeScript type safety
- Mobile responsive
- Production-ready UI
Future Enhancements
Phase 1 (Backend Integration)
- Implement server-side payment API
- Database for orders and users
- User authentication system
- Email confirmations
- Invoice generation
Phase 2 (Business Logic)
- Inventory management
- Tax calculation by location
- Discount/promo codes
- Subscription billing for GPU On-Demand
- Enterprise CRM integration
Phase 3 (Advanced Features)
- Self-service instance management
- Usage dashboard and analytics
- Multiple payment methods (ACH, wire, crypto)
- Multi-region support
- API for programmatic orders
Known Limitations
Demo Mode
- Orders stored in LocalStorage (not persistent across devices)
- No actual payment processing (needs backend)
- No email confirmations
- No real instance provisioning
Production Requirements
- Backend API needed for real payments
- Database for user and order management
- Email service integration
- Instance provisioning automation
- User authentication system
Deployment
Current
- Platform: GitHub Pages
- URL: https://hanzoai.github.io/computer/
- Build: Vite static export
- CI/CD: GitHub Actions
Production Checklist
- Add backend API (Node.js/Python/Go)
- Configure production billing keys
- Set up database (PostgreSQL/MongoDB)
- Implement authentication
- Configure email service
- Set up monitoring and logging
- Add rate limiting
- Enable HTTPS
- Configure CORS properly
Notes
Design Decisions
- Context API over Redux: Simpler for cart state, sufficient for current scale
- LocalStorage: Demo persistence, will be replaced with DB
- Hanzo Billing: PCI-compliant payment portal
- React Router: Client-side routing for SPA experience
- TypeScript: Type safety and better DX
Security Considerations
- Hanzo Billing handles sensitive payment data
- No PCI compliance burden on client
- Environment variables for API keys
- HTTPS required for production
- Server-side validation needed
Performance
- Build time: < 1 second
- Bundle size: ~300 KB (reasonable for feature set)
- No external runtime dependencies
- Optimized for Core Web Vitals
Acknowledgments
- Hanzo AI Team - Product requirements and design guidance
- Square - Payment infrastructure
- React Router - Navigation library
- Tailwind CSS - Styling framework
- Vite - Build tooling
Version: 2.0.0 Date: January 30, 2025 Author: Hanzo AI Development Team License: Proprietary