Commit Graph

83 Commits

Author SHA1 Message Date
giancarlo
368bcf4dff Implement text color changes across components
The commit involves modifications in various components to change 'text-gray-500' to 'text-muted-foreground'. The purpose of this change is to create uniformity in text colors across the application, enhancing the user interface's overall look and making color scheme tweaks easier in the future.
2024-04-05 12:13:58 +08:00
giancarlo
220a23e185 Implement updateSubscription feature and refactor billing services
This commit introduces the updateSubscription method to the BillingStrategyProviderService, ensuring that subscriptions can be updated within the billing core. Additionally, a refactor has been applied to the BillingGatewayFactoryService and stripe-billing-strategy.service to improve error handling and the robustness of subscription updates. Logging in the webhook route has been adjusted for clarity and the data model has been enhanced.
2024-04-04 20:15:12 +08:00
giancarlo
4a122ee5df Refactor usage reporting for metered subscriptions 2024-04-04 16:42:10 +08:00
giancarlo
83cd86e3ee Update dependencies by adding 'lucide-react'
This update includes adding 'lucide-react' to the list of dependencies in the package.json file for the web app. The corresponding changes have also been made in the 'pnpm-lock.yaml' file to reflect the specifics of the newly added package.
2024-04-04 11:09:58 +08:00
giancarlo
64fca41f8d Refactor code and update dependencies configuration
This commit includes reorganizing dependencies in 'package.json' for better readability. It also refactors code associated with user and personal account data along with animations for AvatarFallback and profile name display. Additionally, the 'next' package version has been updated to '14.2.0-canary.56'. Some changes have been made for minor corrections and enhancements in the scripts.
2024-04-04 11:02:27 +08:00
giancarlo
5c5532dc22 Reorganize monitoring package dependencies
The changes include some reorganization of the dependencies in the 'package.json' of the monitoring package and the web app, aimed to enhance readability. Also, a minor correction in the whitespace around "@sentry/nextjs" dependency version was made. Furthermore, code related to the monitoring instrumentation provider has been refactored for more readable error handling.
2024-04-04 10:31:41 +08:00
giancarlo
0b374c558a Create legal pages and refactor navigation
New pages for Cookie Policy, Terms of Service, and Privacy Policy were added. The navigation system was restructured using a mapped array of links instead of hard coded components. The 'Not Found' page's metadata handling was improved and its translation was updated. Certain components that aid this refactoring were created and some pre-existing components or functions were moved to more appropriate locations or renamed for clarity. The Site Navigation, Footer, and Page header components were updated in layout and content. Various pages including Blog and Documentation were updated or removed.
2024-04-04 10:04:07 +08:00
giancarlo
2782b26dc2 Refactor i18n handling for language cookie and headers
The commit encompasses the aspect of refactoring the i18n handling for language cookies and headers. It also includes the deletion of get-language-cookie file and its transformation into a function inside i18n.server file. Extra functionalities were added to the i18n.server like enhancing the i18n server instance creation to consider the 'accept-language' header and default to environment provided values when necessary. The changes were also adjusted accordingly on the packages/i18n/package.json where deletion of "./cookie" was realized.
2024-04-04 09:22:43 +08:00
giancarlo
24a68b2b1f Add Sentry and Baselime packages in the monitoring section
This commit introduces Sentry and Baselime packages into the monitoring section, complete with associated dependencies and scripts. These changes also reflect necessary updates to the 'pnpm-lock.yaml' file to account for these new dependencies.
2024-04-04 01:09:19 +08:00
giancarlo
67763d3e1f Remove unnecessary logging in middleware
Removed an extraneous logging command from the middleware function in the web application. This was redundant and did not contribute to error tracking or debugging, enhancing readability and maintenance of the code.
2024-04-04 00:07:38 +08:00
giancarlo
35ef90b4f8 Update Supabase dependency, delete cookie handling, create logger
Updated Supabase dependency across multiple packages from "^2.41.1" to "^2.42.0". Removed files handling sidebar state and theme cookies. Created a new Logger interface for managing log messages in the shared package. Enhanced the middleware to track accounts membership webhook payload. Minor adjustments were also made in multiple package.json files.
2024-04-03 23:59:41 +08:00
giancarlo
406739d96d Refactor Supabase server client and improve team management features
Refactored Supabase server component client to improve type safety. Improved team account management by adjusting role data providers to consider account IDs, and adjusted invite member functionality to use account IDs and slugs. Enhanced invitation update dialog by adding account parameter. Fixed database webhook URLs in seed.sql. Overall, these changes enhance the robustness and usability of the team management functionalities.
2024-04-03 22:34:12 +08:00
giancarlo
53afd10f32 Update content categorization and handle hierarchical documentation
Enhancements were implemented to support hierarchical documentation. Local CMS now respects parent ID and order attributes of content items, and content can be categories as 'blog' or 'documentation'. Changes were also made to the wordpress integration supporting these new categorizations. Introduced working with nested documentation pages.
2024-04-03 21:06:54 +08:00
giancarlo
3fd216ba6e Update npm run commands and various dependencies
Npm run commands for 'dev' have been updated to 'start' in the Wordpress package. Also, removing peer dependencies for the CMS core and updating versions for various dependencies in pnpm-lock.yaml file. Furthermore, a modification to the SiteHeaderAccountSection function in the site-header-account-section.tsx file was made.
2024-04-03 16:29:05 +08:00
giancarlo
352ec874c1 Refactor getUser function in marketing layout
The code refactors the getUser function in the marketing layout file within the web app. It simplifies code by directly retrieving user information within the function and eliminates unnecessary use of Supabase server component client. This change improves efficiency and readability, and reduces potential errors by restricting server pings to necessary operations only.
2024-04-03 16:13:06 +08:00
giancarlo
de5fc48c89 Update "next" version and "turbo" packages
The commit updates the "next" package version to 14.2.0-canary.54 and updates the "turbo" package version to 1.13.2, both in `apps/web/package.json` and `pnpm-lock.yaml` files. The modifications to these packages are necessary for certain features to work properly and for overall project stability and performance improvements.
2024-04-03 16:09:26 +08:00
giancarlo
048d58dcdf Implement internationalization in pages and update CMS clients
The commit mainly revamps the code to support internationalization in various pages like pricing, docs, blog, etc. It modifies the code to generate metadata asynchronously, accommodating internationalized page titles and subtitles. Also, the commit restructures CMS Client scripts, particularly for ContentLayer and Wordpress. For Wordpress, it updates API fetch routes and handles embedded children data. Furthermore, unnecessary logging statements are cleaned up, and minor updates are done for better UI and code efficiency.
2024-04-03 16:05:34 +08:00
giancarlo
12058274f5 Fixed WP Client 2024-04-02 16:29:11 +08:00
giancarlo
eb43059fda Update billing provider and related adjustments
This commit switches the billing provider from Stripe to Lemon Squeezy. It also includes necessary modifications in the web app, billing gateway, and database to accommodate this change. Additionally, updates have been made to the checkout process, billing strategy, and relevant services and components.
2024-04-02 14:31:53 +08:00
giancarlo
4576c8c14a Switch billing provider from Stripe to Lemon Squeezy
Changed the billing provider in the `.env.development` file from Stripe to Lemon Squeezy. This requires adaptations at many levels: at the web app to load Lemon Squeezy's script in the checkout process, at the billing gateway to handle Lemon Squeezy calls, and in the database to reflect the current billing provider. The checkout process is now done using Lemon Squeezy Sessions and its billing strategy was adjusted accordingly. Billing-related components and services were also updated.
2024-04-02 14:09:25 +08:00
giancarlo
d24cf8427f Refactor billing system and enhance logging
Updated the billing system's schema to change 'storeId' to a string type, and improved the cleanliness and readability of the code. Enhanced the logging system within the billing service for better tracking and debugging. In line with these changes, added corresponding error pages in the client side to handle any errors.
2024-04-02 12:19:09 +08:00
giancarlo
6149f6a313 Update package dependencies and refactor peer dependencies
Updated various package dependencies including "next", "turbo" and "@kit" packages. Moved some dependencies to devDependencies for better project structure. This aims to optimize the dependency graph, reduce unnecessary installation of packages, and enhance the overall development environment.
2024-04-02 11:13:57 +08:00
giancarlo
28396d1273 Refactor database schema and improve code readability
Significantly simplified the syntax of SQL scripts for managing privileges to improve readability. Improved the structure and format of the code by making spacing and indentation consistent. Also made minor changes to the creation and configuration of enums and table schemas.
2024-04-02 11:11:36 +08:00
giancarlo
84a4b45bcd Update billing system to support single and recurring payments
This update modifies the billing system to properly handle both single and recurring payment plans. Logic is introduced to determine whether the selected plan is recurring or a one-time payment and adjust the interface accordingly. The naming of some components and variables has been changed to more accurately reflect their purpose. Additionally, a
2024-04-01 20:58:26 +08:00
giancarlo
6b72206b00 Refactor CMS to handle ContentLayer and WordPress platforms
This commit refactors the CMS to handle two platforms: ContentLayer and WordPress. The CMS layer is abstracted into a core package, and separate implementations for each platform are created. This change allows the app to switch the CMS type based on environment variable, which can improve the flexibility of content management. It also updates several functions in the `server-sitemap.xml` route to accommodate these changes and generate sitemaps based on the CMS client. Further, documentation content and posts have been relocated to align with the new structure. Notably, this refactor is a comprehensive update to the way the CMS is structured and managed.
2024-04-01 19:47:51 +08:00
giancarlo
d6004f2f7e Refactor billing gateway and enhance localization
Refactored the 'plan-picker' component in the billing gateway to remove unwanted line items and improve checkout session and subscription handling. Enhanced the localization support by adding translations in the plan picker and introduced a new function to check trial eligibility so that existing customers can't start a new trial period. These changes enhance the usability of the application across different regions and provide accurate trial period conditions.
2024-04-01 11:52:35 +08:00
giancarlo
248ab7ef72 Update translations and add trial eligibility in plan picker
Added translations in "plan-picker" for better localization support. Introduced a new functionality to check trial eligibility where existing customers can't start a trial. Removed unnecessary billing line items like 'per-seat' and 'metered'. Also, made significant changes in multiple files to align with the updated internationalization best practices. The changes aim to make application more user-friendly across different locales and provide accurate trial period conditions.
2024-03-31 17:46:39 +08:00
giancarlo
ba92e14363 Add detailed plan info and additional subscription types
Implemented detailed pricing information for various subscription types in the plan-picker component. Two additional subscription types, 'per-seat' and 'metered', have been added to the billing configuration, providing more flexibility for customers to choose different billing methods that suit their needs. The billing schema has also been refined to allow plans without a 'base' line item.
2024-03-31 15:47:20 +08:00
giancarlo
57c8f89804 Modify layout and improve subscription fetching
The layout for responsive designs has been updated in plan-picker component. Subscription type has been removed from billing/page.tsx and subscription fetching has been improved with additional query parameters in both billing/page.tsx and current-plan-card.tsx. Errors were also corrected in i18n translation keys in team-account-checkout-form.tsx. CurrentPlanCard's component props now includes line items in the subscription object. Changes in billing/page.tsx include adaptation of container width to be fully responsive.
2024-03-31 15:24:31 +08:00
giancarlo
aa12ecd5a2 Refactor API code and simplify billing display
The code in the webhook API has been refactored to move the DatabaseWebhookHandlerService instance out of the POST function scope. Furthermore, the display of renewal plan details on the billing page has been simplified and certain parts deemed superfluous have been removed. Numerous types and interfaces in the database.types.ts file have also been corrected and formatted for consistency and improved readability.
2024-03-31 15:13:44 +08:00
giancarlo
2c0c616a2d Rename component files and update code dependencies
Numerous component files have been renamed for better organization and readability. This includes changing 'app' to 'account-layout' in various instances and 'organization' to 'team' to ensure consistency across code. Additionally, dependencies within codes have been updated in line with the renaming. The pull request also includes a minor update to the pnpm-lock file, reflecting the latest version of Next.js.
2024-03-31 01:05:32 +08:00
giancarlo
a02f597f57 Update billing card display and server actions
The code changes update the way the billing details are fetched and displayed in the system. In the billing card component, the baseLineItem price is replaced with the cost. For the server actions, getLineItemsFromPlanId is replaced with getProductPlanPair to fetch the product plan more efficiently. The change reduces unnecessary details, simplifying the code and possibly speeding up the operation.
2024-03-30 15:02:30 +08:00
giancarlo
e158ff28d8 Improve and update billing flow
This commit updates various components in the billing flow due to a new schema that supports multiple line items per plan. The added flexibility rendered 'line-items-mapper.ts' redundant, which has been removed. Additionally, webhooks have been created for handling account membership insertions and deletions, as well as handling subscription deletions when an account is deleted. This message also introduces a new service to handle sending out invitation emails. Lastly, the validation of the billing provider has been improved for increased security and stability.
2024-03-30 14:51:16 +08:00
giancarlo
f93af31009 Refactor billing schema for increased flexibility
The billing schema has been revamped to allow more flexible billing setups, supporting multiple line items per plan. Changes extend to related app and UI components for a seamless experience. As a result, the previously used 'line-items-mapper.ts' is no longer needed and has been removed.
2024-03-30 00:59:06 +08:00
giancarlo
e9c7a93290 Add loading component using GlobalLoader
Implemented a new loading component in the 'join' directory. The new file, loading.tsx, exports the GlobalLoader from '@kit/ui/global-loader'. This should help improve the user experience during loading times across the web app.
2024-03-29 18:22:01 +08:00
giancarlo
af908ae685 Refactor team accounts feature and improve form validation
Updated several components within the team accounts feature to use more specific schema definitions and provide clearer form validation. Several schema files were renamed to better reflect their usage and additional properties were included. The commit also introduces handling for a new accountId property, which provides more accurate user account tracking. Autocomplete was turned off on deletion actions for better security. Changes related to account ownership transfer were also made, including transaction logging and error handling improvements.
2024-03-29 17:39:35 +08:00
giancarlo
9e06d420bd Improve 'Leave Team' process with logging and confirmation step
Added logging to the 'Leave Team' functionality to track user actions, and implemented a confirmation input to further validate a user's intent to leave a team. Also revised the user-facing prompt for more clarity on the team leaving process. Corresponding changes were applied to the relevant services and front-end components.
2024-03-29 16:40:44 +08:00
giancarlo
2b0fbc445b Refactor authentication method to requireUser
Replaced the requireAuth method with requireUser to improve clarity and modified all instances where it was used. Renamed the import throughout multiple files and services and made changes accordingly, thus making it more specific and understandable that a logged-in user is needed. The return type of the method was also updated from Session to User to more accurately reflect the information it provides.
2024-03-29 15:52:32 +08:00
giancarlo
3be39e810b Update README with instructions for local setup and Stripe integration
Added an extensive guide to the README outlining the process for setting up a local environment including a `.env.local` file for storing sensitive information safely. Also included are steps on how to integrate with Stripe and set up the related environment variables.
2024-03-29 15:06:14 +08:00
giancarlo
b2cb8dd130 Remove sensitive data from production environment file
This commit removes sensitive data including keys, URLs, email, and other configurations from the .env.production file in the web app. Moving forward, the file will only contain public variables, enhancing the overall application's security.
2024-03-29 15:03:13 +08:00
giancarlo
a3a2f3f6a7 Update UI element size and change directory exclusion rule
This commit modifies the size of sun and moon icons in the mode-toggle UI and simplifies the space usage of a flex container in the site header. Furthermore, it updates the path pattern for the directory exclusion rule in tailwind configuration to exclude node_module from all directories.
2024-03-29 14:53:30 +08:00
giancarlo
99db8f4ca4 Implement custom roles and improve permissions logic
The commit refactors the handling of account roles and enhances permissions checks. The account role has been shifted to use a string type, providing the ability to define custom roles. It also introduces the RolesDataProvider component, which stipulates role-related data for different forms and tables. The modification goes further to consider user role hierarchy in permissions checks, offering a more granular access control.
2024-03-29 14:48:45 +08:00
giancarlo
f1967a686c Update Next.js version and fix invite expiration check
This commit increments the Next.js version to 14.2.0-canary.48 and updates the related dependencies' versions in the lock file as well. Additionally, it corrects the invitation expiration check on the join page. Previously, it was checking for a date less than the current time which caused it to invalidate valid tokens; now, it correctly checks for dates greater than or equal to the current time.
2024-03-29 12:26:37 +08:00
giancarlo
778cfde625 Implement invitation renewal and optimize revalidation function
This commit adds a new function to renew team invitations and a central function for revalidating member page. It also removes redundant revalidations across different actions. The renew invitation function and UI elements are introduced including a new dialog for confirming the renewal action. Furthermore, function revalidateMemberPage() is added to abstract the revalidation path used multiple times in different functions. The code readability and maintainability have thus been improved.
2024-03-29 11:14:55 +08:00
giancarlo
7495dae062 Update UI elements and import paths in multiple files
This commit includes a series of UI improvements and import path adjustments across several files. Changes include using a different icon and adjusting the styling in mode-toggle.tsx, modifying class names in personal-account-dropdown.tsx, and updating the import paths in multiple files following the renaming of the 'personal-account-dropdown' to 'personal-account-dropdown-container'.
2024-03-29 01:11:03 +08:00
giancarlo
1d977fdde3 Adjust interface styling and headings in auth package
In this commit, the styling configuration within the auth layout file is updated to improve user interface appearance and functionality. Also, the heading level has been adjusted in the SignIn, SignUp, and PasswordReset pages for better hierarchy and readability.
2024-03-29 00:51:50 +08:00
giancarlo
b4e714e580 Update tailwind config and implement personal account avatar
In this commit, we have made several updates to tailwind configuration files to ensure better scalability and include exceptions for node modules. Moreover, the account selector component now uses a personalized avatar for each account. This was achieved by accessing personal account data through a hook and introducing a new UserAvatar function to display the avatar. Check component was also migrated to CheckCircle and minor layout and styling adjustments were done for better UI experience.
2024-03-29 00:38:59 +08:00
giancarlo
643e6cab57 Update UI styling and upgrade dependencies
Redesigned heading component styling and adjusted the layout in the marketing page for better readability and aesthetic appeal. Also updated 'next' and several other dependencies in the "pnpm-lock.yaml" to their latest versions, ensuring up-to-date functionalities and security.
2024-03-29 00:20:05 +08:00
giancarlo
8a080eaf78 Update development script and add error handling in authentication middleware
The "dev" script in the package.json for apps/web updated to include a "--turbo" flag. Moreover, enhanced error handling logic is added to the authentication
2024-03-28 23:39:36 +08:00
giancarlo
9011abfca7 Remove unused database import from billing page
The database import from '@kit/supabase/database' was removed because it was not used within the billing page. Therefore, it is unnecessary to include it in the page.tsx. This makes the code cleaner and slightly more efficient.
2024-03-28 23:12:57 +08:00