Commit Graph

330 Commits

Author SHA1 Message Date
giancarlo
a074e1ec3b Implement Baselime monitoring and update error handling
This commit introduces the integration of Baselime for monitoring, accounting for various error scenarios and improved console error logging. Request handling has been updated to assign unique IDs for each request, aiding in tracing/logs. The environment variable key was updated, and the `MonitoringProvider` was nested in the root providers. In the base monitoring service, a function to format errors for logging was added. The provider logic was updated to create a new instance of service for each request, improving memory efficiency.
2024-04-22 18:41:38 +08:00
giancarlo
7e1be64707 Add merging conflicts section to README
A new section has been added to the README on how to handle merge conflicts, specifically for `pnpm-lock.yaml` and `database.types.ts`. Detailed instructions are provided on how to regenerate these files and resolve the conflicts.
2024-04-22 15:28:12 +08:00
giancarlo
5fd3d49780 Remove test error from Home function
The test error that was thrown in the Home function was removed. This error was previously used for testing purposes and is no longer needed in the live code.
2024-04-22 15:24:56 +08:00
giancarlo
b6d303f90e Refactor monitoring package and improve error handling
The monitoring package has been significantly refactored to improve the granularity of error capture. Code from the 'capture-exception.ts' files in different locations have been deleted and replaced by a more unified approach in the 'use-baselime.ts' and 'use-sentry.ts' hooks. The README documentation has also been updated to reflect these changes and provide additional information about error monitoring setup and usage.
2024-04-22 15:24:01 +08:00
giancarlo
3ce6c62425 Update Zod and Lucide-react version in all packages
The Zod and Lucide-react libraries have been updated to version ^3.23.0 and ^0.372.0, respectively, in all packages. This change ensures that all packages are using the latest stable versions of these libraries, keeping the codebase up-to-date and minimizing potential compatibility issues.
2024-04-22 14:03:03 +08:00
giancarlo
0796aaeb81 Update UI and translations in billing component
The pricing-table.tsx and plan-picker.tsx components under billing have been updated to improve UI spacing, layout, and text translations. The revisions allow for better localization through the use of the useTranslation hook from react-i18next. Layout changes include adjustment in spacing and removal of Sparkles icon. Certain product details are refactored to use translation keys for easier language support.
2024-04-22 13:52:40 +08:00
giancarlo
7020e21193 Refactor join service and fix imports
Join service was deleted and its functionality was integrated into the team-accounts API. General rearrangement and renaming of server-related files were made, particularly for billing-related services to ensure consistency. This made it necessary to fix import paths across multiple files.
2024-04-22 12:52:09 +08:00
giancarlo
56d532ab61 Update dependency from edge-csrf to @edge-csrf/nextjs
The previous edge-csrf library has been replaced by the newer @edge-csrf/nextjs with updated configurations in `pnpm-lock.yaml`. Also, removed some unnecessary dependencies for cleaner and more efficient code deployment.
2024-04-22 12:17:08 +08:00
giancarlo
b42d8a51a9 Refactor API fetch using React Query
The code has been updated to use the React Query library for API fetch operations in README.md. The mutation function has been abstracted using 'useMutation' from '@tanstack/react-query', replacing the traditional fetch operation. This leads to cleaner and more reusable code.
2024-04-22 12:04:12 +08:00
giancarlo
d4cf3fadcf Update README with server action and API route handler guidelines
Expanded the instructions on how to write server actions in React and API route handlers. Incorporated comprehensive code examples to guide developers better. Also clarified the use of `enhanceRouteHandler` and `enhanceAction` utilities.
2024-04-22 12:00:35 +08:00
giancarlo
61b1edcdd9 Add useCsrfToken hook and update README
A new `useCsrfToken` hook has been added for fetching CSRF token from the meta tag. The shared package's exports have been updated to include this new hook. Additionally, extensive documentation on writing server actions and API route handlers, as well as the usage of Captcha token protection and CSRF token, has been added to the README file.
2024-04-22 11:56:42 +08:00
giancarlo
e2503333e2 Update CSRF protection and modify database types
The CSRF protection in middleware has been re-implemented with `@edge-csrf/nextjs`, to catch and handle CSRF errors more effectively. Additionally, some parameters are renamed and functions are added in `database.types.ts` for better role management. The dependency in `package.json` has also been updated to reflect the changes.
2024-04-22 11:27:54 +08:00
giancarlo
acd5ad08f9 Update several package versions in pnpm-lock.yaml file
This commit updates various package versions in the pnpm-lock.yaml file. The updated packages include tailwind-merge, zod, recharts, and '@sentry/nextjs' among others. This is a part of regular maintenance and ensuring that the project dependencies are up-to-date.
2024-04-22 01:52:02 +08:00
giancarlo
99fe547f5b Update README and refactor import path
Enhanced the README file with additional sections explaining import paths, non-route folders, server-side code, and updating packages. Additionally, the import path for 'UserAccountHeader' in the billing page file was refactored to a relative import for better readability and maintenance.
2024-04-22 01:48:55 +08:00
giancarlo
866b9888f7 Refactor billing services with new AccountsApi
The billing services have been refactored to use the new AccountsApi and TeamAccountsApi. All methods that were previously defined in each billing service, including getting customer ID, getting permissions, etc., have been transferred to these APIs. This change improves the modularity and organization of the code.
2024-04-22 01:35:15 +08:00
giancarlo
75c438a5f2 Update file inclusion in tsconfig.json
This update modifies the tsconfig.json in the web app. It changes the file inclusion from specific '.tsx' and '.ts' files in 'components' to all files within the 'components' directory. This change will enhance the efficiency of TypeScript configuration.
2024-04-22 00:56:05 +08:00
giancarlo
0a28e22eb1 Add support for viewing lifetime orders
The commit introduces the ability to view lifetime orders on the billing page. It has updated the logic in both account and user billing pages to accommodate this change. Now, instead of only dealing with subscriptions, the pages can also cater to lifetime orders.
2024-04-22 00:50:08 +08:00
giancarlo
ecb20b8917 Refactor billing data loading and schema configuration
This update enhances the capability of the billing system to handle different types of billing modes (subscription-based or one-time payments) and introduces an environment variable for configuring the preferred billing mode. It also refactors the data fetching process in the `loadPersonalAccountBillingPageData` and `loadTeamAccountBillingPageData` to retrieve the proper data depending on the chosen billing mode. Detailed documentation was added in README.md to guide the configuration of the billing schema.
2024-04-22 00:35:03 +08:00
giancarlo
b393d94fb2 Fix URL 2024-04-21 20:07:59 +08:00
giancarlo
ff47b082dd Add Demo version and Conventions sections to README
A demo version of the project and additional documentation about project conventions have been added to the README file. The conventions cover package vs app distinctions, environment variable usage, handling of secret keys, and application layout details. The Readme now also includes a link to a moderated demo project equipped with expanded functionalities.
2024-04-21 20:07:26 +08:00
giancarlo
7cbbae9fef Remove Suspense from root-providers and refine route checks
The Suspense wrapper was removed from root-providers.tsx to simplify code. For the Privacy Path Checking, a property was added to 'AuthRedirectListener' to allow customization of 'privatePathPrefixes', and the prefixes list was moved to the top. Also, explicit constant assertions were added in 'create-i18n-settings.ts' to ensure the types correctness.
2024-04-21 19:53:16 +08:00
giancarlo
ae10f7b142 Refactor i18n settings and improve language load handling
This update separates the creation of i18n settings into its own function (@kit/i18n) and enhances the handling of language and namespace loading in i18n.client. It tracks loaded languages and namespaces, and prevents rendering if none are loaded or after a maximum number of iterations. The usage of Suspense has also been modified in root-providers to employ a null fallback.
2024-04-21 18:40:12 +08:00
giancarlo
b1f2e435aa Add ArrowRight icon to signUp and signIn buttons
A new `ArrowRight` icon from `lucide-react` library is introduced to the signUp and signIn buttons on the auth source code. CSS animation properties are applied to the icon for better interactiveness and user experience.
2024-04-21 13:03:01 +08:00
giancarlo
c5b70d7b62 Refactor i18n client and server initialization
The refactor includes the removal of clientInstance checks as they are unnecessary. Also, i18n-provider.tsx has been updated to use react-query instead of local state for client initialization. Lastly, error handling has been added to the server initialization process and the @tanstack/react-query package has been added to the project dependencies.
2024-04-21 12:48:18 +08:00
giancarlo
562db0058e Refactor UI components and replace PageHeader with AccountLayoutHeader
This commit includes a major refactor of UI components to enhance the overall look and feel of the platform. The PageHeader component has been replaced by AccountLayoutHeader across multiple pages including settings, members, and billing. The new AccountLayoutHeader also includes an additional `account` prop, enhancing the component's functionality. Furthermore, this commit includes modifications to the marketing page styling, ensuring better spacing and alignment of features.
2024-04-21 00:20:46 +08:00
giancarlo
ce38bdd36a Update tests for order and subscription updates
Added comprehensive tests for the functionality of creating, updating, and verifying billing orders and subscriptions in the Supabase database. Tests now ensure appropriate behavior of upsert operations, validation of inserted or updated data, and proper calculation of derived fields. This contributes to better coverage and confidence in the production-ready status of these features.
2024-04-20 23:58:51 +08:00
giancarlo
c6bb9f0758 Update tests for order and subscription updates
Added comprehensive tests for the functionality of creating, updating, and verifying billing orders and subscriptions in the Supabase database. Tests now ensure appropriate behavior of upsert operations, validation of inserted or updated data, and proper calculation of derived fields. This contributes to better coverage and confidence in the production-ready status of these features.
2024-04-20 23:48:03 +08:00
giancarlo
97ea6e87fb Update translation keys and clean scripts
This commit updates translation keys across multiple components, changing the connector from dot to colon. Additionally, the clean scripts in the README.md have been corrected to `pnpm run clean:workspaces` and `pnpm run clean` from their previous erroneous state.
2024-04-20 23:24:01 +08:00
giancarlo
f7fe67f7f7 Update test cases and improve account actioning
This commit refactors Supabase test cases to reflect the updated account actioning mechanism. The "makerkit.get_user_id" function calls were replaced with the new "tests.get_supabase_uid" function, aligning with the testing structure update. It also introduces new policies which further refine user role actions with more precise checks, replacing the old 'delete' policy with the more comprehensive 'can_action_account_member' function. New test cases for updating memberships and deleting memberships have also been added.
2024-04-20 23:22:18 +08:00
giancarlo
a55655a61a Improve owner transfer process and member sorting
Extended the account ownership transfer tests and implemented several updates. This includes transferring the ownership only to an existing account member, sorting team members based on role hierarchy and whether a member is the primary owner. In the permissions check, prevented non-members from creating invitations and enhanced the styling of role badges depending on if they are custom or not.
2024-04-20 20:33:19 +08:00
giancarlo
4195697b54 Add new tests and update schema.sql and account permissions
New test files for database functionalities like transfer of ownership, schema conditions, and updating roles have been added. Changes have also been made in the schema.sql file for checking the role hierarchy levels and updating rules for permissions. Modifications in account permissions test have also been performed for more accuracy.
2024-04-20 19:37:39 +08:00
giancarlo
bf0d2e1c87 Fixed bugs in memberships management 2024-04-20 18:12:04 +08:00
giancarlo
efd27aa7de Update localization texts, add permissions check, and seed data
This commit removes the membersTabDescription, updates the deleteAccountDescription text in the localization files, and adds a condition to check permissions in account invitation component. It also includes test credentials in README and provides a significant amount of seed data for testing the database.
2024-04-20 16:53:54 +08:00
giancarlo
0148265b5f Add TurboPack details to README and update Next.js config
The README.md was updated with information about TurboPack which is now used by default and still experimental. The Next.js configuration was also modified to support this. Instructions on how to switch back to the default bundler in case of any issues were added as well.
2024-04-20 15:17:34 +08:00
giancarlo
fb8e091043 Refactor UI component and improve configuration handling
Refactored the components in the site header account section and page.tsx to improve readability. Updated the WordPress client to handle date types correctly. Adjusted the keystatic storage kind to default to 'local' if not specified in the environment variables.
2024-04-20 13:31:07 +08:00
giancarlo
8281de12a0 Update i18n settings and upgrade dependencies in lockfile
This commit refactors the i18n settings in `i18n.settings.ts` to improve language handling. In addition, it updates the `pnpm-lock.yaml` file to upgrade the lockfile version and several package dependencies. Most notably, it integrates `tailwind-merge` and `@tanstack/react-table` into various packages.
2024-04-20 13:17:38 +08:00
giancarlo
6ff82ec5ef Improve site header account and navigation item styling
The styling of the site header account sign-up button and navigation items has been updated. Class names and transition durations were adjusted for better visualization and usability. The changes particularly enhance the hover effect on the sign-up button and navigation items.
2024-04-20 02:24:00 +08:00
giancarlo
ecdb9ac717 Improve i18n resource loading mechanism 2024-04-20 02:12:36 +08:00
giancarlo
c3d2e29f1b Update package manager version and role label reference
The package manager version in the package.json file has been updated to pnpm@9.0.0. Also, in membership-role-selector.tsx, the reference in i18nKey for role labels has been modified to include ".label" for better clarity and maintain the consistent schema in the translation files.
2024-04-20 01:10:12 +08:00
giancarlo
95e6c460cb Update i18nKey syntax in role-badge component 2024-04-20 00:52:54 +08:00
giancarlo
daf8c18de6 Add router refresh to language selector
Added useRouter import from 'next/navigation' and implemented a router refresh in the language change function. This update ensures that cached translations are refreshed when the language is changed.
2024-04-20 00:52:05 +08:00
giancarlo
2df48d82d8 Update i18nKey path in role-badge component
The change in path of the i18nKey in the role-badge component from `common.roles.${role}` to `common.roles.${role}.label` has been made. This ensures that the correct localization keys are being used in order to display the appropriate labels.
2024-04-20 00:48:20 +08:00
giancarlo
08fc8e6d01 Improve i18n resource loading mechanism
Updated i18n client to track not only loaded languages but also namespaces. The component will now remain suspended until all languages and namespaces are loaded. This improvement ensures that all necessary localisation resources are fully ready before rendering components.
2024-04-20 00:46:45 +08:00
giancarlo
b71b580331 Optimize content fetching and update configurations
Content fetching in the marketing section has been refactored to utilize the Next.js cache, which significantly improves performance. The date format of publishedAt has been updated to be more consistent across files. Code related to CSRF token, fonts, and metadata has been refactored into separate files for easier maintenance and readability.
2024-04-19 19:21:54 +08:00
giancarlo
c121a3bdad Update "Password Reset" to "Update Password"
The code changes correspond to the rebranding of "Password Reset" to "Update Password". The names of components, functions, and routes have been updated to reflect this change. Also, a minor code optimization has been made in the i18n.server file for the creation of i18n server instances.
2024-04-19 17:27:11 +08:00
giancarlo
cc80b26117 Update README and refine UI elements and localization
This commit introduces updates to the README file, specifically focusing on authentication emails. Minor UI adjustments have been made to various layout spacings and image attributes in some pages for better design consistency. Localization has also been improved by introducing translation keys for error and not-found pages in the common JSON file.
2024-04-19 17:14:43 +08:00
giancarlo
92f0ba4dd5 Create auth confirmation route
Added a new route for authentication confirmation that uses OTP verification. If successful, it redirects the user to the specified next path; otherwise, it navigates them to an error page. This is part of implementing more robust user authentication.
2024-04-19 16:00:40 +08:00
giancarlo
667f9cbb57 Integrate i18n into AuthCallbackErrorPage
Added i18n support to the AuthCallbackErrorPage. This ensures consistent internationalization and localization across all pages, helping deliver proper error messages in different languages.
2024-04-19 15:54:24 +08:00
giancarlo
b99295b364 Update error and not-found page styles
Removed unused import from error page and adjusted the heading styles on both the 500 error page and the 404 not-found page. By increasing the size of the text headings and updating the font to 'font-heading', the pages are now more consistent with the overall design layout.
2024-04-19 15:38:28 +08:00
giancarlo
78bb95e7db Add production setup guide to README
An extensive step-by-step guide has been added to the README file to help users set up and prepare their projects for production. This includes instructions for creating a Supabase project, managing migrations, setting OAuth and deploying a Next.js app along with other crucial steps in the process.
2024-04-19 15:16:07 +08:00