Commit Graph

445 Commits

Author SHA1 Message Date
javayhu
7ace00c139 chore: update LICENSE 2025-04-10 23:16:20 +08:00
javayhu
876eb01506 chore: add TODO comments for future enhancements
- Added TODO comments in middleware.ts, routes.ts, sitemap.ts, and routing.ts to indicate areas for future improvements, including middleware rules for protected routes, route configuration, and sitemap entries.
- Included a comment in globals.css for reference to shadcn UI theming documentation.
2025-04-10 10:07:34 +08:00
javayhu
2cb95d8a1a refactor: update translation keys in configuration files
- Modified translation keys in avatar, footer, navbar, sidebar, and social configuration files to enhance modularity and maintainability.
- Removed redundant 'Marketing' prefix from translation keys for improved clarity and consistency across the application.
2025-04-10 09:56:43 +08:00
javayhu
643cbbef9b refactor: remove deprecated config.tsx and update import paths
- Deleted the config.tsx file as it is no longer needed for backward compatibility.
- Updated import paths in blog-card.tsx to reference the new location of PLACEHOLDER_IMAGE in constants.ts.
- Introduced a new constants.ts file to define PLACEHOLDER_IMAGE for improved modularity and maintainability.
2025-04-10 09:56:21 +08:00
javayhu
710dbe00b6 refactor: modularize configuration files and update imports
- Introduced new configuration files for navbar, footer, avatar, sidebar, social links, and payment plans to enhance modularity and maintainability.
- Updated import paths across the codebase to reference the new configuration files.
- Removed deprecated functions and streamlined the config.tsx file for better organization.
2025-04-10 00:58:14 +08:00
javayhu
4d47201ce3 refactor: reorganize website configuration and update imports
- Moved website configuration to a new file for better modularity and maintainability.
- Updated import paths across the codebase to reference the new website configuration location.
- Removed the old website configuration from the config.tsx file to streamline the codebase.
2025-04-10 00:43:52 +08:00
javayhu
165673a998 feat: add pricing plans and enhance payment configuration
- Introduced new pricing plans (Free, Pro, Lifetime) with detailed descriptions and features in both English and Chinese.
- Updated payment configuration to include new plans and their pricing structures.
- Refactored payment-related functions to retrieve pricing plans consistently across the application.
- Enhanced the PricingTable component to dynamically display available plans based on the new configuration.
- Removed deprecated payment configuration file to streamline the codebase.
2025-04-10 00:26:55 +08:00
javayhu
31a4823b54 refactor: update storage imports and improve function naming
- Changed import paths for StorageError to use the correct types module across storage-related API routes.
- Renamed functions in storage/index.ts for clarity, updating getStorageProvider and initializeStorageProvider to better reflect their functionality.
- Streamlined API endpoint constants for improved readability and maintainability in storage operations.
2025-04-09 23:50:57 +08:00
javayhu
41a2380791 refactor: reorganize mail and newsletter provider logic for clarity
- Updated mail provider functions to improve naming consistency and clarity, renaming initializeMailProvider to getMailProvider and vice versa.
- Enhanced README documentation for both mail and newsletter modules to reflect structural changes and clarify usage.
- Streamlined imports and exports in mail and newsletter files for better organization.
- Added error handling in ResendNewsletterProvider constructor to ensure required environment variables are set.
- Removed deprecated code and unnecessary type exports to simplify the codebase.
2025-04-09 23:44:11 +08:00
javayhu
d491835ef1 refactor: consolidate email sending logic and update template handling
- Merged sendTemplate and sendRawEmail functions into a single sendEmail function for improved clarity and maintainability.
- Introduced getTemplate function to handle rendering of email templates with context and locale.
- Updated EmailTemplates export to include all available templates directly in types.ts.
- Removed deprecated mail.ts and templates/index.ts files to streamline the codebase.
2025-04-09 23:28:57 +08:00
javayhu
9dca440d91 refactor: rename send function to sendEmail for clarity
- Updated references from send to sendEmail in send-message.ts and auth.ts for consistency.
- Adjusted exports in mail/index.ts to reflect the new function name.
- Removed unused mail-config.ts file to streamline the mail configuration process.
2025-04-09 23:18:01 +08:00
javayhu
2779eb9d5f refactor: update email templates and types for improved clarity
- Renamed Template type to EmailTemplate for consistency across the codebase.
- Updated email template functions to use simplified translation keys.
- Removed unused MailConfig interface and adjusted default mail configuration.
- Enhanced imports in mail-related files for better organization and readability.
2025-04-09 23:13:27 +08:00
javayhu
7b5754514c chore: rename email templates folder 2025-04-09 23:04:17 +08:00
javayhu
da67593e27 refactor: enhance pricing table logic
- Changed button class in ForgotPasswordForm and ResetPasswordForm to improve user interaction.
- Updated PricingCard to replace Check icon with CheckCircleIcon for better visual representation.
- Enhanced PricingTable logic to filter out disabled plans and prices, ensuring only available options are displayed.
- Added comments in payment types to clarify when to disable plans and prices for existing users.
2025-04-09 22:15:59 +08:00
javayhu
3c05657fe0 feat: add userId handling and enhance payment actions & optimize the whole payment process
- Introduced userId parameter in createCheckoutAction and createPortalAction for improved user-specific session management.
- Updated components to pass userId instead of customerId, aligning with the new payment structure.
- Added new actions to retrieve active subscription and lifetime status, ensuring users can check their subscription details securely.
- Created SQL migration for new payment-related tables, establishing a robust foundation for payment management.
- Enhanced error handling and logging in payment actions for better debugging and user feedback.
2025-04-09 14:31:08 +08:00
javayhu
e45d2504e6 refactor: clean up billing components and improve session handling
- Removed commented-out code in BillingPage to enhance readability.
- Updated CheckoutButton to always refetch session data for accurate user information.
- Streamlined console log statements in BillingCard for better clarity.
- Adjusted comments in BillingCard to provide clearer context on button visibility based on user status.
- Refactored usePayment hook to fetch payment data whenever the user session changes, improving data accuracy.
2025-04-09 01:19:07 +08:00
javayhu
ced7f41af2 refactor: update subscription handling and use payment & payment store
- Enhanced getCustomerSubscriptionAction to return the most recent active or trialing subscription when multiple subscriptions exist.
- Simplified UpgradeCard component by removing the user prop and directly utilizing the payment hook for current plan checks.
- Updated CustomerPortalButton to use 'default' variant instead of 'outline'.
- Refactored PricingTable to accept currentPlan instead of currentPlanId for improved clarity.
- Adjusted BillingCard to streamline error handling and utilize currentPlan for determining user status.
2025-04-09 00:22:19 +08:00
javayhu
097c1343be refactor: rename and update subscription handling methods
- Renamed ListCustomerSubscriptionsParams to getCustomerSubscriptionsParams for clarity.
- Updated listCustomerSubscriptions method in StripeProvider to getCustomerSubscriptions, improving consistency in naming.
- Adjusted method implementations to reflect the new naming conventions, enhancing code readability and maintainability.
2025-04-08 23:13:02 +08:00
javayhu
f34ee11df8 refactor: update payment schema and improve subscription handling
- Made customerId in the payment schema mandatory to ensure data integrity.
- Updated Subscription interface to make currentPeriodStart optional and replaced canceledAt with trialStartDate for better clarity.
- Refactored listCustomerSubscriptions method in StripeProvider to fetch subscriptions from the database instead of Stripe API, enhancing performance and maintainability.
- Added a new private method to map Stripe subscription status to the application's PaymentStatus for improved status handling.
2025-04-08 23:04:42 +08:00
javayhu
5753b1c28f feat: introduce payment management system and refactor related components
- Added new SQL migration to create "account", "payment", "user", and "verification" tables, establishing a foundational structure for payment management.
- Updated existing codebase to replace subscription references with payment, including hooks, providers, and actions.
- Refactored components to utilize the new payment system, enhancing clarity and maintainability.
- Removed deprecated subscription provider and related logic, streamlining the payment handling process.
- Enhanced error handling and logging for improved debugging in payment management.
2025-04-08 01:48:51 +08:00
javayhu
76e618bbea refactor: update payment types and improve subscription handling
- Renamed SubscriptionTypes to PaymentTypes to better reflect the payment model.
- Updated references in getUserLifetimeStatus action and StripeProvider to use the new PaymentTypes enum.
- Adjusted type definitions in payment/types.ts for clarity and consistency in payment handling.
- Enhanced comments to clarify the purpose of payment types and their usage in the codebase.
2025-04-08 01:10:25 +08:00
javayhu
e59824c97b feat: add subscription type handling and update related SQL migrations
- Introduced a new column "type" in the "subscription" table to differentiate between subscription types (one-time and recurring).
- Updated existing records to set the "type" based on the presence of "subscription_id".
- Modified the "interval" column to allow null values.
- Updated SQL snapshots and journal to reflect the new migration versions.
- Enhanced the getUserLifetimeStatus action to utilize the new subscription type logic for better membership status checks.
2025-04-08 01:04:23 +08:00
javayhu
c4fdcddf0a feat: enhance checkout session metadata and payment status handling
- Added userId to metadata in createCheckoutAction for improved webhook event processing.
- Updated StripeProvider to handle userId and planId from session metadata, enhancing subscription management.
- Introduced 'paused' status in PaymentStatus type for better subscription state representation.
- Improved comments for clarity in metadata handling and subscription status conversion.
2025-04-08 00:27:42 +08:00
javayhu
49a9de1a05 refactor: standardize session handling and clean up payment-related code
- Replaced instances of `authSession` with `session` for consistency across actions.
- Removed unused `getCustomer` function and related types from payment module to streamline codebase.
- Enhanced `createOrGetCustomer` method to simplify customer creation logic.
- Updated metadata handling in checkout session creation for improved clarity and maintainability.
2025-04-08 00:15:08 +08:00
javayhu
52559865ca feat: remove lifetimeMember from user schema && update fetch subscription
- Created SQL migration to drop unique constraint and columns from the user table.
- Updated journal and snapshot metadata to reflect the new migration version.
- Refactored user schema to remove the lifetimeMember field, aligning with the new subscription management logic.
- Enhanced getUserLifetimeStatus action to utilize updated subscription data structure.
2025-04-07 23:35:15 +08:00
javayhu
a4075c4728 feat: add getUserLifetimeStatus action and integrate with subscription store
- Implemented getUserLifetimeStatus action to retrieve user's lifetime membership status from the database.
- Updated subscription store to check lifetime membership status against the database if session data is outdated.
- Enhanced error handling and logging for better debugging in the subscription management process.
- Added console logs for tracking user session and lifetime status checks in billing components.
2025-04-07 01:28:36 +08:00
javayhu
7a5cf227c4 feat: implement subscription management features
- Added SubscriptionProvider to manage subscription state and initialize it on app load.
- Integrated useSubscription hook for accessing subscription data across components.
- Updated NavUser and UserButton components to reset subscription state on sign out.
- Refactored BillingCard to utilize the new subscription logic, improving clarity and performance.
- Enhanced UpgradeCard to conditionally render based on subscription status.
2025-04-06 23:59:48 +08:00
javayhu
be82337924 refactor: update billing card logic and localization
- Renamed variables for clarity, changing `isLifetimeMember` to `isLifetimePlan` and `canUpgrade` logic to improve readability.
- Added localization support for the price label in both English and Chinese.
- Optimized the UI to conditionally display messages for free and lifetime plans, enhancing user experience.
2025-04-06 23:08:53 +08:00
javayhu
9b0d354683 chore: optimize utils.tsx & remove other functions out 2025-04-06 23:01:53 +08:00
javayhu
3bd408e551 chore: remove getLocaleDate & change to formatDate 2025-04-06 22:56:55 +08:00
javayhu
c810acae4c refactor: optimize billing card UI and logic 2025-04-06 22:27:27 +08:00
javayhu
077df4ee28 chore: upload example env file 2025-04-06 22:26:50 +08:00
javayhu
6000c438da chore: refresh session after create new customer id for user
- Commented out console log statements in createCheckoutSession, createCustomerPortalSession, getUserSubscription, PricingCard, and CheckoutButton for cleaner output.
- Updated the reset-password-form to optimize the token validation check with a clearer comment.
2025-04-06 21:00:52 +08:00
javayhu
15ba1ef120 refactor: update productId to priceId in payment components and types
- Replaced instances of productId with priceId in PricingCard, BillingCard, and payment utility functions for consistency.
- Updated the Price interface in types.ts to reflect the change from productId to priceId.
- Adjusted payment configuration to use priceId instead of productId for better clarity and alignment with Stripe's API.
2025-04-06 17:30:47 +08:00
javayhu
a2849a9758 feat: add contact message email template and localization support
- Introduced a new email template for contact messages, including localization for English and Chinese.
- Updated the send-message action to utilize the new contact message template and added locale support.
- Enhanced the contact form validation schema and improved code formatting for consistency.
2025-04-06 17:28:31 +08:00
javayhu
345528e4b3 chore: remove username plugin in better auth 2025-04-06 17:09:42 +08:00
javayhu
1e8fe818bf feat: add interval column to subscription table and update subscription event handlers
- Introduced a new "interval" column in the "subscription" table to store subscription intervals.
- Updated the journal and snapshot metadata to reflect the new schema version and changes.
- Adjusted the schema definition to include the new column for better subscription management.
2025-04-06 15:27:59 +08:00
javayhu
cf1f20f867 chore: optimize pricing page 2025-04-06 12:49:36 +08:00
javayhu
788aa857a0 chore: rename legal pages routes 2025-04-06 11:41:04 +08:00
javayhu
2248cfdc35 feat: add subscription management features and database schema updates
- Introduced new database tables for managing subscriptions and user subscriptions.
- Updated package.json with new database commands for generation, migration, and studio.
- Refactored the user schema to remove deprecated fields and added foreign key relationships.
- Enhanced Stripe payment provider logic to handle subscription creation, updates, and cancellations.
- Improved error handling and logging for subscription events.
2025-04-06 11:12:27 +08:00
javayhu
e9c9d9f451 feat: support locale for customer portal session creation and improve upgrade card logic
- Added locale parameter to the createCustomerPortal function for better localization support.
- Simplified the membership check in the UpgradeCard component to only consider lifetime membership.
- Updated billing card logic to fetch subscription data based on lifetime membership status.
2025-04-06 09:40:33 +08:00
javayhu
73066348ea chore: rename upgrade card 2025-04-06 08:56:27 +08:00
javayhu
8d0f0a329c feat: add LICENSE 2025-04-06 08:54:10 +08:00
javayhu
36e76ef080 feat: enhance billing management features and localization updates
- Added new localization keys for billing management in English and Chinese message files.
- Updated the sidebar to include a billing link.
- Refactored the billing card component to improve loading state handling and user session management.
- Enhanced subscription fetching logic to include better error handling and logging.
- Adjusted the upgrade card visibility based on user membership status.
2025-04-06 00:48:08 +08:00
javayhu
b639a9e50a chore: optimize loading state when fetch current user 2025-04-05 22:30:05 +08:00
javayhu
df189215eb feat: add config for maxDuration to 60 for vercel 2025-04-05 20:21:57 +08:00
javayhu
05d811aa4e chore: update localization keys and remove schemas for auth pages
- Added new localization keys for email and password requirements in English and Chinese message files.
- Refactored page retrieval logic by replacing `getCustomPage` with `getPage` in cookie, privacy, and terms of service policy pages.
- Removed the unused `schemas.ts` file.
2025-04-05 17:45:54 +08:00
javayhu
ba1c87fc3e refactor: move some shared components to layout folder 2025-04-05 17:30:47 +08:00
javayhu
970ff2145e chore: move motion components 2025-04-05 17:30:22 +08:00
javayhu
fab6590ac7 chore: remove useless theme css files 2025-04-05 17:15:09 +08:00