Commit Graph

667 Commits

Author SHA1 Message Date
javayhu
1f4bec8eb2 chore: remove docs/components/tabs.client 2025-04-12 13:26:05 +08:00
javayhu
10c7646fb1 chore: remove docs/theme.client 2025-04-12 13:24:13 +08:00
javayhu
c0f4721d49 refactor: simplify theme management and localization
- Removed scaled and mono theme options from the theme selector and related components to streamline theme management.
- Updated localization files to reflect the removal of unused theme translations.
- Cleaned up CSS by eliminating unnecessary theme styles, enhancing maintainability and performance.
- Adjusted the WebsiteMetadata interface to remove references to obsolete themes, improving code clarity.
2025-04-12 13:14:39 +08:00
javayhu
44179984e5 refactor: update theme and payment providers
- Renamed and reorganized the ActiveThemeProvider and PaymentProvider components for better clarity and structure.
- Introduced the ActiveThemeProvider component to manage the active theme and set cookies accordingly.
- Implemented the PaymentProvider component to initialize payment state based on the user's session.
- Updated imports in related components to reflect the new file structure.
2025-04-12 13:03:06 +08:00
javayhu
751b015c04 refactor: remove unused marketing sections and components
- Deleted multiple marketing section files including call-to-action, content, FAQ, features, hero, pricing, stats, and testimonials to streamline the codebase.
- This cleanup enhances maintainability by removing obsolete components that are no longer in use.
2025-04-12 12:46:42 +08:00
javayhu
79dde803b4 refactor: update canonical URLs for legal pages
- Changed canonical URLs for cookie, privacy, and terms pages to remove unnecessary suffixes, enhancing SEO and URL consistency.
- Renamed the layout component for better clarity regarding its purpose in the marketing blocks structure.
2025-04-12 12:44:38 +08:00
javayhu
961163305a refactor: integrate website configuration for localization
- Replaced hardcoded locale data with a centralized website configuration structure, enhancing maintainability and consistency across components.
- Updated various components to utilize the new websiteConfig for locale flags and names, improving code clarity and reducing redundancy.
- Removed obsolete LOCALE_LIST and streamlined routing logic to align with the new configuration approach.
2025-04-12 11:54:45 +08:00
javayhu
8a0f396810 refactor: update price plan retrieval and configuration structure
- Renamed variables in the pricing table and billing card components for clarity, changing 'paymentConfig' to 'pricePlans'.
- Updated the getPricePlans function to return a more explicit Record type for better type safety and maintainability.
- Enhanced the structure of price plans by consolidating translation logic within the returned plans object, improving code organization and readability.
2025-04-12 11:03:27 +08:00
javayhu
b5de0fb940 refactor: optimize website configs
- Updated sidebar, footer, navbar, and user button components to use new naming conventions for configuration retrieval functions, enhancing code clarity and consistency.
- Renamed functions from getSidebarConfig, getFooterConfig, getNavbarConfig, and getAvatarConfig to getSidebarLinks, getFooterLinks, getNavbarLinks, and getAvatarLinks respectively.
- Adjusted the website configuration structure to include metadata for logos and social links, improving maintainability and organization of configuration data.
2025-04-12 10:46:58 +08:00
javayhu
6e1189afc4 feat: add admin user management page and support authroizeOnly for nav item
- Introduced a new admin section with user management capabilities, including a dedicated AdminUsersPage.
- Updated localization files to support new admin titles in English and Chinese.
- Added routing for the admin users page and integrated it into the sidebar configuration.
- Created necessary layout and loading components for the admin section.
- Implemented a data structure for user management, enhancing the overall admin functionality.
2025-04-12 09:54:55 +08:00
javayhu
dd6fb4df85 chore: rename dashboard components prefix with sidebar-
- Added descriptive comments for the DashboardPage, DashboardHeader, DashboardSidebar, SidebarMain, and SidebarUser components to improve code readability and maintainability.
- Enhanced understanding of component purposes and functionalities through clear documentation.
2025-04-12 08:35:05 +08:00
javayhu
f6bec8b78c refactor: restructure sitemap and robots handling
- Removed the old sitemap implementation and replaced it with a new one that generates dynamic routes for categories, posts, and documentation.
- Introduced a new robots.txt handler to manage crawling rules and specify the sitemap location.
- Updated URL handling functions to improve locale support in callback URLs.
- Enhanced the content-collections.ts file by reorganizing documentation comments and reintroducing the extractLocaleAndBase function for better clarity and maintainability.
2025-04-12 08:16:47 +08:00
javayhu
b951f92ff1 chore: optimize some component layouts 2025-04-12 01:01:46 +08:00
javayhu
e5840fe0f4 refactor: remove icons.tsx & update loading icons 2025-04-12 00:31:29 +08:00
javayhu
ad0eae7d62 feat: support showing limits for price plans 2025-04-12 00:16:51 +08:00
javayhu
c04499a353 feat: support analytics (google/umami/plausible/datafast/openpanel) 2025-04-11 23:54:05 +08:00
javayhu
257feba5bd fix: redirect to localized dashboard url after login
- Updated login-form.tsx, register-form.tsx, and social-login-button.tsx to utilize useLocale for dynamic callback URL generation based on the user's locale.
- Adjusted the default callback URL to include the locale, improving user experience and localization support in authentication flows.
2025-04-11 12:41:50 +08:00
javayhu
72326403a0 feat: implement middleware for route protection and localization
- Enhanced middleware functionality to manage access for protected routes based on user authentication status.
- Added logic to redirect users to the login page if they attempt to access protected routes while not logged in.
- Implemented a utility function to strip locale from the pathname for better route handling.
- Updated route definitions to categorize routes that are not accessible to logged-in users and those that require authentication.
- Improved comments and logging for better traceability and understanding of middleware operations.
2025-04-11 12:33:31 +08:00
javayhu
313625577c feat: remove planId from payment and subscription schema
- Created new SQL tables for account, payment, session, user, and verification to support user management and payment processing.
- Added foreign key constraints to link account, payment, and session tables to the user table for data integrity.
- Updated journal and snapshot metadata to reflect the new schema changes.
2025-04-11 01:23:13 +08:00
javayhu
f982e1b01a refactor: enhance logging and update comments for clarity
- Added detailed logging for active subscription retrieval in get-active-subscription.ts to improve traceability.
- Updated comments in pricing-table.tsx and billing-card.tsx to better describe the purpose of price plan retrieval.
- Modified payment types in types.ts to include 'incomplete_expired' for better status handling.
- Improved logging messages in stripe.ts for clearer debugging information during payment processing.
2025-04-11 00:39:32 +08:00
javayhu
60d68e059c refactor: update price plan functions and imports for consistency
- Replaced getPlanById with findPlanByPlanId in create-checkout-session.ts and stripe.ts for improved clarity.
- Removed unused getAllPricePlans import in pricing/layout.tsx to streamline the code.
- Updated price-plan.ts to enhance the findPlanByPlanId function and added error handling in findPriceInPlan.
- Adjusted payment-store.ts to reflect the updated price plan retrieval method.
2025-04-10 23:49:46 +08:00
javayhu
3cdb93bfc4 refactor: reorganize price plan imports and create price-plan module
- Updated import paths for price plan functions to use the new price-plan module for better modularity and maintainability.
- Removed redundant price plan functions from the payment module to streamline the codebase.
- Introduced a new price-plan.ts file to encapsulate price plan logic and improve code organization.
2025-04-10 23:37:21 +08:00
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