Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/Guide to deploy an app on vercel #270

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

clairekinde11
Copy link
Collaborator

@clairekinde11 clairekinde11 commented Nov 20, 2024

New topic and update from blog.
Blog can be removed from Kinde.com

Summary by CodeRabbit

  • New Features
    • Introduced a comprehensive guide for deploying applications on the Vercel platform, specifically for projects using Kinde authentication.
    • Included step-by-step instructions and visual aids to simplify the deployment process.
    • Provided additional resources for support, including contact information and community links.

New topic and update from blog.
Copy link
Contributor

coderabbitai bot commented Nov 20, 2024

Walkthrough

A new guide titled deploy-on-vercel.mdx has been added to the documentation for deploying applications on the Vercel platform, specifically for projects using Kinde authentication. The guide includes prerequisites, detailed steps for setting up a project, configuring environment variables, and integrating Kinde authentication. Visual aids enhance the clarity of the instructions, which conclude with additional resources for user support.

Changes

File Change Summary
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx Added a comprehensive guide for deploying applications on Vercel with Kinde authentication, including setup steps and visual aids.

Possibly related PRs

Suggested labels

sdk

Suggested reviewers

  • marcosmartini
  • coel

Poem

🐰 In the land of code where rabbits play,
A guide for Vercel has come our way!
With Kinde in hand, we hop and cheer,
Deploying our apps, the launch is near!
So gather 'round, let’s code and sing,
For every new feature, joy it will bring! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (3)

18-18: Fix Next.js framework spelling

The official spelling is "Next.js" rather than "NextJS".

-... such as the [NextJS starter kit]
+... such as the [Next.js starter kit]
🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


49-49: Consider highlighting the localhost URL update more prominently

The note about updating localhost:3000 URLs is crucial for successful deployment. Consider adding a warning or note block to make this more visible to users.

-10. In a later step, we will update the callback URLs that are pointing to [`localhost:3000`](http://localhost:3000), to get the authentication process to work.
+10. > ⚠️ **Important:** In the next step, you must update all callback URLs that are currently pointing to [`localhost:3000`](http://localhost:3000). This is crucial for the authentication process to work in production.

98-102: Enhance visibility of the build cache warning

The warning about not using build cache is crucial for successful deployment. Consider using a more prominent warning format.

-    <Aside>
-      
-    Do not select **Use existing Build Cache** as that will preserve the old environment variables
-    
-    </Aside>
+    <Aside type="warning">
+    ⚠️ Do not select **Use existing Build Cache** when redeploying, as it will preserve the old environment variables instead of using your updated values.
+    </Aside>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4794cc8 and c091f21.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


[style] ~25-~25: This phrasing can be overused. Try elevating your writing with a more formal alternative.
Context: ...o clone the repo to your GitHub account if you want.) 3. Enter a name for the new repositor...

(IF_YOU_WANT)


[style] ~37-~37: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...lect Import next to the project you want to deploy. 5. On the *Configure Project...

(REP_WANT_TO_VB)


[grammar] ~79-~79: Possible agreement error. The noun ‘menu’ seems to be countable.
Context: ...onment variable by selecting three dots menu, then selecting Edit. ![Upd...

(CD_NN)


[uncategorized] ~104-~104: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...our website will now be fully functional and you can authenticate with Kinde! ...

(COMMA_COMPOUND_SENTENCE)

🔇 Additional comments (2)
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (2)

1-8: LGTM! Frontmatter is well-structured.

The metadata is properly formatted and includes all necessary fields.


108-111: LGTM! Comprehensive support information.

The support section provides multiple channels for assistance and includes active community links.

Comment on lines 67 to 71
<Aside>

Tip: Use [wildcards in your callbacks](https://docs.kinde.com/get-started/connect/callback-urls/?r=search#wildcards-in-callback-urls) to circumvent Vercel’s

</aside>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Complete the wildcards documentation

The aside about using wildcards in callbacks is incomplete. It starts mentioning Vercel but doesn't complete the thought or provide the actual guidance.

Would you like me to help complete this section with proper documentation about using wildcards with Vercel preview deployments?


Tip: Use [wildcards in your callbacks](https://docs.kinde.com/get-started/connect/callback-urls/?r=search#wildcards-in-callback-urls) to circumvent Vercel’s

</aside>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clairekinde11 the lowercase </aside> is breaking the build here.

Fixed Aside
Removed ambiguous note
Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2024

Deploying kinde-docs-previews with  Cloudflare Pages  Cloudflare Pages

Latest commit: ed08df9
Status: ✅  Deploy successful!
Preview URL: https://14a01915.kinde-docs-previews.pages.dev
Branch Preview URL: https://feat-kinde-and-vercel-guide.kinde-docs-previews.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (6)
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (6)

18-18: Update framework spelling to "Next.js"

The official spelling of the framework is "Next.js" rather than "NextJS".

-... such as the [NextJS starter kit]
+... such as the [Next.js starter kit]
🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


16-18: Consider adding free tier information

It would be helpful to mention any limitations or restrictions of the free tiers for both Vercel and GitHub accounts, as this could affect users' deployment choices.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


27-27: Add context about the .env file's purpose

Consider explaining why the .env.local.sample file is important and what kind of configuration it contains. This helps users understand its significance in the deployment process.


78-86: Clarify environment variable structure

Consider enhancing this section by:

  • Using a table or list format to show the mapping between Kinde and Vercel variables
  • Including example values (with sensitive data redacted)
  • Explaining the format requirements for URLs (e.g., must include https://)

89-91: Add information about deployment branches

Consider adding information about:

  • How these changes affect different deployment branches (production/preview)
  • Whether users need to redeploy all branches
  • How to verify the changes took effect

102-103: Fix grammatical issues in the support section

Apply these grammatical corrections:

-Remember, if you need any assistance with getting Kinde connected reach out to
+Remember, if you need any assistance with getting Kinde connected, reach out to
🧰 Tools
🪛 LanguageTool

[uncategorized] ~102-~102: Possible missing comma found.
Context: ... need any assistance with getting Kinde connected reach out to [[email protected]](mailto...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c091f21 and 4406ba2.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


[style] ~25-~25: This phrasing can be overused. Try elevating your writing with a more formal alternative.
Context: ...o clone the repo to your GitHub account if you want.) 3. Enter a name for the new repositor...

(IF_YOU_WANT)


[style] ~37-~37: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...lect Import next to the project you want to deploy. 5. On the *Configure Project...

(REP_WANT_TO_VB)


[grammar] ~73-~73: Possible agreement error. The noun ‘menu’ seems to be countable.
Context: ...onment variable by selecting three dots menu, then selecting Edit. ![Upd...

(CD_NN)


[uncategorized] ~98-~98: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...our website will now be fully functional and you can authenticate with Kinde! ...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~102-~102: Possible missing comma found.
Context: ... need any assistance with getting Kinde connected reach out to [[email protected]](mailto...

(AI_HYDRA_LEO_MISSING_COMMA)

Comment on lines +42 to +44
6. Open the local `.env` file from your project and copy all the contents.
7. Paste the details into the **Environment Variables** section in Vercel. Vercel will autofill your keys and values for you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add security warning about environment variables

Consider adding a security note about handling sensitive environment variables:

  • Warn users not to commit the .env file to version control
  • Emphasize the importance of keeping the Client Secret secure
  • Mention that environment variables in Vercel are encrypted at rest

Comment on lines 61 to 63
6. Scroll to the **Callback URLs** section. This is where you enter the Vercel domain details from the previous step.
7. Your domain details will be something like `<NAME_OF_YOUR_PROJECT>.vercel.app`, for example `https://vercel-nextjs-kinde.vercel.app`. Enter this in the **Application homepage URI** field, the **Application login URI** field, and the **Allowed logout redirect URLs** field.
8. If you were using `https://localhost:3000`, replace that portion with your new domain in the **Allowed callback URLs** field. If you're using a starter kit, this might be: `https://vercel-nextjs-kinde.vercel.app/dashboard`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add information about preview deployment URLs

The callback URL configuration should include information about handling Vercel preview deployments:

  • Mention that Vercel creates unique URLs for preview deployments (e.g., pr-123-project-name.vercel.app)
  • Explain how to use wildcards in callback URLs to support preview deployments
  • Add a note about security considerations when using wildcards

A few minor updates for clarity
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (4)

18-18: Update framework spelling to "Next.js"

The official spelling of the framework is "Next.js" rather than "NextJS".

-... OR a starter kit such as the [NextJS starter kit]
+... OR a starter kit such as the [Next.js starter kit]
🧰 Tools
🪛 LanguageTool

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


27-27: Add context about the environment file's purpose

Consider adding a brief note explaining that this file contains template environment variables that will be needed for the Vercel deployment.

-4. Open the directory of the new repo and find the file called **`.env.local.sample`**. You will need this later.
+4. Open the directory of the new repo and find the file called **`.env.local.sample`**. This file contains template environment variables that you'll need to configure in Vercel later.

77-84: Improve environment variables organization

Consider grouping the variables in a more structured format using a table or bullet points with descriptions for each variable.

For example:

-5. Change the variables as follows, using Kinde values:
-    - KINDE_CLIENT_ID
-    - KINDE_CLIENT_SECRET
-    - KINDE_ISSUER_URL (Domain in Kinde)
-6. Change the variables as follows, using Vercel values:
-    - KINDE_SITE_URL
-    - KINDE_POST_LOGOUT_REDIRECT_URL
-    - KINDE_POST_LOGIN_REDIRECT_URL
+5. Update the following environment variables:
+
+   **Kinde Authentication Variables:**
+   | Variable | Description | Source |
+   |----------|-------------|--------|
+   | KINDE_CLIENT_ID | Your application's client ID | Kinde App Keys |
+   | KINDE_CLIENT_SECRET | Your application's client secret | Kinde App Keys |
+   | KINDE_ISSUER_URL | Your Kinde domain URL | Kinde Domain |
+
+   **Vercel Deployment Variables:**
+   | Variable | Description | Value |
+   |----------|-------------|-------|
+   | KINDE_SITE_URL | Your Vercel deployment URL | Your Vercel URL |
+   | KINDE_POST_LOGOUT_REDIRECT_URL | URL to redirect after logout | Your Vercel URL |
+   | KINDE_POST_LOGIN_REDIRECT_URL | URL to redirect after login | Your Vercel URL/dashboard |

91-95: Fix Aside element formatting

The Aside element has inconsistent spacing and formatting.

-    <Aside>
-      
-    Do not select **Use existing Build Cache** as that will preserve the old environment variables
-    
-    </Aside>
+<Aside>
+  Do not select **Use existing Build Cache** as that will preserve the old environment variables
+</Aside>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4406ba2 and ed08df9.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx

[uncategorized] ~18-~18: The official spelling of this programming framework is “Next.js”.
Context: ...ses Kinde OR a starter kit such as the [NextJS starter kit](https://github.com/kinde-s...

(NODE_JS)


[style] ~25-~25: This phrasing can be overused. Try elevating your writing with a more formal alternative.
Context: ...o clone the repo to your GitHub account if you want.) 3. Enter a name for the new repositor...

(IF_YOU_WANT)


[style] ~37-~37: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...lect Import next to the project you want to deploy. 5. On the *Configure Project...

(REP_WANT_TO_VB)


[grammar] ~72-~72: Possible agreement error. The noun ‘menu’ seems to be countable.
Context: ...onment variable by selecting three dots menu, then selecting Edit. ![Upd...

(CD_NN)


[uncategorized] ~97-~97: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...our website will now be fully functional and you can authenticate with Kinde! ...

(COMMA_COMPOUND_SENTENCE)

🔇 Additional comments (2)
src/content/docs/developer-tools/guides/deploy-on-vercel.mdx (2)

42-44: Add security warning for environment variables

The past review comment about security warnings for environment variables is still valid. Please add a security note about:

  • Not committing .env files to version control
  • Keeping Client Secret secure
  • Vercel's encryption of environment variables

60-62: Add guidance for preview deployments

The past review comment about handling preview deployments is still valid. Please add information about:

  • Vercel's preview deployment URLs
  • Using wildcards in callback URLs
  • Security considerations for wildcards

@marcosmartini marcosmartini marked this pull request as draft November 27, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants