Commit Graph

1110 Commits

Author SHA1 Message Date
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
giancarlo
7f5438ed02 Update various dependencies and refactor filename
The commit incorporates several updates to the dependencies in 'pnpm-lock.yaml', including 'autoprefixer', '@babel/types', and '@react-email/components'. Alongside these changes, the filename 'I18nProvider.tsx' in 'packages/i18n/package.json' has been refactored to 'i18n-provider.tsx' for better readability and naming convention consistency.
2024-03-28 22:47:37 +08:00
giancarlo
c92e65b1ec Update next-themes version and refactored filename
The commit includes updating the version of 'next-themes' from 0.2.1 to 0.3.0. Also, it refactors the filename in 'packages/i18n/package.json' from 'I18nProvider.tsx' to 'i18n-provider.tsx' following better naming convention and readability. It consolidates a few other version changes in 'pnpm-lock.yaml' to maintain the package dependencies updated and correct.
2024-03-28 22:28:09 +08:00
giancarlo
d46cf60556 Update CSS classes in settings UI components
This commit updates the CSS classes for the team account settings container and the settings page to increase their width. By replacing the existing classes with "w-full", both components will now take up the full width of their parent element, improving the layout responsiveness.
2024-03-28 22:20:13 +08:00
giancarlo
260f7b3295 Refactor authentication and internationalize metadata
This commit simplifies the authentication mechanism by directly comparing user ID and primary owner ID while refactoring the Team Account container. Simultaneously, it internationalizes the metadata of several pages by creating server I18n instances for title translations, ensuring better support for varied languages.
2024-03-28 22:14:54 +08:00
giancarlo
efd2a757ff Update user authentication and sidebar config
This commit involves improving the user authentication process in the billing and accounts pages for better reliability. It also changes the name of 'organization-account-sidebar.config' to 'team-account-sidebar.config' for improved clarity and consistency.
2024-03-28 21:30:12 +08:00
giancarlo
348eec8495 Replace session with user in various files
This change mainly involves replacing 'session' with 'user' in various files in several applications. The function calls related to 'session' have been refactored to reflect 'user'. The '@supabase/supabase-js' package dependency has
2024-03-28 21:14:12 +08:00
giancarlo
15d4533949 Update package dependencies and formatting in database.types.ts
Updated the versions of '@supabase/supabase-js' dependency in 'supabase' and 'billing-gateway' packages. In 'billing-gateway' package, switched several dependencies to reference local workspace versions. Also, formatted 'database.types.ts' file to use semicolons consistently improving code readability.
2024-03-28 21:00:56 +08:00
giancarlo
b4ecd1d231 Refactor invitation system and update UI layout
Updated invitation link generation logic to use 'invitePath' instead of 'siteURL' improving the overall invitation system. The changes also entailed multiple updates to the UI ranging from layout modifications to enhanced alerts and descriptions. Additionally, the text and styling of several components, such as the team account settings container and the layout of personal account settings page, were significantly adjusted.
2024-03-28 20:48:41 +08:00
giancarlo
f6d1b500da Update theme toggle functionality and UI components
Implemented a new ModeToggle feature for theme switching in personal account dropdown. The changes also made adjustments to several UI components, such as transforming Dialog to AlertDialog in transfer-ownership-dialog, and introducing invitation-submit-button in team-accounts. Some minor amendments include text changes and styling modifications.
2024-03-28 20:29:54 +08:00
giancarlo
caca7c12f6 Optimize team account settings for localization
Applied i18n translation to team account settings for improved multi-language support. The changes include replacing static text with translated keys in team account settings container, and adding new translation keys in language files. Minor changes include modification in package scripts and styling fixes.
2024-03-28 16:48:50 +08:00
giancarlo
2afa7f5be1 Implement i18n translation formatting for team accounts
Integrated i18n translations in team account components, enhancing the application's multi-language support. This includes updating dialog container text, button labels, and placeholders for improved localization. Also added translations for table headers, button labels, and form fields across various components.
2024-03-28 16:41:37 +08:00
giancarlo
9796f109ba Rename "Organization" to "Team" across web app and update related services
Renamed all instances of "Organization" with "Team" across the entire web application to reflect the latest change in terminology. This further extends to renaming related services, components, and their respective invocation instances. Separate billing permissions have been defined for Team accounts, and security actions have been updated in SQL schema along with some layout adjustments.
2024-03-28 16:05:18 +08:00
giancarlo
041efb89fb Remove team account related services and actions
Removed services and actions related to team account deletion as well as updated paths within other dependent files, better reflecting their new locations. Also, added a new service titled 'AccountBillingService' for handling billing-related operations and restructured the form layout and handled translation in 'team-account-danger-zone' component.
2024-03-28 15:27:56 +08:00
giancarlo
3ac4d3b00d Updated account deletion process and refactor packages
The primary update was on the process of account deletion where email notifications are now sent to users. The @kit/emails was also renamed to @kit/email-templates and adjustments were accordingly made on the relevant code and configuration files. In addition, package interaction was refactored to enhance readability and ease of maintenance. Some minor alterations were made on the User Interface, and code comments were updated.
2024-03-28 11:20:12 +08:00
giancarlo
6048cc4759 Remove multiple components related to multi-factor authentication setup
Removed personal account related multi-factor authentication setup modal and otp-input. Adjusted dependencies, exports, and imports to reflect the deletion. Various adjustments in other areas of the codebase were made to account for these deletions, including moving necessary components and adding the 'input-otp' library in the package.json under 'ui' directory.
2024-03-28 01:30:43 +08:00
giancarlo
500fea4bf8 Refactor billing schema creation logic
Updated logic in createBillingSchema function in the create-billing-schema.ts file for clarity and efficiency. Adjusted line item schema refinement rules and implemented changes in plan types parsing. Removed unnecessary console logs and added a console log to output the parsed config.
2024-03-27 21:22:49 +08:00
giancarlo
c3a4a05b22 Refactor and improve billing module
The billing module has been refined and enhanced to include deeper validation and detailing of billing plans and products. The checkout session creation process was revised to handle more complex scenarios, incorporating better parsing and validation. Additional validations were added for the plan and product schemas, improving product details extraction, and rearranging of module exports was made for better organization. The code refactor allows easier future modifications and upgrades for recurring and one-time payments with nuanced product configurations.
2024-03-27 21:06:34 +08:00
giancarlo
7579ee9a2c Refactor authentication flow and improve code organization
The update implemented a redirect functionality in the multi-factor authentication flow for a better user experience. It also involved a refactoring of some parts of the code, substituting direct routing paths with path configs for easier future modifications. Import statements were adjusted for better code organization and readability.
2024-03-27 15:07:15 +08:00
giancarlo
f0883c19ef Implement redirect control in multi-factor auth container
The update adds a rerouting functionality upon successful multi-factor authentication, replacing a console log action previously triggered upon success. The change enhances the authentication flow by redirecting users to a specified path upon validation. Additionally, minor refactorings are done such as replacing direct routing paths with path configs and adjusting import statements.
2024-03-27 14:30:23 +08:00
giancarlo
2acd9c7d10 Refactor mailer setup and validate web configuration in app
This commit refactors how SMTP configuration for mailers is set up and introduces schema validation for incoming configurations. The mailer modules have been restructured, with schema definition files added, and redundant codes removed. Moreover, web application configuration now has minimum validation on name and title, and URL validation has been added.
2024-03-27 14:10:53 +08:00
giancarlo
ff19e0c204 Update authentication methods and UI components, remove redundant file
This commit accomplishes a few modifications including the elimination of `use-toast.tsx` due to redundancy. The authentication methods in `personal-accounts-server-actions.ts` were refactored to improve service integration and data handling. Additionally, UI components were updated for better readability and clarity. Cascading deletion was enabled in the `schema.sql` file for 'invited_by' reference.
2024-03-27 13:52:46 +08:00
giancarlo
6699399864 Remove use-toast.tsx, refactor auth methods, and update UI components
This commit removes the redundant `use-toast.tsx` file and refactors the authentication methods in `personal-accounts-server-actions.ts` to enhance service integration and data handling. UI components like `LanguageDropdownSwitcher` and `site-header-account-section.tsx` have been refined for better readability. Changes in the `config.tsx` file aim to improve the overall code cleanliness. The `schema.sql` file under migrations was updated to cascade delete for 'invited_by' reference.
2024-03-27 01:37:34 +08:00
giancarlo
8a614bd6fc Refactor auth methods, remove i18n, and update UI
This commit covers a variety of actions that includes the refactoring of the authentication components to accept paths and invite tokens as props instead of a singular callback prop, thereby improving the component's flexibility. This refactor process removes 'withI18n' calls as i18n functionalities are no longer used. The commit also contains several adjustments to the UI components, including the authorization layout, pricing table, and sign-up page. It also includes minor changes to error messages, specifically those related to password resetting. Lastly, several peer dependencies are removed in the 'package.json' files and changes made to the 'browser.client.ts' file providing a significant code cleanup.
2024-03-27 01:19:20 +08:00
giancarlo
cabdd832df Add billing-related content to English locale file
This commit adds billing and subscription related text content to the 'billing.json' within the English locale directory. The text content covers a range of subscription statuses like 'free', 'active', 'trialing', and more. This will be used to provide localized content for the billing module in English language regions.
2024-03-26 23:32:49 +08:00
giancarlo
e402caff30 Update labels and refine hooks for teams and billing modules
This commit modifies several language labels and refines hooks related to 'teams' and 'billing' modules for better clarity and consistency. It also includes the deletion of unused locale files and package dependencies transfered to 'peerDependencies'. Lastly, it introduces minor enhancements in server command, error logging functionality, and scripts to interact with Stripe.
2024-03-26 23:32:28 +08:00
giancarlo
4032aed827 Perf improvements and billing updates 2024-03-26 16:49:11 +08:00