Commit Graph

378 Commits

Author SHA1 Message Date
Giancarlo Buomprisco
ca5e02f509 Add conditional checks for E2E and billing tests (#34)
* Add conditional checks for E2E and billing tests

Added a conditional check to only run the End-to-End (E2E) workflow if the environment variable ENABLE_E2E_JOB is set to true. Also added a similar check in the Playwright configuration for running billing tests only if the ENABLE_BILLING_TESTS environment variable is 'true'. This will allow more control over the tests run in different environments.
2024-06-12 16:51:28 +08:00
gbuomprisco
cbd8941c37 Upgrade 'next' package and several dependencies to newer versions
The 'next' package and its dependencies in several packages have been upgraded. The 'lemonsqueezy.js' and 'pino' libraries also received updates. This commit ensures that the project uses the latest features, performance improvements, and security patches from these dependencies.
2024-06-12 12:49:08 +08:00
gbuomprisco
236185933d Update package dependencies and remove unused import
Updated several package dependencies including 'react-hook-form' and '@types/node' in various package.json files, and '@typescript-eslint/eslint-plugin' and '@typescript-eslint/parser' in the ESLint configuration. Additionally, an unused import related to "prettier-plugin-tailwindcss" has been removed from the prettier tool configuration.
2024-06-12 00:04:08 +08:00
gbuomprisco
5e115ca600 Update several package dependencies
This commit updates the versions of several dependencies across various packages, with the primary updates being to `@tanstack/react-query`, `prettier`, and `lucide-react`. This helps to keep the project dependencies up-to-date and may also include minor bug fixes or improvements from the updated packages.
2024-06-11 23:36:11 +08:00
gbuomprisco
134eeb2400 Fixed documentation navigation overflow 2024-06-09 00:10:00 +08:00
giancarlo
940e704069 Refactor SQL tests, add function for single account per owner, enhance generator configuration
Enhanced the Supabase SQL tests by refining the code indentation. Added a new function that ensures users can only own a single account. Revised the interactive generator to use boolean checks rather than string inputs which simplifies the setup process and prevents potential user errors.
2024-06-08 00:31:10 +08:00
giancarlo
f8347c603c Update versions of multiple dependencies
This commit updates the minor and patch versions of several dependencies across multiple packages including eslint-config-turbo, lucide-react, stripe, turboo and others. It also updates the lockfile version. Additionally, styling for CheckCircle in 'packages/billing/gateway/src/components/pricing-table.tsx' has been adjusted.
2024-06-07 11:21:49 +07:00
giancarlo
2e7e289495 Fixed sign in with an invite token when user is signed out 2024-06-07 01:23:16 +07:00
Giancarlo Buomprisco
c9f0ec5d89 Turbo v2 (#32)
Updated to Turbo v2, and updated dependencies.
2024-06-06 15:36:16 +07:00
giancarlo
a3f339aaf6 Fix issues with Lemon Squeezy and i18n issue requiring a parameter we do not pass. 2024-06-05 19:15:21 +07:00
giancarlo
4b4feeec99 Added tests for storage 2024-06-05 13:12:35 +07:00
mk3ext
521cba7dd3 fix(web): update schema.sql for supabase, fixes file upload (#31)
The RLS policy restricted non-uuid file names from being uploaded to ANY bucket.
This was caused by the "or" condition in the policy. This fixes that by wrapping both "or" conditions in a single set of parentheses.
2024-06-05 12:43:04 +07:00
giancarlo
d203c9782d Remove redundant loaders and update styling
Deleted the previously redundant loaders from blog and docs sections. Updated the loading.tsx files in home to utilize the GlobalLoader component with improved styling. Additionally, styling in global-loader.tsx from the ui package has been modified to ensure better visibility.
2024-06-04 17:46:40 +07:00
giancarlo
e2112eefee Update UI styling and Spinner component
Several updates have been made to UI components across various packages. Styling changes have been made in 'global-loader.tsx', 'docs-card.tsx', and 'pricing-table.tsx'. The Spinner component in 'spinner.tsx' has been updated to adjust size and animation properties. Addition of a new prop 'spinnerClassName' in 'loading-overlay.tsx' allows dynamic class assignment. The 'loading.tsx' now exports GlobalLoader directly instead of wrapping it in a function. 'pnpm-lock.yaml' has been updated with a new specifier.
2024-06-04 17:17:12 +07:00
giancarlo
ab1e09cbc1 Update packages and refactored code for improved performance
Updated versions of various packages including "@tanstack/react-query", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", and "@marsidev/react-turnstile".

 Additionally, refactored the code in several files including package.json, members-page.loader.ts, page.tsx to ensure proper import statements and optimal function execution order.
2024-06-04 16:03:31 +07:00
giancarlo
2696c08d7d Refactor BillingEventHandlerService and update SQL permissions
Changed BillingEventHandlerService from a class to a method. Also, the SQL permissions for service_role on public.order_items table have been updated to include insert, update and delete operations. Additionally, made adjustment to configuration values in the billing.sample.config.ts file.
2024-06-04 13:32:02 +07:00
giancarlo
3261f2b582 Add more efficient authentication check function to server components.
Added request logging to Next.js config.

This commit introduces a new function 'requireUserInServerComponent' which checks for user authentication and is used in multiple server components. The aim is to enhance efficiency by caching the function so that data is only fetched once per request, preventing unnecessary database hits. Existing components were modified accordingly to incorporate this new method.
2024-06-04 11:54:04 +07:00
giancarlo
16c0f07e59 Update collection type for content retrieval
Changed the collection type from 'pages' to 'documentation' when getting content by slug in the marketing docs page. This change is intended to target the correct content segment in the CMS client function.
2024-06-04 02:12:39 +07:00
giancarlo
bf7e3185de Refactor cache functions to use explicit loaders
The commit refactors the previous implementation of using cache functions across several modules. They are now explicitly defined as loaders to improve readability and maintain a consistent style. This prevents the cache function calls from getting too nested and difficult to understand, especially in asynchronous cases. Additionally, the user session related hooks are deleted which were not used anymore.
2024-06-04 01:03:57 +07:00
giancarlo
b1c3f12721 Fixed React Query provider. Removed getSession and replaced with getUser to make Supabase happy. Fixed Stepper's responsiveness. 2024-06-03 16:13:55 +07:00
giancarlo
88cebc2126 Improved cache invalidation, and minor design fixes 2024-06-03 15:10:40 +07:00
giancarlo
d0c6981e78 New Tailwind CSS formatter run 2024-06-03 00:35:09 +07:00
giancarlo
08de59a43a Update dependencies and improve type safety in webhook handling
This commit updates various dependencies across the project, including a version bump for 'lucide-react' and 'prettier'. Additionally, it improves type safety in the 'database-webhook-handler.service.ts' by making the 'DatabaseChangePayload' and 'handleEvent' function more type-safe.
2024-06-03 00:33:49 +07:00
giancarlo
26b2eed60d Update pricing table to exclude flat line items
The pricing table component now filters out flat line items as they do not require further explanation. Consequently, changes have been made to the billing sample configuration file, turning a previously metered item into a flat one for clearer demonstration of usage.
2024-06-02 12:22:52 +07:00
giancarlo
2c52a06536 Update pricing table and billing configuration
Updated the pricing table component to display all line items for a plan, removed condition to exclude primary plan. Adjusted the type of a billing package in the sample configuration to be "metered" instead of "flat". Made related changes in line-item-details component to handle the changes in billing type and to fix the layout.
2024-06-01 15:59:39 +07:00
giancarlo
88ff32479a Update dependencies and refactor SentryProvider component
This update includes version bumps for several dependencies across multiple packages and applications including "@sentry/nextjs", "lucide-react", "@types/node", "pnpm", and others. It also includes a change to the SentryProvider component where the SentryMonitoringService is now instantiated outside the MonitoringProvider function instead of using useRef inside the function.
2024-05-31 19:38:56 +07:00
Giancarlo Buomprisco
7f4bfb15e5 Replace createServerClient with createClient in multiple files (#30)
The `createServerClient` function has been replaced with the `createClient` function in the `server-actions.client.ts`, `route-handler.client.ts`, and `server-component.client.ts` files. This includes adding necessary import statements for `createClient` and adjusting the options passed to it, including `persistSession`, `detectSessionInUrl`, and `autoRefreshToken`.
2024-05-29 09:33:43 +07:00
giancarlo
cbf116c688 Add user id parameter to multi-factor authentication functions
The multi-factor authentication functions have been modified to accept a user id as a parameter. This provides more flexibility as it allows a more specific targeting of users. The `useFetchAuthFactors` function has been updated to export the function rather than default, and the `useFactorsMutationKey` function has been updated to take a user id.
2024-05-28 21:13:36 +07:00
Giancarlo Buomprisco
c495335fd5 Sentry + Turbopack fixes (#28)
* Updated packages

Updated all packages to the latest versions

* Refactor Sentry monitoring configuration and services

The Sentry monitoring configuration and services have been refactored to simplify the setup process. In addition, unnecessary files or exports have been removed from the Sentry package. These changes should make the process of initializing and using the Sentry monitoring services in both the client and server more straightforward and efficient.

* Refactor server-side Sentry instrumentation code

The conditional logic responsible for checking the runtime environment and the enabled status of the monitoring instrumentation has been adjusted. This refactoring simplifies the code, making it more readable, by clearly separating the conditions and nesting the environment-specific operations. A typo in the environment variable name "ENABLE_MONITORING_INSTRMENTATION" was also corrected to "ENABLE_MONITORING_INSTRUMENTATION".

* Rename environment variable for monitoring instrumentation

The environment variable controlling monitoring instrumentation has been renamed from 'MONITORING_INSTRUMENTATION_ENABLED' to 'ENABLE_MONITORING_INSTRUMENTATION'. It affects both the README and .env.production files within the monitoring/api and apps/web directories respectively.
2024-05-28 15:17:56 +07:00
giancarlo
1e047463c8 Upgrade dependencies and enhance UI components
This commit primarily focuses on updating various dependencies, including "@types/react", "@tanstack/react-query", "lucide-react", and others. In addition, several adjustments have been made to UI components, such as adding more properties
2024-05-27 16:12:29 +07:00
Giancarlo Buomprisco
127ad5a315 Force no cache in Supabase clients with Next.js (#27)
* Update navigation menu text color and disable caching in Supabase clients

Updated the active and hover text colors for the navigation menu in the UI package. Also, added prevention of any sort of caching in the Supabase clients (server-actions.client.ts, route-handler.client.ts, server-component.client.ts) to be eventually removed in Next v15. Automatic token refresh is also turned off in the server-component client.

* Increase content items limit in docs loader

The content items limit in the documentation loader has been increased to the maximum safe integer. This ensures that all documentation entries are retrieved from the CMS, avoiding any potential omissions due to arbitrary limits.
2024-05-26 14:44:43 +07:00
giancarlo
f164b24786 Updated packages 2024-05-25 11:31:42 +07:00
giancarlo
a115e37535 Update error handling and function calls in billing services
Minor modifications made to the billing service handlers to improve data interpretation and error processing. The 'getLineItemTypeById' function now uses 'item.variant' for more accurate line item type identification. Unnecessary 'Crypto' object instantiation has been removed in 'createHmac', while improved formatting applied to the error logging within the billing webhook.
2024-05-21 20:41:41 +07:00
giancarlo
9107e31921 Rename 'subscription' path to 'return' in pricing components
The path referred to by "subscription" in the pricing table and pages has been updated to "return". This will redirect users back to the home page instead of the previously configured personalAccountBilling page after signing up or selecting a plan.
2024-05-21 13:50:30 +07:00
Giancarlo Buomprisco
048ab96cbc Add AuthCallbackService to handle auth callbacks in Supabase (#25)
* Add AuthCallbackService to handle auth callbacks in Supabase

Created a new service, AuthCallbackService, in the Supabase package to centralize the handling of authentication callbacks. This service handles two main tasks: verifying the token hash for user email verification and exchanging the authentication code for a session. Code in the web app routes were updated to utilize this new service, improving code organization and reusability.

* Remove CSRF Token Meta component and add Jaeger exporter

The CSRF Token Meta component was removed from the application. Instead, CSRF tokens are now included in the root metadata of the application. Additionally, the "@opentelemetry/exporter-jaeger" package was added as a dependency to the Sentry monitoring package. This enables the tracing of application requests via Jaeger.

* Refactor README.md and remove redundant content

Removed the excessive content and detailed instruction from the README.md file. The documentation has been moved to a more suitable and detailed location elsewhere.

* Update package dependencies in sentry/package.json

An ordering change has been made in the dependencies within the sentry/package.json file. The "@opentelemetry/exporter-jaeger" dependency was moved to its correct alphabetical order. No version changes were made.
2024-05-19 23:45:12 +07:00
giancarlo
3cf3c263bc Fixed issue with one-time payments; Updated packages 2024-05-18 22:56:57 +07:00
giancarlo
5c1e1d5cd0 Update package versions in pnpm-lock.yaml
Several package versions including '@types/node', '@supabase/supabase-js', '@tanstack/react-query' and others were updated in the pnpm-lock.yaml file. This commit ensures all references to these versions are properly updated across the project, contributing to the maintenance of dependency consistency.
2024-05-17 23:13:13 +07:00
giancarlo
e88ae7268a Update UI styles and behavior across various components
This commit updates a variety of user interface styles and interactivity across multiple components. Changes include altering color schemes and border styles, modifying button interactivity and behaviors, and updating font weights. An emphasis has been placed on enhancing visual appearance, improving user experience, and maintaining a more consistent look-and-feel across the application.
2024-05-16 15:56:25 +07:00
giancarlo
09c24346a6 Update logging and return statements in billing services
The commit modifies the logging level in the billing services from 'error' to 'info'. Moreover, the error statement has been modified to clarify that the subscription cancellation has possibly been done by the user. Also, it reduces redundant imports and beefs up the return structure in stripe-billing-strategy.service.
2024-05-15 11:28:37 +07:00
Giancarlo Buomprisco
4e50094808 Fix upsert billing (#24)
This commit updates the product_id and variant_id in both the subscription_items and order_items in the billing tests. Updates also include adding new checks to verify these changes. Changes are reflected in corresponding SQL files for personal and team billing subscriptions/orders tests.
2024-05-15 11:08:19 +07:00
giancarlo
fe86b04d95 Update database schema and tests for subscription and order management
This commit includes a significant change in the way subscriptions and orders are handled. It introduces the ability to update existing orders and subscriptions, including adding and deleting items. The diff also adds checks to ensure that only valid items can be read, and adds corresponding test cases to verify these changes.
2024-05-14 15:38:53 +07:00
giancarlo
f07610ad8e Remove 'taint' from experimental features in next.config
This commit removes the 'taint' feature from the experimental features list in the Next.js configuration file. This change has been made after reviewing that this feature was not required or being used in the current project.
2024-05-13 22:49:11 +07:00
giancarlo
9d30039ba8 Update package versions and optimize URL generation
Updated the versions of several packages including pino and pnpm. Also, the generation of URLs in the pricing-table.tsx file has been optimized by implementing URLSearchParams. A new global error page was also added.
2024-05-13 21:47:51 +07:00
giancarlo
a75009c0df Update route check and add PageBody wrapper
Updated the `isRouteActive` check in the sidebar component to ensure it doesn't falsely identify nested routes as active. Additionally, introduced a `PageBody` wrapper in the account page component for consistent styling and padding.
2024-05-13 19:51:33 +07:00
giancarlo
6ab4558691 Refactor page layout in admin accounts component
The layout of the admin accounts component has been refactored. The "Accounts" heading has been removed from the 'admin-accounts-table.tsx' component and placed as a PageHeader in the 'page.tsx'. A description has also been added to the PageHeader, and the content was wrapped in a PageBody component for better structure and readability.
2024-05-13 19:27:25 +07:00
giancarlo
55e364aebd Update packages to latest versions
Several packages have been updated to their latest versions. This includes "@tanstack/react-table", "@makerkit/data-loader-supabase", and "@tanstack/react-query". Moreover, some UI tweaks have been made in multi-factor-auth-setup-dialog.tsx.
2024-05-13 18:54:12 +07:00
giancarlo
741d54b994 Handle API error in team account retrieval
This update adds error handling for the API call in 'join' page while retrieving the team account information. If the call fails, it will catch the error and return undefined avoiding potential crashes.
2024-05-13 14:43:51 +07:00
giancarlo
f7be3e84f4 Add localization for teams-related strings in home component
Support for internationalization was added to the account components related to teams. This includes localizing messages prompting a user to create a team which were previously hardcoded. Additionally, `Trans` components from '@kit/ui/trans' has been imported and used to enable this.
2024-05-13 14:17:25 +07:00
giancarlo
43bfa16db2 Improved CardButton component; Fixrd translation 2024-05-13 11:23:21 +07:00
giancarlo
84271a31a8 Add card button component and enhance routing
This commit introduces the Card Button component to the UI package and improves URL matching by allowing end to be a boolean or function. Navigation menu components now support both cases. Additionally, changes have been made to improve the visual and functional aspects of various components throughout the application. This includes changes in pricing display, route active checking, and the introduction of new files such as HomeAddAccountButton and HomeAccountsList.
2024-05-13 02:09:28 +07:00