# Black Screen Tool Shop - TODO

## Phase 1: Database Schema
- [x] Create products table (id, name, description, price, stock, createdAt, updatedAt)
- [x] Create orders table (id, productId, customerName, customerEmail, customerPhone, status, totalPrice, createdAt, updatedAt)
- [x] Create payment_proofs table (id, orderId, transactionId, proofUrl, uploadedAt)
- [x] Create license_keys table (id, orderId, licenseKey, downloadUrl, deliveredAt)
- [x] Run database migrations

## Phase 2: Backend API
- [x] Create product procedures (list, get, update - admin only)
- [x] Create order procedures (create, list, getByIdOrEmail, updateStatus - admin only)
- [x] Create payment proof procedures (upload, verify - admin only)
- [x] Create license key procedures (generate, deliver, list - admin only)
- [x] Create email sending utilities (order confirmation, license key delivery, rejection)

## Phase 3: Public Landing Page
- [x] Design and build hero section with product showcase
- [x] Build features section
- [x] Build pricing section with payment method icons
- [x] Add prominent "Buy Now" CTA button
- [x] Ensure elegant, premium aesthetic

## Phase 4: Customer Checkout Flow
- [x] Build checkout form (name, email, phone)
- [x] Implement payment method selection (bKash, Nagad, Binance USDT)
- [x] Build payment proof upload component
- [x] Implement transaction ID input field
- [x] Create order submission flow
- [x] Add order confirmation page with order ID
- [x] Fix payment method labels to exactly match requirements

## Phase 5: Order Status Lookup
- [x] Build order status page
- [x] Implement lookup by order ID
- [x] Implement lookup by email
- [x] Display order status and details
- [x] Build customer support widget (WhatsApp + email links)

## Phase 6: Admin Dashboard
- [x] Build role-gated admin layout
- [x] Create orders management table
- [x] Build payment verification view (view proof, transaction ID)
- [x] Implement approve/reject order functionality
- [x] Build product management section (placeholder for future expansion)
- [x] Build license key management section (integrated into approval flow)
- [x] Add admin statistics/overview (order count display)

## Phase 7: Email Integration
- [x] Setup email service (Manus notification API)
- [x] Create order confirmation email template
- [x] Create license key delivery email template
- [x] Implement automated email triggers
- [x] Implement payment rejection email

## Phase 8: Testing & Polish
- [x] Test checkout flow end-to-end
- [x] Test admin approval workflow
- [x] Email delivery system integrated
- [x] Test order status lookup
- [x] Visual polish and responsive design
- [x] Performance optimization (optimized database queries, efficient UI rendering)
- [x] Final QA and bug fixes (TypeScript strict mode, responsive verification)

## Phase 9: Auto License Key Generator
- [x] Create license key generation utility function (BST-XXXX-XXXX-XXXX-XXXX format)
- [x] Add auto-generate button to admin approval modal
- [x] Display generated license key in approval form
- [x] Allow manual override if needed
- [x] Auto-populate download URL when key is generated
- [x] Add copy-to-clipboard button for license key

## Phase 10: License Key Validation & Download Page
- [ ] Create license key validation page component
- [ ] Add tRPC procedure to verify license key and get download link
- [ ] Build elegant validation form with key input
- [ ] Display download button after successful validation
- [ ] Add license key details (activation date, product info)
- [ ] Implement error handling for invalid keys
- [ ] Add route to App.tsx for validation page
