Commit Graph

46 Commits

Author SHA1 Message Date
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
25abe83dfa Update README and .gitignore
Modified the README file to reflect the transition from development to a stable phase and removed the roadmap. Also, renamed `sidebar.config.ts` to `navigation.config.ts` for more clarity. Additionally, added `.zed` to `.gitignore` to prevent commit of unneeded files.
2024-05-08 01:25:33 +07:00
giancarlo
9eded69f15 Create Switch component and update dependencies in lock file
Introduce a new Switch component in the shadcn UI package to enhance user interface capabilities. Simultaneously, the pnpm-lock.yaml file's lockfileVersion has been updated from '6.0' to '9.0'. Also, several dependencies' versions within the file are updated to ensure compatibility and security improvements.
2024-04-30 13:42:06 +07:00
giancarlo
5606349627 Remove path environment variables
Paths such as SIGN_IN_PATH and SIGN_UP_PATH have been hardcoded into the application instead of being environment variables. These changes simplify the configuration of the application, making maintenance and understanding of the codebase easier.
2024-04-28 01:30:13 +07:00
giancarlo
448fee01c4 Add language priority feature flag
This commit adds a new 'languagePriority' key to the feature flags configuration. It determines whether to use user's preferred language or the application's default language. Adjustments to the language selection process according to new flag have been made in the 'createInstance' function in 'i18n.server.ts'. Additionally, updates have been made to 'README.md' and '.env' files to reflect these changes.
2024-04-23 22:51:45 +07:00
giancarlo
70da6ef1fa Adjusted Per seat billing and added example to the sample schema 2024-04-22 22:48:02 +08:00
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
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
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
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
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
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
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
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
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
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
giancarlo
46f02f66eb Updated README 2024-04-19 12:00:59 +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
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
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
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
473de45f19 Update Supabase server instructions and scripts
Updated README.md and scripts to separate the 'web application' and 'Supabase server' in the development process. Modified package.json to include specific scripts for starting, stopping, and generating the Supabase schema. Also adjusted GitHub workflow to start Supabase server before running the app and reduced retention of Playwright report artifacts from 30 to 7 days.
2024-04-11 17:01:27 +08:00
giancarlo
aa7237bfce Update README with Beta release completion
The project's README file has been updated to mark the completion of the Beta release phase. The roadmap section now accurately reflects the current status of the project, providing up-to-date information about the completed and pending milestones.
2024-04-07 12:54:02 +08:00
giancarlo
91811033f4 Update README with project roadmap and package details
This commit introduces checkbox formatting for project's roadmap dates in the README, enhancing readability and visibility. Also, new details about the '@kit/database-webhooks', '@kit/cms', '@kit/next' packages, and the CMS additions to the application are included to provide clearer understanding of project's structure and functionality.
2024-04-07 12:53:20 +08:00
giancarlo
24a68b2b1f Add Sentry and Baselime packages in the monitoring section
This commit introduces Sentry and Baselime packages into the monitoring section, complete with associated dependencies and scripts. These changes also reflect necessary updates to the 'pnpm-lock.yaml' file to account for these new dependencies.
2024-04-04 01:09:19 +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
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
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
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
cb8b23e8c0 Remove billing and checkout redirect buttons and related services
Deleted the billing-redirect-button, checkout-redirect-button, and embedded-stripe-checkout components. Additionally, removed the shadcn directory, which encompassed billing-related icons. This change streamlines the subscription settings interface and organizes the system's payment management. This update is a stepping stone towards improving the billing system's overall architecture.
2024-03-25 11:39:41 +08:00
giancarlo
78c704e54d Implement new billing-gateway and update related services
Created a new package named billing-gateway which implements interfaces for different billing providers and provides a centralized service for payments. This will potentially help to maintain cleaner code by reducing direct dependencies on specific payment providers in the core application code. Additionally, made adjustments in existing services, like Stripe, to comply with this change. The relevant interfaces and types have been exported and imported accordingly.
2024-03-24 20:54:12 +08:00
giancarlo
bce3479368 Cleanup 2024-03-24 02:23:22 +08:00
Turbobot
bb58169fe9 feat(create-turbo): create https://github.com/juliusmarminge/acme-corp 2024-03-21 13:41:16 +08:00