Commit Graph

86 Commits

Author SHA1 Message Date
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
2dc2c6461e Implement error handling and adjust import paths
This commit introduces error handling in the 'database-webhook-handler.service.ts' to log and rethrow errors when processing webhooks. It also adjusts the import paths for ContentlayerClient and WordpressClient in 'create-cms-client.ts'. Method names in 'database-webhook-router.service.ts' have been updated for clarity.
2024-04-02 16:03: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
d92d224250 Update UI of account selection component
Modified CSS styles in account-selector.tsx to enhance user experience. Added 'group' class for better hover effects and formatting for avatars. Also updated styling for account label to prevent overflow and ensure better readability.
2024-04-02 12:33:13 +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
f58aaa330c Implement Lemon Squeezy billing services
Added implementation for various billing services with Lemon Squeezy. This includes processing of webhooks for order and subscription handling, verification of webhook signatures, and validating subscription statuses and order states. Additionally, types for order and subscription webhooks have been created.
2024-04-02 09:33:26 +08:00
giancarlo
dee0814e6d Add documentation for Stripe and Lemon Squeezy billing packages
New README files have been added for the packages dealing with the Stripe and Lemon Squeezy billing systems. They explain the purpose of the packages and detail what environment variables need to be set for development and production.
2024-04-01 21:47:31 +08:00
giancarlo
8784a40a69 Add Lemon Squeezy Billing System 2024-04-01 21:43:18 +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
57214ab517 Add AuthenticityToken component in makerkit
This new component, AuthenticityToken, is added to fetch CSRF token from the 'meta' tags. This is used to prevent Cross Site Request Forgery on forms by embedding a CSRF token as a hidden input field. When the form is submitted, the server can verify whether the request was legitimate by checking the CSRF token. This enhances the security of the application.
2024-03-30 15:00:24 +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
163eff6583 Update mode-toggle and package manager version
Added a function in 'mode-toggle.tsx' to set the theme as a cookie and changed the package manager version in 'package.json'. The theme selection by the user is now stored in a cookie for persistence across sessions, and an upgrade was made to the package manager for improved dependencies management.
2024-03-29 18:42:19 +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
65e970424f Refactor schemas, enhance data validation
Implemented improvements in the data validation methods used in Stripe and Team Account features by refining the schemas. Adapted string types to UUID for accountId attributes in various services and ensured that Stripe keys follow appropriate prefixes. Autocomplete was turned off for destructive actions for enhanced security.
2024-03-29 18:21:12 +08:00
giancarlo
59c08c59d7 Update and refine schemas in Stripe and Team Accounts features
Refactored both Stripe and Team Accounts features' schemas for better data validation and added specificity to keys. Enhanced form validations with methods to ensure Stripe keys follow appropriate prefixes. Replaced generic string types with UUID for accountId attributes in different services. Also turned off autocomplete for destructive actions for improved security.
2024-03-29 18:03:41 +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
40c730141a Add information to README file
More details about the web application have been included in the README.md file, along with details about future modules to be included post-release. This document now serves as a more comprehensive guide for users.
2024-03-29 15:10:43 +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
d8ead74a1b Refine project information in README
This commit enhances project information in README, including a more detailed development status notification and a more precise roadmap. It also includes renaming a configuration filename and providing a more comprehensive instruction. This caters to clearer expectations and better comprehension for users.
2024-03-29 11:25:14 +08:00
giancarlo
54852b2332 Add project status and roadmap to README
This commit adds a development status disclaimer and roadmap to the README file. The updated README file provides a clear timeline and stages of development for the project, which helps users understand the project's progress until its stable release. It also warns users not to use the current versions of the project in production until the stable release is out.
2024-03-29 11:20:39 +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