62 Commits

Author SHA1 Message Date
Giancarlo Buomprisco
6268d1bab0 Updated dependencies, Added Hosted mode for Stripe checkout
* chore: bump version to 3.1.0 and update dependencies in package.json, pnpm-lock.yaml, and pnpm-workspace.yaml; enhance billing services with support for hosted checkout page in Stripe integration

* Enhance error handling in billing services to log error messages instead of objects; update documentation for Stripe integration to clarify publishable key requirements based on UI mode.
2026-03-31 12:44:30 +08:00
Giancarlo Buomprisco
7ebff31475 Next.js Supabase V3 (#463)
Version 3 of the kit:
- Radix UI replaced with Base UI (using the Shadcn UI patterns)
- next-intl replaces react-i18next
- enhanceAction deprecated; usage moved to next-safe-action
- main layout now wrapped with [locale] path segment
- Teams only mode
- Layout updates
- Zod v4
- Next.js 16.2
- Typescript 6
- All other dependencies updated
- Removed deprecated Edge CSRF
- Dynamic Github Action runner
2026-03-24 13:40:38 +08:00
gbuomprisco
4912e402a3 Revert "Unify workspace dropdowns; Update layouts (#458)"
This reverts commit 4bc8448a1d.
2026-03-11 14:47:47 +08:00
Giancarlo Buomprisco
4bc8448a1d Unify workspace dropdowns; Update layouts (#458)
Unified Account and Workspace drop-downs; Layout updates, now header lives within the PageBody component; Sidebars now use floating variant
2026-03-11 14:45:42 +08:00
Giancarlo Buomprisco
3e6fef41c7 chore: update package versions and dependencies across multiple files (#413)
* chore: update package versions and dependencies across multiple files

- Bumped application version to 2.21.3 in package.json.
- Updated dependencies including turbo to version 2.6.1, @next/bundle-analyzer and @next/eslint-plugin-next to version 16.0.3, and @supabase/supabase-js to version 2.81.1.
- Adjusted @types/node, @types/react, and @types/react-dom versions for consistency.
- Refactored package.json files to utilize catalog dependencies for improved management.
- Incremented various other dependencies such as react-i18next to version 16.3.3 and tailwind-merge to version 3.4.0.

* chore: downgrade @next/bundle-analyzer and @next/eslint-plugin-next to version 16.0.2 and update next to version 16.0.2 in pnpm-lock.yaml and pnpm-workspace.yaml

- Updated package versions for consistency across the project.
- Adjusted the overflow property in the PageWithSidebar component for improved layout handling.

* feat: add sorting functionality to DataTable header

- Implemented click handler for sortable headers in the DataTable component, allowing users to toggle sorting between ascending and descending order.
- Enhanced user interaction by updating the header's visual state based on the current sorting direction.

* fix: update layout and structure in UserHomePage and DashboardDemo components

- Added a new div structure within the PageBody of UserHomePage for improved layout.
- Simplified the grid structure in DashboardDemo by adjusting the number of columns for better responsiveness.
- Enhanced the PageWithSidebar component to ensure proper flex behavior and layout consistency.

* refactor: simplify PageBody structure in UserHomePage

- Removed unnecessary div elements within the PageBody of UserHomePage for cleaner layout.
- Enhanced readability and maintainability of the component structure.
2025-11-18 22:34:53 +07:00
Giancarlo Buomprisco
50337298fd Dependencies Updates, Sidebar fixes, default plan, Radix single package (#297)
* Refactor Radix UI imports and update package dependencies, fix Sidebar "group" references, add default value to plan picker to preselect a plan
2025-07-11 17:57:27 +08:00
gbuomprisco
b4c8c74bd0 chore(dependencies): update packages to latest versions
- Bumped `lucide-react` to `^0.516.0`
- Upgraded `react-hook-form` to `^7.58.0`
- Updated `zod` to `^3.25.67`
- Incremented `@sentry/nextjs` to `^9.29.0`
- Miscellaneous upgrades for `eslint`, `@tailwindcss/postcss`, and `supabase` dependencies.
2025-06-17 13:33:32 +08:00
Giancarlo Buomprisco
9033155fcd Add OTP sign-in option + Account Linking (#276)
* feat(accounts): allow linking email password
* feat(auth): add OTP sign-in
* refactor(accounts): remove 'sonner' dependency and update toast imports
* feat(supabase): enable analytics and configure database seeding
* feat(auth): update email templates and add OTP template
* feat(auth): add last sign in method hints
* feat(config): add devIndicators position to bottom-right
* feat(auth): implement comprehensive last authentication method tracking tests
2025-06-13 17:47:35 +08:00
Giancarlo Buomprisco
856e9612c4 Improve billing plan lookup (#270)
Retrieve plan from Stripe/LS if not found in billing configuration. Useful for legacy plans.
2025-06-13 17:45:55 +08:00
Giancarlo Buomprisco
1c31e7ffab Update Calendar component and update dependencies and updated Agents MD files (#269)
* Update Calendar component and update dependencies

* Refactor AGENTS.md and CLAUDE.md for clarity and consistency

- Streamlined project overview and architecture sections in both AGENTS.md and CLAUDE.md to enhance readability.
- Updated command sections to reflect essential commands and improved formatting for better usability.
- Clarified multi-tenant architecture details and database operations, ensuring accurate representation of the project's structure.
- Enhanced component organization and security guidelines for better developer onboarding and adherence to best practices.

* Refactor code for consistency and readability

- Improved formatting in `env-variables-model.ts` for better description clarity.
- Enhanced readability of `current-plan-alert.tsx` and `current-plan-badge.tsx` by adjusting the status badge mapping.
- Standardized object syntax in `lemon-squeezy-webhook-handler.service.ts` for consistency.
- Refined className ordering in `account-selector.tsx` for better maintainability.
- Ensured proper syntax in `console.ts` with consistent object export.
- Reorganized imports in `calendar.tsx` for clarity and structure.
- Improved className formatting in `sidebar.tsx` for better readability.

* Update package version to 2.10.0 in package.json
2025-06-08 14:31:49 +08:00
Giancarlo Buomprisco
67663b32d9 Deps update + basic Claude.md and Agents.md (#268)
* Add comprehensive guides for OpenAI Codex and Claude Code

- Introduced `AGENTS.md` and `CLAUDE.md` files to provide detailed guidance for working with OpenAI Codex and Claude Code within the project.
- Updated project architecture and common commands sections to reflect the multi-tenant SaaS application structure and core technologies.
- Enhanced documentation on database operations, schema management, security guidelines, and development patterns to improve developer onboarding and project maintainability.

Additionally, updated various package dependencies across the codebase to their latest versions, ensuring compatibility and performance improvements.
2025-06-06 13:10:14 +08:00
Giancarlo Buomprisco
40afecde93 28 05 2025 deps update (#262)
* Update dependencies across all packages

Updated multiple dependencies to their latest versions to ensure compatibility, security, and performance improvements. This includes packages like @supabase/supabase-js, @tanstack/react-query, @types/react, and zod across various projects.

* Update selector for Stripe form submission button

Replaced the form button selector with a `data-testid` attribute selector for improved reliability and maintainability. This ensures the test is less prone to breaks from UI changes.
2025-05-28 09:26:28 +08:00
Giancarlo Buomprisco
2ede13dec9 20 05 2025 deps update (#257)
* Update dependencies across packages

Upgraded various package dependencies, including `zod`, `@supabase/supabase-js`, `react-hook-form`, `lucide-react`, and others to their latest versions. Ensures compatibility, security, and access to new features.
2025-05-20 11:46:09 +08:00
Giancarlo Buomprisco
de347005b1 Upgrade dependencies across multiple packages for improved stability and features (#252)
- Updated `@manypkg/cli` from `^0.23.0` to `^0.24.0` for enhanced functionality.
- Upgraded `@tanstack/react-query` from `5.74.11` to `5.75.2` to incorporate the latest improvements.
- Incremented `lucide-react` from `^0.503.0` to `^0.507.0` for better compatibility.
- Updated `nodemailer` from `^6.10.1` to `^7.0.2` to leverage new features and fixes.
- Upgraded `react-hook-form` from `^7.56.1` to `^7.56.2` for bug fixes and enhancements.
- Updated `zod` from `^3.24.3` to `^3.24.4` for improved type definitions.
- Incremented `@types/node` from `^22.15.3` to `^22.15.9` for better type support.

These updates enhance the overall stability, performance, and compatibility of the application.
2025-05-06 10:03:57 +08:00
Giancarlo Buomprisco
903ef6dc08 Update Stripe SDK to v18 and dependencies (#236)
* Update Stripe SDK and dependencies

1. Upgrade `stripe` package from version 17.7.0 to 18.0.0 in `package.json`.
2. Update `STRIPE_API_VERSION` in `stripe-sdk.ts` to '2025-03-31.basil'.
3. Refactor `StripeWebhookHandlerService` to retrieve subscription details using Supabase client, ensuring compatibility with the new Stripe version.
4. Introduce helper methods `getPeriodStartsAt` and `getPeriodEndsAt` for better handling of subscription periods based on the Stripe API changes.

These changes enhance the integration with the latest Stripe API and improve the overall reliability of the billing service.

* Refactor billing payload builders to remove config dependency

Removed direct dependency on `BillingConfig` in subscription payload builders.

Introduced `PlanTypeMap` to streamline plan type resolutions. Updated webhook handlers and event processing functions to handle plan types more efficiently and improve extensibility.

* Refactor Stripe subscription handling for improved accuracy
2025-04-22 10:42:12 +08:00
Giancarlo Buomprisco
1327a8efb7 Upgrade dependencies across packages (#241)
Updated multiple dependencies to their latest versions, including `next` to `15.3.1`, `zod` to `3.24.3`, `@tanstack/react-query` to `5.74.4`, and others. This ensures compatibility, improves stability, and incorporates the latest bug fixes.
2025-04-20 20:48:08 +08:00
Giancarlo Buomprisco
e403a6cd75 EsLint speedup (#161)
* Updated packages
* Fix Turbo TURBO_SCM_BASE
* Disable type-aware rules
2025-02-12 14:58:56 +08:00
Giancarlo Buomprisco
6f9cf22fa8 EsLint v9 (#154)
* Upgrade ESLint and related configurations to version 9

- Update ESLint to version 9.19.0
- Migrate ESLint configurations to flat config format
- Remove deprecated ESLint config files
- Update package dependencies and configurations
- Simplify ESLint setup across packages
- Remove unnecessary ESLint config blocks from package.json files
- Improved CI caching with Turborepo tasks
- Removed duplicate styles
2025-02-07 11:38:29 +08:00
Giancarlo Buomprisco
b319ceb5bb Add hidden product option to billing components (#136)
- Introduced `hidden` field in product schema to control product visibility
- Updated PlanPicker and PricingTable to filter out hidden products
- Ensures hidden products are not displayed to users
2025-02-04 07:27:43 +08:00
gbuomprisco
ec6f39579d Cleaned up READMEs 2025-01-13 02:33:05 +07:00
gbuomprisco
ce63993035 Updated packages (Next.js 15.1.0)
Fixed linting
2024-12-11 12:45:11 +08:00
gbuomprisco
f2118e97f8 Stripe: allow passing custom parameters to the Checkout session 2024-09-20 18:38:44 +02:00
gbuomprisco
9294e1c823 Refactor code for readability and order
Made several changes across different files primarily focusing on readability. Arranged CSS classes in a standardized order for easier reading and maintenance. Arranged and formatted import lines, function declarations, and component return statements for legibility. Removed unnecessary React imports in some files.
2024-06-21 17:58:20 +08:00
gbuomprisco
95fa8fb7c6 Add handling for paid invoices in billing services
In response to paid invoices, a new callback method has been introduced in the billing services. This feature includes changes in billing-webhook-handler.service.ts, lemon-squeezy-webhook-handler.service.ts, and other related files. The new method fetches and handles paid invoice information from Stripe and LemonSqueezy subscriptions.
2024-06-20 00:02:25 +08:00
Giancarlo Buomprisco
6a339a4b02 Billing get subscription enhancement (#36)
* Filter out metered line items from billing schema

This update refines the process of creating a billing schema by filtering out metered line items. The change is necessary as metered line items can be shared across different plans, potentially causing conflicts or duplicates in the schema.

* Update packages to newer versions

This update upgrades several packages across multiple project files to their latest version. These packages include "supabase-js", "react-query", "react-hook-form", and "pnpm". The commit ensures the project is up-to-date with recent package versions, potentially benefiting from bug fixes, new features, and performance improvements.

* Add subscription retrieval in billing services

Added a function to retrieve subscription info in both Stripe and LemonSqueezy billing services. To accomplish this, new methods were added to related services and types. This allows querying specific subscription data based on its id, and throws an error if it fails. Furthermore, PayloadBuilder classes were created to systematically build the subscription payload.

* Remove account ID retrieval from Lemon Squeezy billing service

The code that was querying the database to fetch the accountId has been removed from lemon-squeezy-billing-strategy.service.ts. It was unnecessary as the Lemon Squeezy API does not provide account ID and therefore it is always left empty. Also, adjustments have been made in billing-strategy-provider.service.ts to reflect that the target account ID can be optional.

* Extract 'next' parameter from callback URL

The update allows for the extraction of the 'next' parameter from the callback URL. If such a parameter is available, it is subsequently added to the search parameters. The enhancement improves URL parameter handling in the authentication callback service.

* Refactor URL redirection in auth-callback service

The update simplifies the redirection logic in the authentication callback service. This is achieved by setting the url pathname directly to the redirect path, instead of first setting it to the callback parameter. Moreover, the code handling the 'next' path has also been streamlined, setting the url pathname to the next path when available.
2024-06-19 23:00:00 +08:00
gbuomprisco
bb6f26f240 Update and refactor billing services and types
Several updates and refactorings have been made to the billing services and types. The "onInvoicePaid" method and some types related to line items have been removed. The comments and arguments for the "verifyWebhookSignature" and "handleWebhookEvent" methods in service classes have been updated for clarity. The "onEvent" method's arguments have also been adjusted in multiple places to improve consistency.
2024-06-11 23:35:32 +08:00
giancarlo
ced1b4f7e3 Add refinement to ensure metered line items have zero cost
The billing schema has been updated to include a refinement that ensures metered line items have a cost of zero. To clarify, a different line item type should be added for a flat fee in Stripe. Additionally, unnecessary verifications and logic regarding item costs have been removed from the PlanPicker and LineItemDetails components.
2024-06-01 17:03:20 +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
giancarlo
7a1dd7768a Updated zod; Fix issue displaying mode toggle in site header when disabled 2024-05-09 10:46:00 +07:00
giancarlo
b81cc94800 Enforce config for billing; updated packages 2024-05-08 21:47:17 +07:00
giancarlo
e159c52d41 Corrected variable name typo and updated library dependencies
An incorrect variable name in account-invitations-table.tsx was fixed, correcting `iRenewingInvite` to `isRenewingInvite`. Additionally, several dependencies across the project were updated, including `zod`, `supabase`, and `stripe`, among others. These updates ensure the project is using the most recent and secure versions of the libraries.
2024-05-03 16:33:44 +07:00
giancarlo
898e1c3dbb Add support for custom billing plans
This commit includes updates to the billing schema to allow for the creation of custom billing plans. These types of plans have no line items associated with them. Changes have also been made to properly handle the absence of primary line items in such plans.
2024-05-01 16:26:35 +07:00
giancarlo
2ff08a971d Update Zod package, improve code formatting, and add awaiting indicators
This commit includes three main changes. First, it updates the Zod library from version 3.23.4 to 3.23.5 across all relevant packages. Second, code readability has been enhanced by formatting modifications in several TypeScript files. Lastly, the user feedback on certain operations such as creating a team or charging for a payment is strengthened, by displaying an awaiting indicator until the operation is complete.
2024-04-30 13:16:51 +07:00
giancarlo
07deb28e12 1. Updated packages
2. Added comments to schema
3. Minor API updates
2024-04-27 14:39:28 +07:00
giancarlo
8d04624b1d Add queryUsage method to billing services
A new method, queryUsage, has been added to the billing strategy classes and the gateway service to offer usage querying capabilities for Stripe and Lemon Squeezy. QueryBillingUsageSchema has also been introduced in the schema-related changes. Changes also include updates to the functions' comment descriptions. A minor tweak was made to the Button and Link components in the `faq/page.tsx' file.
2024-04-25 11:34:47 +07:00
giancarlo
452e9e3567 Update dependencies and remove unused packages
This commit updates the versions of some dependencies, removes a few unused packages, and corrects the locations of some of the dependencies. Specific changes include version updates for '@tanstack/react-query-next-experimental', 'lucide-react', and 'supabase'. Furthermore, several unnecessary '@tanstack/react-table', 'next', 'tailwind-merge', and 'zod' dependencies were removed from various packages. The exact details of these changes can be obtained by comparing the changes in the 'pnpm-lock.yaml' file.
2024-04-24 19:58:03 +07:00
giancarlo
abd0771c4a Update package dependencies across modules
This commit addresses the update of various npm package dependencies across multiple modules. These updates include a version bump for lucide-react from 0.368.0 to 0.372.0 and rearrangement of "@types/react" and "@kit/monitoring-core" in the 'devDependencies' section for improved organization. These updates will ensure that we're using the most recent secure releases and enhance the project maintainability.
2024-04-24 09:03:46 +07:00
giancarlo
6814cc7089 Fix linting 2024-04-23 00:15:41 +08:00
giancarlo
70da6ef1fa Adjusted Per seat billing and added example to the sample schema 2024-04-22 22:48:02 +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
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
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
f58d2e364f Update UI elements and refine billing schema
Several changes were made to improve UI consistency across various components. Styling updates and enhancements were applied to elements including but not limited to, the SiteHeader, SiteNavigationItem, and ModeToggle components. Additionally, a refinement was made to the billing schema to enforce only having one per-seat and one flat line item per plan.
2024-04-19 00:04:37 +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
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
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
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
d078e0021c Add end-to-end tests for user and team billing features
This commit introduces end-to-end tests for the user and team billing features. It also enhances existing billing configurations, logging, and error handling mechanisms. Refactoring has been done to simplify the code and make it more readable. Adjustments have also been made in the visual aspects of some components. The addition of these tests will help ensure the reliability of the billing features.
2024-04-14 17:15:04 +08:00