Commit Graph

151 Commits

Author SHA1 Message Date
idevakk
285b995afb fix: auto-run safe migrations in entrypoint for missing cache/queue tables 2026-03-01 08:51:19 +05:30
idevakk
0d9a524267 fix: auto-create database.sqlite gracefully in existing folder to prevent laravel fallback crashes 2026-03-01 08:45:46 +05:30
idevakk
b30da6614a feat: setup custom webdevops Dockerfile with explicit PHP 8.4 Zemailnator extensions and configs 2026-03-01 08:36:49 +05:30
idevakk
0aed57bc2c fix: remove docker-compose.yml in favor of pure Dockerfile deployment for simplicity 2026-03-01 00:08:55 +05:30
idevakk
6d24d1f6fc fix: add zip extension to php-extension-installer 2026-02-28 23:50:35 +05:30
idevakk
189c2d7c58 fix: use php-extension-installer for PHP 8.4 IMAP PECL compilation 2026-02-28 23:46:27 +05:30
idevakk
7f58ca9f45 fix: migrate Dockerfile to php:8.4-fpm-alpine to restore native IMAP support 2026-02-28 23:43:51 +05:30
idevakk
66b5d2f89e docs: move MailOps webhook handover document to the docs directory 2026-02-28 23:38:18 +05:30
idevakk
a04222dcf3 fix: restore missing Dockerfile 2026-02-28 23:38:00 +05:30
idevakk
58aa4d2dbc docs: update Project.md with Dokploy architecture and resolved tech debt 2026-02-28 23:28:01 +05:30
idevakk
e342c2bdae chore: remove redis and mariadb from compose for standalone deployment 2026-02-28 23:26:19 +05:30
idevakk
c312ec3325 feat: Prepare Zemailnator for Dokploy deployment
- Add highly optimized Dockerfile with Nginx and PHP-FPM 8.4
- Add docker-compose.yml configured with Redis and MariaDB 10.11
- Implement entrypoint.sh and supervisord.conf for background workers
- Refactor legacy IMAP scripts into scheduled Artisan Commands
- Secure app by removing old routes with hardcoded basic auth credentials
- Configure email attachments to use Laravel Storage instead of insecure public/tmp
2026-02-28 23:17:39 +05:30
idevakk
bf5b797cd8 fix(deps): bump dependencies version 2026-02-12 23:00:34 +05:30
idevakk
50797b25e9 fix(page): correct page content layout from horizontal to vertical stacking 2025-12-15 13:51:56 +05:30
idevakk
bd5eade3d2 fix(addon): correct blog array access in template
Change object property access to array access for blog data in add-on template.
  The config('app.blogs') returns arrays not objects, causing "Attempt to read
  property 'slug' on array" error on /temp-gmail route.

  Fixes $blog->slug, $blog->post_image, and $blog->post to use array syntax
  in resources/views/livewire/add-on.blade.php:607,614,616
2025-12-10 03:13:47 -08:00
idevakk
77c6c5f73d fix(blog): correct post content layout from horizontal to vertical stacking
Remove flex items-center from blog post content container that was causing
  content elements to display horizontally instead of their natural vertical
  flow. This ensures proper text and element stacking within individual
  blog posts.

  Fixes layout issue in resources/views/livewire/blog.blade.php
2025-12-10 03:06:04 -08:00
idevakk
29b20a3856 refactor: improve sandbox configuration parsing 2025-12-10 03:28:00 +05:30
idevakk
9307b4e3e4 refactor(users): use unified subscription scopes in filter
- Replace manual subscription queries with dedicated User model scopes
  - Use withActiveSubscription() and withoutActiveSubscription() methods
  - Improve consistency and maintainability of subscription logic
  - Remove Stripe-specific field references for multi-provider support
2025-12-09 11:44:19 -08:00
idevakk
4028a9a21e feat(usernames): update unique constraint to composite with type and provider
- Remove single unique constraint on username
  - Add composite unique constraint on username, username_type, and provider_type
  - Update Filament username form validation with custom unique rule
  - Add descriptive validation message for duplicate usernames
2025-12-09 10:14:50 -08:00
idevakk
1c4298cdaf feat(domains): update unique constraint to composite with type and provider
- Remove single unique constraint on domain name
  - Add composite unique constraint on name, domain_type, and provider_type
  - Update Filament domain form validation with custom unique rule
  - Add descriptive validation message for duplicate domains
2025-12-08 10:57:56 -08:00
idevakk
8d8657cc5c chore: add ADMIN_EMAIL key in .env.example 2025-12-08 09:55:27 -08:00
idevakk
0d33c57b32 feat(notifications): implement comprehensive telegram notifications for payment providers
- Add NotifyMe trait with centralized Telegram bot integration
  - Implement webhook notifications for Polar, OxaPay, and ActivationKey providers
  - Add subscription lifecycle notifications (create, activate, cancel, pause, resume)
  - Enhance Polar webhook processing with user context and error handling
  - Fix subscription.updated and subscription.canceled webhook column errors
  - Add idempotent webhook processing to prevent duplicate handling
2025-12-08 09:25:19 -08:00
idevakk
8d8cd44ea5 feat(payment): add comprehensive OxaPay sandbox and payment configuration options
Add sandbox API keys, callback URL configuration, and additional payment options including currency, lifetime, fee settings, underpayment coverage, auto withdrawal, and mixed payment support to
  the OxaPay provider seeder.
2025-12-07 09:16:48 -08:00
idevakk
9a32511e97 feat(payment): implement OxaPay provider and non-recurring subscription sync
- Add comprehensive OxaPay payment provider with invoice creation, webhook processing, and subscription status sync
  - Implement conditional payload fields (to_currency, callback_url) based on configuration
  - Create universal sync command for all non-recurring payment providers
  - Add subscription model fields for payment tracking
  - Implement proper status mapping between OxaPay and Laravel subscription states
  - Add webhook signature validation using HMAC SHA512
2025-12-07 09:01:53 -08:00
idevakk
5fabec1f9d fix(plans): prevent deletion of plans with active subscriptions
- Fix bulk delete and individual delete actions using before() hook with halt()
  - Add daily/weekly billing cycle options to plan resource and Polar provider
  - Enhance payment confirmation with dynamic polling and loading states
  - Add graceful handling for deleted plans in subscription display
  - Update Polar provider to support dynamic billing cycles
2025-12-07 02:23:14 -08:00
idevakk
1b438cbf89 feat(webhooks): enhance Polar webhook processing with proper event handling
- Add support for subscription.uncanceled webhook event
  - Fix spelling mismatch for subscription.canceled (Polar) vs subscription.cancelled (code)
  - Implement proper cancel_at_period_end handling in subscription.canceled events
  - Add cancelled_at field updates for subscription.updated events
  - Handle Polar's spelling variants (canceled_at vs cancelled_at) consistently
  - Remove non-existent pause_reason column from subscription uncanceled handler
  - Enhance webhook logging with detailed field update tracking
  - Add comprehensive cancellation metadata storage in provider_data
  - Gracefully handle null provider_subscription_id in payment confirmation polling

  All Polar webhook events now properly sync subscription state including
  cancellation timing, reasons, and billing period details.
2025-12-07 00:57:46 -08:00
idevakk
289baa1286 feat(payments): implement standard webhooks validation system
Add comprehensive webhook validation and processing system with Polar.sh integration:

  - Create built-in Standard Webhooks package following official specification
  - Implement HMAC-SHA256 signature validation with base64 encoding
  - Add webhook factory for multi-provider support (Polar, Stripe, generic)
  - Replace custom Polar webhook validation with Standard Webhooks implementation
  - Add proper exception handling with custom WebhookVerificationException
  - Support sandbox mode bypass for development environments
  - Update Polar provider to use database-driven configuration
  - Enhance webhook test suite with proper Standard Webhooks format
  - Add PaymentProvider model HasFactory trait for testing
  - Implement timestamp tolerance checking (±5 minutes) for replay protection
  - Support multiple signature versions and proper header validation

  This provides a secure, reusable webhook validation system that can be extended
  to other payment providers while maintaining full compliance with Standard
  Webhooks specification.

  BREAKING CHANGE: Polar webhook validation now uses Standard Webhooks format
  with headers 'webhook-id', 'webhook-timestamp', 'webhook-signature' instead of
  previous Polar-specific headers.
2025-12-06 22:49:54 -08:00
idevakk
15e018eb88 feat(payment): implement comprehensive Polar subscription sync with proper date and cancellation handling
- Add Polar-specific date field mapping in PaymentOrchestrator (current_period_start, current_period_end, cancelled_at, trial_end)
  - Handle both cancellation scenarios: cancel_at_period_end=true and existing cancelled_at timestamp
  - Map customer_cancellation_reason and customer_cancellation_comment from Polar to database
  - Update billing page to show correct renewal vs expiry dates based on cancellation status
  - Restrict cancel button to activation_key provider only (Polar uses customer portal)
  - Fix button spacing between "Manage in Polar" and "Sync" buttons
  - Ensure both "Sync" and "Recheck Status" buttons use identical sync functionality
2025-12-06 10:42:25 -08:00
idevakk
0724e6da43 feat(payments): implement smart Polar subscription sync with checkout tracking
- Add provider_checkout_id column to separate checkout ID from subscription ID
   - Update Polar provider to store checkout ID separately and set subscription ID to null initially
   - Implement smart sync logic that queries Polar API when subscription ID is missing
   - Add fetchPolarSubscriptionId method to find active subscriptions via customer ID
   - Update webhook handlers to use provider_checkout_id for subscription lookup
   - Make makeAuthenticatedRequest public to enable Subscription model API access
   - Support plan metadata matching for accurate subscription identification
   - Add fallback to most recent active subscription when no exact match found

   This resolves sync button issues by properly tracking checkout vs subscription IDs
   and enables automatic subscription ID recovery when webhooks fail.
2025-12-06 02:37:52 -08:00
idevakk
5ee5c5b8dc feat(billing): implement Polar customer portal integration
- Add comprehensive billing page with current subscription display and transaction history
   - Integrate Polar.sh customer portal for subscription management
   - Fix Polar API endpoint from /customer-portal to /customer-sessions
   - Use Polar's direct customer_portal_url response for seamless redirect
   - Add responsive button layout with cursor-pointer styling
   - Implement human-readable timestamps using diffForHumans()
   - Add subscription sync functionality with 30-minute recheck window
   - Include subscription cancellation with modal confirmation
   - Support activation key provider with pending activation display
   - Add proper error handling and user feedback messages
2025-12-06 02:03:56 -08:00
idevakk
ebb041c0cc feat(payment): implement secure payment cancellation page with session tracking
- Create PaymentCancelController with authentication and subscription detection
  - Design responsive cancellation view with red/orange gradient theme
  - Add session token logging and recent subscription lookup functionality
  - Update payment cancel route to use new controller with auth middleware
  - Include security assurances and proper navigation to checkout/dashboard
  - Remove broken route references and ensure all buttons link to valid pages
2025-12-05 06:59:08 -08:00
idevakk
34183dc3cb feat(payment): implement secure 1:1 Polar customer binding system
- Add polar_cust_id column to users table for direct customer mapping
  - Rewrite PolarProvider customer logic to use stored customer IDs
  - Eliminate email-based customer lookup to prevent cross-user contamination
  - Implement self-healing mechanism for invalid customer IDs
  - Maintain external_id binding for Polar's reference system
  - Add comprehensive logging for customer lookup operations
2025-12-04 13:05:47 -08:00
idevakk
cd8d6f1165 feat(payments): add error sanitization for Polar payment provider
- Add sanitizePolarErrorMessage() method to convert API errors to user-friendly messages
  - Improve error logging with structured data instead of raw response bodies
  - Add validation error handling with field-specific messages
  - Remove sensitive information (emails, domains, UUIDs) from error messages
  - Update checkout, subscription, customer, and product error handling
  - Add status code-based error mapping for better user experience
2025-12-04 12:30:39 -08:00
idevakk
8950988eac feat(payment): implement beautiful payment confirmation page with real-time status checking
- Add PaymentSuccessController with authentication and subscription selection logic
   - Create PaymentConfirmation Livewire component with polling mechanism
   - Implement real-time subscription status verification via Polar provider API
   - Add confetti animation for successful payment confirmation
   - Design responsive payment success page with dark mode support
   - Fix Polar provider field mapping (updated_at -> modified_at)
   - Add comprehensive error handling and logging
   - Support multiple subscription status states (verifying, activated, pending, error)
   - Implement automatic polling with 30-second intervals (max 5 attempts)
   - Add fallback redirects and user-friendly status messages
2025-12-04 11:59:09 -08:00
idevakk
75086ad83b feat(payment): integrate Polar.sh payment provider with checkout flow
- Build PolarProvider from scratch with proper HTTP API integration
  - Add encrypted configuration loading from payment_providers table via model
  - Implement sandbox/live environment switching with proper credential handling
  - Fix product creation API structure for Polar.sh requirements
  - Add comprehensive error handling and logging throughout checkout flow
  - Fix PaymentController checkout URL handling to support Polar's checkout_url response
  - Add debug logging for troubleshooting checkout session creation
  - Support both regular and trial checkout flows for Polar payments
2025-12-04 10:29:25 -08:00
idevakk
c2c18f2406 chore: add curl ext as dependency and fix mcp command for laravel-boost 2025-12-04 07:17:10 -08:00
idevakk
724a2d9a1f feat(payment): implement database-driven payment provider system with encrypted configuration support
- Add PaymentProviderSeeder with initial provider data (Stripe, Lemon Squeezy, Polar, OxaPay, Crypto, Activation Key)
  - Create migration to disable JSON constraints and change configuration column from JSON to TEXT
  - Update PaymentProvider model cast from 'array' to 'encrypted:array' for secure configuration storage
2025-12-03 02:32:22 -08:00
idevakk
3b908484de refactor(pricing): dynamic payment provider buttons with database-driven text
- Replace hardcoded provider-specific buttons with dynamic database-driven approach
  - Update getPlanProviders() to include display_name from payment_providers table
  - Simplify plan-card.blade.php with single if/else logic for all providers
  - Move trial button outside loop and comment for future implementation
  - Use "Pay with {display_name}" pattern for consistent button text
  - Maintain special handling for activation_key provider with disabled state
2025-12-02 11:58:44 -08:00
idevakk
3cd6c0f7cc refactor(pricing): optimize plan provider retrieval with active filtering
- Replace getAllowedProviders() method with direct database query
  - Add filtering for enabled plan providers and active payment providers
  - Include sort ordering for consistent provider display
  - Improve performance by using direct database access instead of model method
2025-12-02 11:16:20 -08:00
idevakk
6056740a3f refactor: change group to 'Admin' for better navigation 2025-12-02 10:24:39 -08:00
idevakk
2eaf38e139 feat(failed-jobs): add database-agnostic failed jobs with bulk actions
- Create custom implementation to replace vendor plugin
  - Add database-agnostic JSON queries (MySQL, MariaDB, PG, SQLite, SQLSRV)
  - Implement Retry/Prune header actions with queue selection
  - Maintain all original features: filters, search, actions, bulk operations

  BREAKING CHANGE: New route /failed-jobs/compatible-failed-jobs

  Fixes MariaDB JSON syntax errors
2025-12-02 10:23:55 -08:00
idevakk
d767c6cf59 feat(plans): enhance plan management with dynamic providers, improved UI, and bug fixes
Dynamic Provider Integration:
  - Replace hardcoded provider arrays with database-driven payment_providers lookup
  - Display provider status (Active/Inactive) in selection dropdowns
  - Add provider_variant_id and provider_product_id input fields to plan configuration
  - Update EditPlan and SubscriptionForm with dynamic provider selection
  - Add empty state handling with helpful guidance when no providers exist

  UI/UX Improvements:
  - Format billing_cycle_days to readable text (Daily, Weekly, Monthly, Quarterly, Annually)
  - Add color-coded badges for billing cycle frequency
  - Fix plan_providers and plan_feature_limits count display with eager loading
  - Implement intelligent color coding for count indicators
  - Add visual status indicators for provider availability

  Database Compatibility:
  - Fix SQLite strftime() compatibility across all dashboard widgets
  - Fix CAST AS REAL syntax in ChurnAnalysis widget
  - Add database-agnostic date and cast expression methods
  - Support MySQL, SQLite, PostgreSQL, and SQL Server

  Bug Fixes:
  - Fix null reference error in SubscriptionForm provider_data access
  - Add null safety checks for new subscription creation
  - Optimize queries with withCount() to prevent N+1 issues

  Performance Optimizations:
  - Add eager loading with withCount() for relationship counts
  - Optimize plan provider and feature limit queries
  - Prevent N+1 query issues in resource tables

  BREAKING CHANGE: Plan provider configuration now uses dynamic provider options
  from payment_providers table instead of hardcoded list.
2025-12-02 09:47:51 -08:00
idevakk
e60973c391 fix(widgets): add multi-database compatibility to all dashboard widgets
Replace SQLite-specific functions with database-agnostic expressions to support
  MySQL, SQLite, PostgreSQL, and SQL Server across all Filament dashboard widgets.

  - Fix strftime() date formatting in SubscriptionMetrics, RevenueMetrics, and TrialPerformance
  - Fix CAST AS REAL syntax in ChurnAnalysis widget
  - Add getDateFormatExpression() method for date function compatibility
  - Add getCastExpression() method for CAST syntax compatibility
  - Support MySQL/MariaDB, SQLite, PostgreSQL, and SQL Server drivers
  - Maintain identical functionality across all database types

  Fixes multiple SQLSTATE[42000] syntax errors when using MySQL/MariaDB databases.
2025-12-02 07:09:30 -08:00
idevakk
659325c01d feat(seeder): implement interactive database seeder with auto-discovery
- Add dynamic seeder discovery from database/seeders directory
  - Create interactive checkbox interface for Unix systems with arrow key navigation
  - Implement Windows-compatible fallback mode with number-based selection
  - Add cross-platform terminal detection and appropriate interface handling
  - Include descriptive information and default selection for each seeder
  - Support bulk operations (select all/none) and individual toggling
2025-11-30 09:27:37 -08:00
idevakk
a84a4a0c15 feat: make admin email configurable and interactive password seeding 2025-11-30 08:06:23 -08:00
idevakk
9f45e37693 fix: resolve plan selection off-by-one error in activation key generator 2025-11-28 07:05:40 -08:00
idevakk
cc34c9aca3 chore: add payment routes for our UPS 2025-11-28 06:03:43 -08:00
idevakk
d4de074161 fix: add fallback value for setting variables 2025-11-28 05:59:25 -08:00
idevakk
a33c0dfa95 chore: optimized migration files for mariadb 2025-11-27 06:44:48 -08:00
idevakk
468409f0fc chore: upgrade laravel-boost ai guidelines 2025-11-22 08:54:40 -08:00