1116 Commits

Author SHA1 Message Date
giancarlo
53f94abe88 Update 'next' version and dependencies in pnpm-lock.yaml
This commit updates the package version of 'next' from 14.3.0-canary.7 to 14.3.0-canary.9 throughout the pnpm-lock.yaml file. Other dependencies updated with the respective package include '@makerkit/data-loader-supabase-nextjs', '@keystatic/next' and so on. This update is important to ensure the latest features are being utilized while retaining compatibility with existing code.
2024-04-18 15:34:07 +08:00
giancarlo
0dfd5d8ec1 Refactor getServiceRoleKey function and update README.md
Temporarily reverted tainting. It doesn't work sometimes.
2024-04-18 14:55:23 +08:00
giancarlo
0fc2581b11 Update README with limitations for Cloudflare deployment
This update adds a new "Limitations" section in the README file, specifically for deploying to Cloudflare. The section covers the restrictions of the Edge runtime, potential need to adjust the application, and aspects to consider regarding latency. This information assists users' understanding of their deployment options and necessary adaptations of their application.
2024-04-18 11:47:16 +08:00
giancarlo
64402e824c Refactor billing components for marketing usage
A new component 'marketing.tsx' was added to the 'billing-gateway' package, for better organization of marketing-related components. This affects the structure of 'package.json' and requires adjustments in 'index.ts'. The import paths in both marketing-related pages ('pricing/page.tsx', 'page.tsx') were also updated for consistency.
2024-04-17 21:36:42 +08:00
giancarlo
5a74f93d26 Upgrade Next.js version in pnpm-lock.yaml
The Next.js version in pnpm-lock.yaml file has been updated from 14.2.1 to 14.3.0-canary.7. This upgrade affects various dependencies, potentially providing new features, security upgrades or performance improvements.
2024-04-17 21:30:46 +08:00
giancarlo
f7ded6f789 Add support for Resend mailer
This update expands the mailer support by adding the Resend mailer as an alternative to NodeMailer and Cloudflare Mailer. After setting the environment variable 'MAILER_PROVIDER' to 'resend', users can utilize the Resend HTTP API for mailing. Necessary instructions and variable settings regarding the usage of Resend mailer have also been added to README.md and related modules.
2024-04-17 18:42:00 +08:00
giancarlo
d60609d279 Update dependency versions in multiple packages
This commit updates `@tanstack/react-query` to version 5.29.2 in `supabase`, `auth`, `admin`, `accounts`, and `team-accounts` packages. It also bumps up the `i18next-browser-languagedetector` version to 7.2.1 in the `i18n` package. These updates help keep dependencies current and ensure the packages are compatible with the latest versions of their dependencies.
2024-04-17 18:13:35 +08:00
giancarlo
6b17146b16 Update lucide-react dependency version
The version of lucide-react package in all project dependencies has been upgraded from "^0.367.0" to "^0.368.0". This update was done across multiple packages in the project to ensure consistency and the latest features/bug fixes from the updated library are utilized.
2024-04-17 17:53:25 +08:00
giancarlo
c2bccef0db Update README and seed.sql for webhooks and admin panel
The README file was updated to include more specific instructions for adding database webhooks through Supabase Studio. Additional information was also added regarding setting up the Super Admin panel. In the seed.sql file, the trigger name was corrected.
2024-04-17 17:43:29 +08:00
giancarlo
a188ca92e1 Add semi-colons and correct formatting in database.types.ts
This commit implements proper syntax standards throughout the file. Every necessary line now ends with a semicolon, providing better readability and avoiding potential errors in future code interpretation.
2024-04-17 16:15:57 +08:00
giancarlo
bf43c48dff Add HMAC function, and update the CMS and Mailer services
A new module has been added to create HMACs, primarily used in the billing service for data verification. Keystatic CMS usage has been conditioned to Node.js runtime only, and a fallback to the mock CMS client has been implemented for Edge Runtime. Mailer services now accommodate environment-specific providers.
2024-04-17 15:47:50 +08:00
giancarlo
d62bcad657 Add environment variables and deployment instructions to README
The README is updated to include comprehensive instructions and guidance for setting up various environment variables which are essential for the project's configuration. In addition, it provides instructions on how to deploy the project to two popular platforms: Vercel and Cloudflare.
2024-04-17 14:05:17 +08:00
giancarlo
f8e0783e79 Add environment variables and deployment instructions to README
The README is updated to include comprehensive instructions and guidance for setting up various environment variables which are essential for the project's configuration. In addition, it provides instructions on how to deploy the project to two popular platforms: Vercel and Cloudflare.
2024-04-17 13:46:34 +08:00
giancarlo
c238e08fa7 Replace session with user in team accounts
This commit replaces the session object with the user object in the team accounts feature. This change is reflected in the team-account-danger-zone, layout, team-account-workspace, and billing components. The usage of the user object provides more specificity and accuracy in handling user information compared to the more generic session object.
2024-04-16 22:41:06 +08:00
giancarlo
d7cf271e8a Refactor personal account components for data fetching efficiency
Refactored personal account components to centralize user data fetching and subsequently reduce and distribute calls. Instead of fetching user data individually in `UpdateAccountImageContainer`, `UpdateAccountDetailsFormContainer` and `UpdateAccountNameFormContainer`, data fetching is now performed in the parent component, `AccountSettingsContainer`. Also, implemented partial loading state.
2024-04-16 22:30:41 +08:00
giancarlo
8dd4b594d2 Update database types and relationships
The commit removes semicolons at the ends of lines and makes updates to the Database object in the `database.types.ts` file. This better aligns the syntax with TypeScript norms. It also affects many database relationships, including but not limited to `Accounts`, `Roles`, and `Subscriptions`.
2024-04-16 22:17:28 +08:00
giancarlo
1cb0470ce0 Update data-loader-supabase-nextjs version to 1.1.0
The version of @makerkit/data-loader-supabase-nextjs in the pnpm-lock.yaml file has been updated from 1.0.0 to 1.1.0. The respective integrity, dependencies, and dev status have also been adjusted to reflect this change.
2024-04-16 21:49:22 +08:00
giancarlo
eea6f8121a Enable suspense mode for i18n library
The changes introduce suspense mode in the i18n settings, waiting until all languages are loaded. The loading state now shows a global loading
2024-04-16 21:46:18 +08:00
giancarlo
85ad61c20e Update styling on pricing table component
The styling of the pricing table component in the billing gateway package has been updated. This includes changing the border style for highlighted items, updating font weight in certain areas, and adjusting font sizes for better readability and consistency across different viewports.
2024-04-16 21:20:13 +08:00
giancarlo
d8d6aa8f92 Update UI component styles and structure
Several modifications have been made to the styles and structure of the Loading, Docs Navigation, and Pricing Table components. For Loading component, GlobalLoader is now wrapped in a function. Visual changes were also made to the Docs Navigation buttons and the Pricing Table elements layout and text styles, to improve the overall look and feel of the interfaces.
2024-04-16 21:13:27 +08:00
giancarlo
1f3c4805f0 Refactor i18n initialization and make UI adjustments
Converted the `initializeI18nClient` function to an asynchronous function for a more straightforward implementation. Simultaneously, made some tweaks to the UI components, such as altering dimensions in `site-footer.tsx` and `site-page-header.tsx`, and refactoring the `FooterSectionHeading` component for easier maintenance and improved readability.
2024-04-16 21:06:28 +08:00
giancarlo
cad729670f Update dependencies and import dynamic method
This commit updates multiple dependencies in the pnpm-lock.yaml file and imports the dynamic method from 'next/dynamic' in the site-header-account-section.tsx file. These updates are part of routine maintenance and improvement of the codebase. The import allows for dynamic imports, which can enhance performance.
2024-04-16 20:56:18 +08:00
giancarlo
f2be1b80f4 Update user data fallback and theme handling
This commit adds a fallback mechanism to handle `null` user values in the site header account section. Previously, if `user.data` was `null`, the code could fail. Now, it checks for valid `user.data` before proceeding. For the layout section, it now includes a separate condition for 'light' theme, providing a clear distinction between 'dark'
2024-04-16 17:15:22 +08:00
giancarlo
35291975a6 Add animation to personal account dropdown
A "fade-in" animation has been added to the personal account dropdown menu on the dashboard home page. The user data handling has also been modified to ensure the props.user data is used as fallback. The changes should provide a smoother user experience and improved data stability.
2024-04-16 17:09:07 +08:00
giancarlo
76520a35b6 Add error logging and Suspense component
Added error logging to the i18n client initialization to better handle and trace errors. Introduced React's Suspense component in `root-providers.tsx` to provide a fallback UI in case a component within the tree is not yet ready to render.
2024-04-16 15:36:23 +08:00
giancarlo
eaa163935b Upgrade multiple dependencies
Updated several dependencies that mainly include '@manypkg/cli', '@supabase/supabase-js', 'edge-csrf', 'i18next', '@types/react', 'autoprefixer', 'supabase', and '@sentry/nextjs'. This is a general dependencies update for performance and security improvements, bug fixes, and newer features. The commit also includes changes to '@babel/types' inside dependencies of several packages.
2024-04-16 15:03:41 +08:00
giancarlo
26db7d9a0e Update styling and add new heading font
The styling of multiple components has been updated for consistency and readability. A new heading font has been added to improve visual hierarchy. Changes include updating font sizes, adding a new heading font, and adjusting borders and padding over several components.
2024-04-16 14:32:22 +08:00
giancarlo
55535e04b7 Add new type definitions to billing/core package
New type definitions have been added to the billing/core package: UpsertOrderParams and UpsertSubscriptionParams. These types were then exported and used in other services, removing duplication and ensuring type consistency across the package. The changes have been reflected in the package.json file of billing/core package.
2024-04-16 12:48:33 +08:00
giancarlo
8fde758671 Refactor billing event handler and fix minor bugs
Refactored the billing-event-handler.service.ts by introducing new types `UpsertSubscriptionParams` and `UpsertOrderParams` to simplify method parameters. Fixed minor bugs including the correction of an error message in lemon-squeezy-webhook-handler.service.ts and adjusting the handling of attribute types. Also updated comment in billing-webhook-handler.service.ts for better clarity.
2024-04-16 12:32:15 +08:00
giancarlo
ebb8fc08fe Add custom handlers for billing events
The code introduces custom handlers for different billing events like subscription deletion, subscription update, checkout session completion, payment successes and failures, invoice payment,  and a generic event handler. These customer handlers allow consumers to add their own custom behaviors when certain billing events occur. This flexibility can be utilized to better adapt the system to various business requirements and rules. Also, the invoice payment event and a generic event handler were added.
2024-04-16 11:55:43 +08:00
giancarlo
761c5d6080 Update UI elements and enhance security measures
Changes are introduced primarily to the site header buttons and styles, as well as some content corrections. Also, the SUPABASE_SERVICE_ROLE_KEY environment variable is now sanitized before use to prevent potential security vulnerabilities. The function 'taintUniqueValue' from React is used to ensure this process. These changes align with good practices for both UI/UX and security.
2024-04-15 23:38:54 +08:00
giancarlo
c2bc9c5ed2 Update captchaTokenSiteKey validation in auth.config
Changed the captchaTokenSiteKey configuration in auth.config.ts. Previously, it could only accept strings of minimum length 1 but now, it is modified to accept any length string, including an empty string.
2024-04-15 19:21:40 +08:00
giancarlo
f5e8d9a329 Add authentication variables to .env file
Authentication variables have been added to the .env file. This includes enabling password authentication, disabling magic link authentication, and adding
2024-04-15 19:19:43 +08:00
giancarlo
df239e9903 Update user authentication and refactor UI components
Refactored the user authentication method in the dashboard from getSession to getUser, and updated its related variables accordingly. UI components have also been modified, which includes streamlining the importation of the 'cn' function and exporting the 'Stepper' function directly. Lastly, the 'Stepper' function is now included in the package.json for the UI component package.
2024-04-15 19:07:59 +08:00
giancarlo
8627cdaf1f Update 'next' package version and refactor user account handling
This commit updates the 'next' package from version 14.2.0 to 14.2.1 across various modules. It also refactors the code for user account handling to make it controlled by an enableTeamAccounts flag in the featureFlagsConfig, essentially allowing the enabling or disabling of the 'team accounts' feature according to the specified flag.
2024-04-15 17:46:11 +08:00
giancarlo
81e662e63d Add Stripe as billing provider to environment variables
This commit adds Stripe as the billing provider in the .env file for the web application. This change is essential for enabling Stripe-based transactions within the application.
2024-04-15 17:30:09 +08:00
giancarlo
b0fe19e73e Update feature flags and related environment variables
The code has been adjusted to update the description and requirement error messages of the feature flags. Additionally, the related environment variables used in feature flags have been renamed for better consistency and clarity. This helps in better identification and usage of these feature flags.
2024-04-15 17:16:50 +08:00
giancarlo
62567e326c Refactor environment files and update .gitignore
Environment variable definitions were moved from .env.development, .env.test and .env.production to a new shared .env file. This provides a centralized location for common environment variables values, easier manageability, and overrides capability in specific environments. The .gitignore file was also updated to no longer ignore the .env file as this file now contains public / non-sensitive configuration values.
2024-04-15 17:10:35 +08:00
giancarlo
002d252f36 Update Stripe CLI command and key adjustments in line item components
The Stripe CLI command in the workflow file has been updated to use Docker. Additionally, the keys for line-item-details.tsx have been modified, changing item.id and tier.upTo to index to avoid potential key duplication issues within the same component.
2024-04-15 16:31:22 +08:00
giancarlo
2927d9980b Add sorting options to blog page and CMS clients
This update enables sorting of blog page entries based on 'publishedAt' date or custom order. This flexibility has been implemented across the marketing blog page, Keystatic, Wordpress, and Core CMS client services. This functionality allows more control over the presentation of entries.
2024-04-15 16:02:14 +08:00
giancarlo
cb690ec317 Add better theme support and update marketing page layout
The theme property was added to the RootProvider component. This allows the application to initially load the theme stored in the user's cookies. The marketing page layout has been updated: images were resized, a billing section was added, and heading styles were adjusted. Text strings were also revised for clarity.
2024-04-15 15:50:24 +08:00
giancarlo
cb4d89c473 Update Stripe publishable key in test environment
In the .env.test file, the Stripe publishable key for the testing environment was set to a new value. This change ensures that we are using the correct Stripe credentials during testing.
2024-04-15 15:00:14 +08:00
giancarlo
f1e3a44c89 Refactor monitoring instrumentation setup
Removed the MONITORING_PROVIDER constant from the monitoring package, replaced it with direct process.env access. This ensures that environment variables are accessed directly at the time of use without intermediate variables. In the apps/web/instrumentation.ts file, refactored condition checks for runtime environment and instrumentation enablement, using direct access environmental variables. This change simplifies the code and improves readability.
2024-04-15 14:41:48 +08:00
giancarlo
e75fcfc750 Refactor monitoring instrumentation code across modules
The monitoring instrumentation methodology has been simplified for both Baselime and Sentry providers by aligning their registration functions and error handling processes. Specifically, function names have been standardized to 'registerInstrumentation' and handling for the absence of the INSTRUMENTATION_SERVICE_NAME environment variable is now conducted within these functions. In addition, the MONITORING_INSTRUMENTATION_PROVIDER variable has been renamed to MONITORING_PROVIDER.
2024-04-15 14:30:23 +08:00
giancarlo
07ff9a7f8e Introduce error boundary mechanism and exception capture with Baselime and Sentry
Deleted the ErrorBoundary component from the makerkit package and introduced new exception capture mechanisms for Baselime and Sentry monitoring providers. The code now captures all exceptions thrown within components and sends them to the configured monitoring provider, which in turn logs the errors for debugging purposes. Updated packages and environment variables accordingly to support this feature.
2024-04-15 14:14:08 +08:00
giancarlo
bb19d6d207 Update playwright config and refactor billing error pages
An environment variable has been added to playwright config for running the server command. On billing error pages, an icon was added to the error message, and the duplicate billing error page was refactored to import from the existing page instead of maintaining separate code. Also, changes were made to the workflow to reflect new Playwright server command.
2024-04-15 13:16:04 +08:00
giancarlo
63c818cc88 Update run command in workflow
The .github/workflows/workflow.yml file has been updated to run the 'start:test' command in the background. This change was made to allow the workflow to continue running subsequent steps without waiting for the 'start:test' command to finish.
2024-04-15 12:50:43 +08:00
giancarlo
a3fc153207 Update billing navigation and increase test timeout
Changes include updating the user and team billing specs to increase visibility timeout and alter navigation route post-billing. Minor adjustments have been made to the page aesthetics and redirection logic. Also, refactored import statements for code organization purposes. Changes in the build script are also reflected in the commit.
2024-04-15 12:40:27 +08:00
giancarlo
4e305bf8c9 Update UI, improve E2E tests and modify trial period configuration
The code changes incorporate UI updates for better usability and user experience. E2E test scripts(in `user-billing.spec.ts` and `team-billing.spec.ts`) were also updated for improved efficiency and accuracy, primarily replacing 'Active' status check with 'Trial'. Changes have been made in the trialDays configuration, with the term 'trialPeriod' now replaced by 'trialDays' across different components. Notably, a new error handling case is included in `lemon-squeezy-billing-strategy.service.ts` for failed subscription cancellation attempts.
2024-04-15 01:18:27 +08:00
giancarlo
26f1371283 Adjust locator in billing test and add data-test attribute
Updated the locator for the 'manageBillingButton' in the end-to-end billing test. Instead of an id, the locator now targets a data property. This change was also reflected in the Button component within 'billing-portal-card.tsx' where the attribute data-test was added for test recognition.
2024-04-14 20:02:06 +08:00