26 Commits

Author SHA1 Message Date
dwindown
35e93b826a chore: cleanup root folder markdown files
- Deleted 36 old session/progress files (Oct 8-13)
- Deleted deprecated FIREBASE_SETUP.md
- Moved 4 planning documents to docs/planning/
  - PROJECT_PLAN.md → project-plan.md
  - PROJECT_STANDARDS.md → project-standards.md
  - TODO_ADMIN_FEATURES.md → todo-admin-features.md
  - IMPLEMENTATION_PLAN.md → implementation-plan.md
- Updated docs/README.md with new planning documents
- Root folder now only contains README.md
2025-10-13 09:37:03 +07:00
dwindown
89f881e7cf feat: reorganize admin settings with tabbed interface and documentation
- Reorganized admin settings into tabbed interface (General, Security, Payment Methods)
- Vertical tabs on desktop, horizontal scrollable on mobile
- Moved Payment Methods from separate menu to Settings tab
- Fixed admin profile reuse and dashboard blocking
- Fixed maintenance mode guard to use AppConfig model
- Added admin auto-redirect after login (admins → /admin, users → /)
- Reorganized documentation into docs/ folder structure
- Created comprehensive README and documentation index
- Added PWA and Web Push notifications to to-do list
2025-10-13 09:28:12 +07:00
dwindown
49d60676d0 feat: Add FAB with asset price update, mobile optimizations, and localized financial trend
- Add Floating Action Button (FAB) with 3 quick actions
- Implement Asset Price Update dialog for bulk price updates
- Add bulk price update API endpoint with transaction support
- Optimize multiselect, calendar, and dropdown options for mobile (44px touch targets)
- Add custom date range popover to save space in Overview header
- Localize number format suffixes (k/m/b for EN, rb/jt/m for ID)
- Localize date format in Financial Trend (Oct 8 vs 8 Okt)
- Fix negative values in trend line chart (domain auto)
- Improve Asset Price Update dialog layout (compact horizontal)
- Add mobile-optimized calendar with responsive cells
- Fix FAB overlay and close button position
- Add translations for FAB and asset price updates
2025-10-12 23:30:54 +07:00
dwindown
46488a09e2 feat: Add WhatsApp verification & responsive dialogs
 COMPLETED FEATURES:

1. WhatsApp Number Verification
   - Verify phone number is registered on WhatsApp before saving
   - Use OTP webhook with check_number mode
   - Show error if number not registered
   - Translated error messages

2. Responsive Dialog/Drawer System
   - Created ResponsiveDialog component
   - Desktop: Uses Dialog (modal)
   - Mobile: Uses Drawer (bottom sheet)
   - Applied to WalletDialog & TransactionDialog
   - Better UX on mobile devices

3. Translation Fixes
   - Fixed editProfile key placement
   - All translation keys now consistent
   - Build passing without errors

📱 MOBILE IMPROVEMENTS:
- Form dialogs now slide up from bottom on mobile
- Better touch interaction
- More native mobile feel

🔧 TECHNICAL:
- Added shadcn Drawer component
- Created useMediaQuery hook
- Responsive context wrapper
- Type-safe implementation
2025-10-12 17:07:16 +07:00
dwindown
d626c7d8de feat: Translate Overview and Transactions pages
- Add multi-language support to Overview page
- Add multi-language support to Transactions page
- Translate stats cards, buttons, and filters
- All UI text now supports ID/EN switching

Remaining: Profile page only
2025-10-12 08:57:57 +07:00
dwindown
bfd009368a feat: Translate Wallets page to multi-language
- Add useLanguage hook to Wallets page
- Translate all UI text (buttons, labels, table headers)
- Translate filter options and placeholders
- Translate delete confirmation dialog
- Support both Indonesian and English
2025-10-12 08:53:30 +07:00
dwindown
371b5e0a66 feat: Implement multi-language system (ID/EN) for member dashboard
- Create translation files (locales/id.ts, locales/en.ts)
- Add LanguageContext with useLanguage hook
- Add LanguageToggle component in sidebar
- Default language: Indonesian (ID)
- Translate WalletDialog and TransactionDialog
- Language preference persisted in localStorage
- Type-safe translations with autocomplete

Next: Translate remaining pages (Overview, Wallets, Transactions, Profile)
2025-10-12 08:51:48 +07:00
dwindown
c0df4a7c2a feat: Add Sonner toast notifications to all CRUD operations
- Install sonner package and create Toaster component
- Add toast notifications to all admin dashboard operations:
  * AdminPlans: create, update, delete, reorder, toggle visibility
  * AdminPaymentMethods: create, update, delete, reorder, toggle active
  * AdminUsers: suspend, unsuspend, grant pro access
  * AdminPayments: verify, reject
  * AdminSettings: save settings
- Add toast notifications to all member dashboard operations:
  * Wallets: create, update, delete
  * Transactions: create, update, delete
  * Profile: update name, avatar, phone, password, delete account
  * OTP: enable/disable email, WhatsApp, authenticator
- Replace all alert() calls with toast.success/error/warning
- Add proper success/error messages in Bahasa Indonesia
- Implement smart plan deletion (permanent if no subscriptions, soft delete if has subscriptions)
- Fix admin redirect after login (admin goes to /admin, users to /)
- Exclude admin accounts from subscription distribution chart
- Show inactive plans with visual indicators
- Add real revenue data to admin dashboard charts
- Use formatLargeNumber for consistent number formatting
2025-10-12 08:43:50 +07:00
dwindown
258d326909 feat: implement AdminPaymentMethods page with full CRUD
Features:
 Modern card grid layout (matches AdminPlans design)
 Payment method types: Bank Transfer, E-Wallet, QRIS
 Type-specific icons and colors
 Account number & name display
 Instructions section
 Toggle active/inactive status
 Toggle visibility
 Delete functionality
 Drag handle for reordering (UI ready)
 Animated status indicators
 Indonesian text throughout

Card Design:
- Same modern gradient cards as Plans
- Type badges with icons
- 2-column stats grid
- Action buttons (Active, Visibility, Edit, Delete)
- Hover effects and transitions

API Integration:
- GET /admin/payment-methods
- PATCH /admin/payment-methods/:id/visibility
- PATCH /admin/payment-methods/:id/status
- DELETE /admin/payment-methods/:id

TODO: Create/Edit modal (next step)
2025-10-11 22:05:27 +07:00
dwindown
1e3d320716 feat: complete redesign of admin plan cards
Major UI Overhaul:
 Modern card design with gradients
 Hover effects: lift up + shadow
 Inline layout: grip icon + title + badge
 No wasted vertical space
 Larger price display (text-4xl)
 Gradient price section with border
 2-column stats grid with cards
 Animated pulse dot for active status
 Full-width visibility button + icon actions
 Indonesian text throughout

Layout Changes:
- Grip icon inline with title (left side)
- Badge inline with title text
- Trial badge inline with duration
- Stats in grid layout
- Action buttons with hover fills

Design Elements:
- rounded-2xl cards
- Gradient backgrounds
- Border color changes on hover
- Smooth transitions (300ms)
- Better spacing and typography
- Consistent card heights
2025-10-11 21:59:13 +07:00
dwindown
bef2344ddc fix: remove dark: variants, use theme colors only
ISSUE: Tailwind v4 doesn't handle dark: variants the same way as v3
The dark: prefix wasn't working properly in light mode

SOLUTION: Replace all dark: variants with theme-aware colors

Admin Pages:
- AdminPlans: badges use bg-primary/20, bg-green-500/20, etc.
- AdminUsers: role/status badges use opacity-based colors
- AdminDashboard: stat cards use /20 opacity backgrounds

Member Pages:
- Overview: chart tooltips use text-foreground

Benefits:
 Works correctly in both light and dark mode
 Colors automatically adapt via CSS variables
 No more hardcoded dark: classes
 Consistent opacity-based approach

Technical:
- Tailwind v4 uses @theme and CSS variables
- dark: variants need proper configuration
- Using /20 opacity on colors works universally
2025-10-11 21:20:36 +07:00
dwindown
46f03a34a5 docs: update layout unification status 2025-10-11 20:19:57 +07:00
dwindown
50ce884a43 fix: apply theme colors to all admin pages
AdminDashboard:
- Replace all gray colors with theme variables
- Indonesian text: 'Selamat datang', 'Kelola Plans', etc.
- Loading: 'Memuat...'

AdminPlans:
- bg-card, text-foreground, border-border
- text-muted-foreground for secondary text
- bg-muted for sections
- text-primary for links/icons
- text-destructive for delete
- Indonesian: 'Kelola Plans', 'Tambah Plan', 'Tidak ada plan'

AdminUsers:
- Same theme color replacements
- Indonesian: 'Kelola Users', 'Tidak ada user'
- bg-primary for avatars
- Consistent hover states

All pages now:
 Respect light/dark mode
 Use @theme colors from index.css
 Indonesian text (keeping English tech terms)
 Consistent with member layout styling
2025-10-11 20:18:10 +07:00
dwindown
4bd95e50e8 fix: include role field in all auth responses
- Add role to login response
- Add role to register response
- Add role to Google login response
- Add role to OTP verification response
- Add role to getUserProfile response
- Fixes admin panel access denied issue
2025-10-11 18:42:23 +07:00
dwindown
df92bebc8d docs: update implementation plan - admin frontend 50% complete 2025-10-11 18:34:15 +07:00
dwindown
be44384475 docs: add admin frontend progress summary 2025-10-11 18:33:42 +07:00
dwindown
7396cb5bd6 feat: add admin pages for plans, users, and placeholders
- AdminPlans: full CRUD UI with cards, visibility toggle
- AdminUsers: search, suspend/unsuspend, grant Pro access
- AdminPaymentMethods: placeholder
- AdminPayments: placeholder
- AdminSettings: placeholder
- All routes wired in App.tsx
- Admin panel fully navigable
2025-10-11 18:30:18 +07:00
dwindown
cd6b047d3f feat: add admin frontend layout and dashboard
- Add role field to User interface in AuthContext
- Create AdminLayout with responsive sidebar navigation
- Create AdminDashboard with stats cards
- Add admin routes to App.tsx
- Admin panel accessible at /admin
- Shows stats: total users, active subscriptions, pending payments
- Access control: only users with role=admin can access
2025-10-11 18:22:42 +07:00
dwindown
e84d4affc6 docs: add comprehensive admin backend testing
- Create ADMIN_BACKEND_TESTED.md with test results
- Create test-admin-api.sh automated test script
- All endpoints tested and working:
  - GET /admin/plans 
  - POST /admin/plans 
  - PUT /admin/plans/:id 
  - DELETE /admin/plans/:id 
  - GET /admin/payment-methods 
  - GET /admin/users 
  - GET /admin/users/stats 
  - GET /admin/payments/pending/count 
  - GET /admin/config 
  - Security (401 without token) 

Backend fully tested and ready for frontend development
2025-10-11 18:10:20 +07:00
dwindown
ddca073610 fix: await async generateToken in auth service
- Add await to all generateToken() calls
- Fixes empty token issue in login/register responses
- Token now properly includes user role for admin access
2025-10-11 18:08:01 +07:00
dwindown
1c28e51b53 docs: update implementation plan and add backend completion summary
- Mark backend as complete in IMPLEMENTATION_PLAN.md
- Create ADMIN_BACKEND_COMPLETE.md with full documentation
- Document all API endpoints
- Add testing instructions
- Add deployment notes
2025-10-11 14:37:18 +07:00
dwindown
12850ab12d feat: complete admin backend controllers and services
- AdminPlansController & Service (CRUD, reorder)
- AdminPaymentMethodsController & Service (CRUD, reorder)
- AdminPaymentsController & Service (verify, reject, pending count)
- AdminUsersController & Service (search, suspend, grant pro access, stats)
- AdminConfigController & Service (dynamic config management)
- Wire all controllers into AdminModule
- Import AdminModule in AppModule

Admin API Routes:
- GET/POST/PUT/DELETE /admin/plans
- GET/POST/PUT/DELETE /admin/payment-methods
- GET /admin/payments (with status filter)
- POST /admin/payments/:id/verify
- POST /admin/payments/:id/reject
- GET /admin/users (with search)
- POST /admin/users/:id/grant-pro
- GET/POST/DELETE /admin/config

All routes protected by AuthGuard + AdminGuard
2025-10-11 14:32:45 +07:00
dwindown
9b789b333f feat: add admin guard and JWT role support
- Create AdminGuard to check user role
- Update JWT strategy to include role in payload
- Update auth service to include role in token generation
- Prepare admin module structure
- TypeScript will resolve lint errors after server restart
2025-10-11 14:15:34 +07:00
dwindown
c3bc181063 feat: add admin dashboard schema and seeder
- Add Plan, Subscription, Payment, PaymentMethod, Coupon models
- Add ApiKey, Webhook models for API access
- Add AppConfig model for dynamic configuration
- Add role, suspendedAt fields to User model
- Create comprehensive seeder with:
  - Admin user (dwindi.ramadhana@gmail.com)
  - Default plans (Free, Pro Monthly, Pro Yearly)
  - Payment methods (BCA, Mandiri, GoPay)
  - App config (maintenance mode)
- Zero data loss migration strategy
2025-10-11 14:06:55 +07:00
dwindown
249f3a9d7d feat: remove OTP gate from transactions, fix categories auth, add implementation plan
- Remove OtpGateGuard from transactions controller (OTP verified at login)
- Fix categories controller to use authenticated user instead of TEMP_USER_ID
- Add comprehensive implementation plan document
- Update .env.example with WEB_APP_URL
- Prepare for admin dashboard development
2025-10-11 14:00:11 +07:00
dwindown
0da6071eb3 first commit 2025-10-09 12:52:41 +07:00