Commit Graph

842 Commits

Author SHA1 Message Date
javayhu
adb9b80572 fix: update default expireDays assignment in addCredits function 2025-07-08 00:51:04 +08:00
javayhu
2e8f70dc76 feat: enhance credits management with new configurations
- Added credit expiration days, register gift credits, and free monthly credits options in website configuration.
- Updated credits handling functions to utilize the new configuration settings for improved flexibility and maintainability.
- Removed obsolete constants related to credits from constants.ts to streamline the codebase.
- Enhanced type definitions for credits configuration in index.d.ts for better clarity.
2025-07-08 00:48:17 +08:00
javayhu
b94fd34be5 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-08 00:32:08 +08:00
javayhu
0d4e8fe899 docs: add CLAUDE.md for project guidance 2025-07-08 00:30:40 +08:00
javayhu
73ce18f564 refactor: update credit package descriptions and improve component structure
- Revised credit package descriptions in the English JSON file for clarity and consistency.
- Refactored CreditPackages component to utilize a more efficient method for retrieving credit packages.
- Removed obsolete functions and streamlined the code for better maintainability and performance.
2025-07-07 01:10:06 +08:00
javayhu
e430a0c319 feat: implement credit packages management with translations and server integration
- Added new credit packages structure in English and Chinese JSON files for better localization.
- Introduced server-side functions to retrieve credit packages and package details.
- Updated client-side components to utilize new credit package retrieval methods.
- Refactored existing code to enhance modularity and maintainability by separating client and server logic.
- Removed obsolete credit package retrieval functions to streamline the codebase.
2025-07-07 00:47:43 +08:00
javayhu
f7f7be2ef0 feat: add credits config in website config
- Added a new credits management system with configurable credit packages in website.tsx.
- Replaced hardcoded credit package definitions with a dynamic retrieval system using getCreditPackages and getCreditPackageById functions.
- Updated CreditPackages and StripePaymentForm components to utilize the new credit package structure.
- Removed obsolete CREDIT_PACKAGES constant from constants.ts to streamline the codebase.
- Enhanced type definitions for credit packages in types.ts for better clarity and maintainability.
- Updated README.md to reflect changes in credit packages configuration.
2025-07-07 00:04:45 +08:00
javayhu
eafb3775e8 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-06 23:28:31 +08:00
javayhu
0af0aa3b09 refactor: reorganize credit transaction types and update imports
- Moved CREDIT_TRANSACTION_TYPE from constants to a new types.ts file for better modularity.
- Updated import paths in credit-related components to reflect the new structure.
- Removed the old CREDIT_TRANSACTION_TYPE definition from constants.ts to streamline the codebase.
2025-07-06 23:25:38 +08:00
javayhu
04c2b2d7ee refactor: update translations and improve table component structure
- Removed unused translation keys from English and Chinese JSON files.
- Updated UsersTable and CreditTransactionsTable components to utilize a centralized translation function for table-related messages.
- Initialized sorting state in both table components for consistent default behavior.
2025-07-06 18:20:31 +08:00
javayhu
d9cda3e122 feat: enhance credits settings with tabbed interface and improved translations
- Implemented a tabbed interface in the CreditsPage component to separate balance and transactions views.
- Updated CreditPackages and CreditTransactionsPageClient components to utilize the new tab structure.
- Enhanced translation support for credits-related messages in both English and Chinese.
- Improved error handling and user feedback in credit-related components.
- Refactored CreditTransactionsTable to utilize translations for table headers and pagination controls.
2025-07-06 17:17:24 +08:00
javayhu
d8a12343c8 refactor: adjust spacing in layout components for consistency
- Updated spacing from `space-y-10` to `space-y-8` in layout components for Billing, Credits, Notifications, Profile, and Security to ensure uniformity across the settings pages.
2025-07-06 11:30:10 +08:00
javayhu
40af0f6922 feat: add credit transactions table
- Introduced a new CreditTransactionsPageClient component to display credit transactions.
- Implemented getCreditTransactions action for fetching transaction data.
- Added CreditTransactionsTable component for rendering transaction details with pagination and sorting.
- Updated English and Chinese translation files to include credit transaction messages.
- Integrated the credit transactions page into the existing credits settings layout.
2025-07-06 10:44:13 +08:00
javayhu
1740c826c7 feat: add CreditsBalance component and integrate into dashboard and navbar
- Introduced a new CreditsBalance component to display user credits.
- Integrated CreditsBalance into DashboardHeader, Navbar, and NavbarMobile for improved visibility of user credits.
- Enhanced user interaction by allowing navigation to the credits settings page.
2025-07-06 00:41:57 +08:00
javayhu
75083b32e4 refactor: reorganize credit-related imports and enhance user feedback
- Updated import paths for credit-related actions and functions to improve module organization.
- Removed redundant refresh trigger declaration in CreditPackages component.
- Simplified success toast message in CreditPackages and PaymentForm components for clarity.
- Introduced a new credits.ts file to centralize credit management logic and improve maintainability.
2025-07-06 00:15:07 +08:00
javayhu
e933844479 feat: enhance credit management with transaction store and UI updates
- Added a new transaction store to manage refresh triggers for credit-related components.
- Updated CreditPackages and StripePaymentForm components to utilize the transaction store for refreshing UI after credit purchases.
- Modified .gitignore to include certificates.
- Introduced a new script in package.json for running the development server with HTTPS support.
2025-07-05 23:59:30 +08:00
javayhu
13bee49f90 feat: add credits section to avatar configuration and update translations
- Added "Credits" entry to the avatar configuration for navigation.
- Updated English and Chinese translation files to include "Credits" label.
- Refactored error messages in credit payment actions for clarity.
- Enhanced loading state management in CreditPackages component.
- Replaced icons in CreditPackages component for improved UI consistency.
2025-07-05 23:25:37 +08:00
javayhu
fe2b1bbe39 feat: add credit purchase functionality with Stripe integration
- Introduced credit purchase payment intent actions in credits.action.ts.
- Created new components for credit packages and Stripe payment form.
- Added routes and layout for credits settings page.
- Updated sidebar configuration to include credits settings.
- Enhanced constants for credit packages with detailed pricing and descriptions.
- Implemented loading and layout components for credits page.
- Integrated payment confirmation handling in Stripe provider.
2025-07-05 22:30:22 +08:00
javayhu
8a9c76c628 fix: add missing newline at end of index.zh.mdx file 2025-07-05 17:11:07 +08:00
javayhu
98421afab8 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-05 15:52:40 +08:00
javayhu
6980507c43 chore: update dashboard and setting pages layout 2025-07-05 15:51:36 +08:00
javayhu
8657bf4e84 chore: show theme selector in demo website only 2025-07-05 10:10:39 +08:00
javayhu
bab58e6420 chore: add @stripe/react-stripe-js 2025-07-05 00:25:11 +08:00
javayhu
8d17bd80c5 feat: implement admin access control in UsersLayout 2025-07-04 23:23:25 +08:00
javayhu
c7e3de816c chore: update credit related functions 2025-07-04 01:02:56 +08:00
javayhu
da26c2cf5d Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-07-02 23:46:20 +08:00
javayhu
cc9a15db8f chore: make DiscordWidget deprecated 2025-07-02 22:52:32 +08:00
javayhu
aaadd7fcf4 fix: add type assertion for image generation response 2025-07-02 01:14:58 +08:00
javayhu
88bb977c7b Merge branch 'dev/credits' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-07-01 00:23:25 +08:00
javayhu
abf8b31ec7 chore: optimize the credit functions 2025-07-01 00:23:21 +08:00
javayhu
12fb19e97b chore: add credit related tables 2025-07-01 00:23:21 +08:00
javayhu
d8904750d9 chore: fix db instance 2025-07-01 00:23:21 +08:00
javayhu
b30355dfe5 chore: update credit related functions (2) 2025-07-01 00:23:21 +08:00
javayhu
dae7a3b0e8 chore: update credits related functions (2) 2025-07-01 00:23:21 +08:00
javayhu
e0c0ff9518 chore: update credits related functions 2025-07-01 00:23:21 +08:00
javayhu
e1b0e2f44c feat: support credits 2025-07-01 00:23:21 +08:00
javayhu
6195df2bc5 chore: update readme 2025-07-01 00:02:51 +08:00
javayhu
3fa44f92c7 chore: add config for enableTurnstileCaptcha 2025-06-30 23:50:56 +08:00
javayhu
55ae5ced9e fix: fix ai image default models 2025-06-30 23:50:01 +08:00
javayhu
111568d746 fix: show captcha when turnstile is enabled only 2025-06-30 23:05:38 +08:00
javayhu
45e6a59fe6 chore: optimize the credit functions 2025-06-30 01:10:14 +08:00
javayhu
684bbdff82 chore: add credit related tables 2025-06-30 00:25:26 +08:00
javayhu
181e478bc3 chore: fix db instance 2025-06-30 00:05:25 +08:00
javayhu
82d0fa1061 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-06-28 23:12:38 +08:00
javayhu
ba3cbe0724
Merge pull request #58 from MkSaaSHQ/dev/ai-image
feat: ai image generator
2025-06-28 22:57:30 +08:00
javayhu
91614ed6e5 fix: fix build error & remove Spinner 2025-06-28 22:50:40 +08:00
javayhu
0453db5ec6 chore: optimize ai image generator 2025-06-28 22:47:40 +08:00
javayhu
1a297e33f9 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/ai-image 2025-06-28 10:12:23 +08:00
javayhu
05b90fb0a7 chore: optimize validate captcha 2025-06-28 10:09:50 +08:00
javayhu
66567cfecd chore: optimize turnstile captcha 2025-06-28 00:34:31 +08:00