Skip to content

Docs v2#168

Merged
amalshaji merged 4 commits intomainfrom
revamp-docs
Jul 27, 2025
Merged

Docs v2#168
amalshaji merged 4 commits intomainfrom
revamp-docs

Conversation

@amalshaji
Copy link
Owner

@amalshaji amalshaji commented Jul 27, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new documentation site with a modern interface, including a searchable knowledge base, dynamic Open Graph image generation, and enhanced SEO metadata.
    • Added interactive components such as animated terminal demos and sparkles text for engaging user experience.
    • Implemented structured data for improved search engine visibility.
    • Provided a comprehensive site-wide navigation, global theming (light/dark mode), and responsive layouts.
    • Added API endpoints for search and Open Graph image generation.
  • Documentation

    • Added extensive user and developer guides covering getting started, client/server setup, local development, cloud integrations, and troubleshooting.
    • Included detailed usage instructions, code examples, and visual walkthroughs for all major features.
    • Provided metadata and structure for organized navigation and search.
    • Documented configuration and deployment instructions for server and client components.
  • Chores

    • Added configuration files for project setup, build tools, TypeScript, Tailwind CSS, and web manifest.
    • Updated robots.txt and sitemap for optimized search engine indexing.
    • Added project metadata and dependency management files.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 27, 2025

Warning

Rate limit exceeded

@amalshaji has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1054fd7 and 1f54c73.

📒 Files selected for processing (1)
  • docs-v2/content/docs/resources/route53.mdx (1 hunks)

Walkthrough

This change introduces a new documentation site for the "Portr" project under the docs-v2 directory. It includes a Next.js application setup, extensive documentation content, custom React components, configuration files, global styles, and supporting metadata. The documentation covers client, server, local development, resources, and provides interactive UI features.

Changes

Cohort / Files Change Summary
Project Setup & Configuration
docs-v2/package.json, tsconfig.json, next.config.mjs, postcss.config.mjs, components.json, .gitignore, README.md
Adds project metadata, TypeScript, Next.js, PostCSS, and Fumadocs UI/MDX configuration files, along with initial ignore rules and project documentation.
Public Assets & Metadata
public/manifest.json, public/robots.txt, public/README-icons.md
Introduces web app manifest, robots.txt for crawler directives, and icon requirements documentation.
Global Styles
app/global.css
Adds global CSS with Tailwind, theme variables, and dark mode support.
App Layout & Root Config
app/layout.tsx, app/layout.config.tsx
Implements root layout component, shared layout options, and site-wide metadata.
Home Page
app/(home)/layout.tsx, app/(home)/page.tsx
Adds home page layout and a feature-rich landing page with interactive components and SEO metadata.
Docs Section Layout & Routing
app/docs/layout.tsx, app/docs/[[...slug]]/page.tsx, app/docs-og/[...slug]/route.tsx
Implements documentation layout, dynamic doc page rendering with MDX, metadata generation, and dynamic Open Graph image API.
API & Utility Endpoints
app/api/search/route.ts, app/og-image/route.tsx, app/sitemap.ts
Adds search API, OG image generator, and dynamic sitemap endpoint.
MDX & Content Source Utilities
lib/source.ts, mdx-components.tsx, lib/utils.ts, source.config.ts
Sets up documentation source loader, MDX component merging, utility functions, and extended frontmatter schema.
UI Components
components/magicui/sparkles-text.tsx, components/magicui/terminal.tsx, components/ui/logo.tsx, components/structured-data.tsx
Adds reusable React components for sparkles text, terminal emulation, logo SVG, and structured data (JSON-LD).
Documentation Content
content/docs/**, content/docs/client/**, content/docs/server/**, content/docs/local-development/**, content/docs/resources/**
Introduces comprehensive documentation for client, server, local development, resources, and guides, including MDX and JSON metadata files.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NextApp
    participant DocsSource
    participant MDXRenderer
    participant API

    User->>NextApp: Accesses /docs/[...slug]
    NextApp->>DocsSource: Fetch page data by slug
    DocsSource-->>NextApp: Return page content & metadata
    NextApp->>MDXRenderer: Render MDX with custom components
    MDXRenderer-->>NextApp: Rendered HTML
    NextApp-->>User: Serve documentation page

    User->>API: GET /api/search?query=...
    API->>DocsSource: Search docs with query
    DocsSource-->>API: Search results
    API-->>User: Return results

    User->>API: GET /docs-og/[...slug]/image.png
    API->>DocsSource: Fetch page metadata
    DocsSource-->>API: Page title, description
    API-->>User: Return OG image
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Update install command #162: Updates client installation documentation to add a new install script method, directly relating to the new client installation content added in this PR.

Poem

🐇✨
A warren of docs, now shiny and new,
With sparkles and tunnels and guides to pursue.
From client to server, each page is a treat,
With layouts and logos and MDX neat.
So hop in and browse—Portr’s docs can’t be beat!
✨📚

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revamp-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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: 13

♻️ Duplicate comments (1)
docs-v2/content/docs/local-development/admin.mdx (1)

73-73: Admin server advertises port 8000 – duplicate of client-side port mismatch issue
See earlier comment in portr-client.mdx; ensure both docs reference the same port.

🧹 Nitpick comments (47)
docs-v2/public/README-icons.md (1)

1-13: README is helpful – add a quick-check script link

Nice touch documenting the missing assets. Consider adding a one-liner for contributors to verify the files exist, e.g.:

fd -p favicon.ico icon.svg apple-touch-icon.png icon-192.png icon-512.png og-image.png public/
docs-v2/app/global.css (2)

46-94: OKLCH only – consider sRGB fallback

OKLCH is great but not yet fully supported in Safari ≤ 15 / older Chromium. Providing an sRGB fallback (color-mix, or duplicated vars using hex) will prevent washed-out colours.


145-152: Utility application to * may affect performance

Applying border-border & outline-ring/50 to every element increases DOM paint cost, especially on large MDX pages. Evaluate whether focusing these utilities on components instead of the universal selector would be adequate.

docs-v2/content/docs/client/meta.json (1)

3-10: Confirm client page ordering is intentional

The order of entries dictates sidebar order. If alphabetical order is desired for consistency with other sections, consider sorting or adding a comment to explain the chosen sequence.

docs-v2/public/robots.txt (1)

2-14: Ordering of Allow/Disallow directives may confuse legacy crawlers

Although major crawlers follow the “longest match wins” rule, some older or less common bots apply first-match precedence. Placing the specific Disallow lines before the global Allow: / directive avoids ambiguity.

-User-agent: *
-Allow: /
-
-# Disallow Open Graph image generation during crawling (they're generated on-demand)
-Disallow: /docs-og/
-Disallow: /og-image
+User-agent: *
+# Disallow Open Graph image generation during crawling (they're generated on-demand)
+Disallow: /docs-og/
+Disallow: /og-image
+Allow: /
docs-v2/app/api/search/route.ts (1)

4-7: Consider opting-in to the Edge runtime for lower-latency search.
The handler performs read-only work and does not require Node-only APIs. Declaring the Edge runtime brings the function closer to users and can noticeably reduce TTFB for search queries.

+// Run on the Edge for lower latency
+export const runtime = 'edge';
 export const { GET } = createFromSource(source, {
   // https://docs.orama.com/open-source/supported-languages
   language: 'english',
 });
docs-v2/app/layout.config.tsx (1)

12-27: Minor accessibility nit – wrap the logo + text in a <span> with role="img" or provide aria-label.
The SVG already carries aria-label, but once it’s combined with text inside the nav title, assistive tech may read the elements separately. A simple wrapper guarantees a single, coherent announcement.

-    title: (
-      <>
-        <Logo width={24} height={24} />
-        Portr
-      </>
-    ),
+    title: (
+      <span aria-label="Portr" className="inline-flex items-center gap-2">
+        <Logo width={24} height={24} />
+        Portr
+      </span>
+    ),
docs-v2/content/docs/resources/index.mdx (1)

12-16: Optional: mark external DNS guide as “beta” / “community”
If Route 53 support is still experimental, consider surfacing that status in the card subtitle to set user expectations.

docs-v2/README.md (1)

25-30: Add link to Tailwind config & global CSS
Listing tailwind.config.mjs and app/global.css alongside routes would help first-time contributors navigate the styling setup faster.

docs-v2/app/og-image/route.tsx (2)

1-3: Expose route as Edge runtime for faster OG generation
OG images are latency-sensitive. Running on the Edge short-circuits the Node.js boot time and cold-start.

+export const runtime = "edge";

This is a no-op in local dev, but Vercel/Netlify will auto-deploy it to the Edge network.


4-10: Consider caching headers to avoid regenerating the same image
generateOGImage is pure for identical params. Setting Cache-Control: public, max-age=86400, immutable (or similar) cuts render costs.

-  return generateOGImage({
+  return generateOGImage({
     title: "Portr",
@@
     primaryColor: "rgb(71, 85, 105)", // slate-600
   });

generateOGImage accepts a headers option; otherwise wrap its response and append headers.

docs-v2/components.json (2)

6-12: Specify explicit Tailwind config to prevent tooling confusion
"config": "" means “auto-find”, which some IDE plugins treat as “not configured”, leading to false warnings. Point to the generated file:

-    "config": "",
+    "config": "tailwind.config.mjs",

13-19: Alias overlap may introduce circular import mistakes
You have both "lib" (@/lib) and "utils" (@/lib/utils). Developers sometimes import { foo } from "lib/utils" instead of "utils" or vice-versa, causing duplicate bundles under different paths. Consider dropping "utils" and import via "lib/utils" everywhere, or vice-versa, for consistency.

docs-v2/components/structured-data.tsx (2)

41-48: dangerouslySetInnerHTML is expected here – silence or scope the lint rule

Using dangerouslySetInnerHTML to embed JSON-LD is the recommended / canonical approach in React. The Biome rule noDangerouslySetInnerHtml is therefore a false positive in this context.

Add a targeted rule disable instead of suppressing project-wide:

+// biome-ignore lint/security/noDangerouslySetInnerHtml – embedding JSON-LD requires it
 <script
   type="application/ld+json"
   dangerouslySetInnerHTML={{
     __html: JSON.stringify(organizationData),
   }}
 />

Repeat for the second block.


31-34: Validate hard-coded rating data

aggregateRating contains fabricated values (4.8, 172). Search engines may flag inaccurate or unverifiable ratings as spam. Either source these numbers from real data or omit the field.

docs-v2/content/docs/client/installation.mdx (1)

6-8: Remove unused import Steps to avoid MDX/TypeScript warnings

Steps is imported but never referenced. MDX compilation can surface this as an error in strict build pipelines.

-import { Steps } from 'fumadocs-ui/components/steps';
 import { Callout } from 'fumadocs-ui/components/callout';
docs-v2/app/sitemap.ts (1)

16-20: Potential duplicate /docs entry in sitemap

/docs is listed as a static page and may also be produced by source.getPages() (often the page with slug []). Duplicate URLs can confuse crawlers. Consider filtering one of them out.

docs-v2/next.config.mjs (1)

25-27: X-XSS-Protection is obsolete

Modern browsers ignore this header and rely on CSP. You can safely drop it to reduce header bloat unless you have legacy browser requirements.

docs-v2/package.json (1)

5-10: Add lint / type-check scripts for CI parity

The project relies on TypeScript strict mode but lacks type-check, lint, or format scripts. CI feedback will be slower and less consistent.
Recommend adding:

"scripts": {
   "build": "next build",
   "dev": "next dev --turbo",
   "start": "next start",
   "mdx": "fumadocs-mdx",
+  "type-check": "tsc --noEmit",
+  "lint": "next lint"
 },
docs-v2/content/docs/client/http-tunnel.mdx (1)

3-3: Capitalize protocol acronym for consistency

MDX description uses lowercase “http”. For consistency with the title and other pages, capitalize to “HTTP”.

-description: Learn how to start a http tunnel using portr
+description: Learn how to start an HTTP tunnel using Portr
docs-v2/source.config.ts (1)

10-18: lastModified should be a date to aid sitemap / SEO tooling

Storing lastModified as a plain string makes automated consumers guess the format. Switch to an ISO-8601-validated z.string().datetime() or z.date().

-  lastModified: z.string().optional(),
+  lastModified: z.string().datetime().optional(),
docs-v2/tsconfig.json (1)

18-21: Alias @/.source is fragile and uncommon

The leading dot folder and embedded slash make import paths verbose and error-prone. Unless .source/ is generated code, prefer a conventional alias such as @/lib or remove the mapping:

-      "@/.source": ["./.source/index.ts"],
+      "@/lib": ["./lib/index.ts"],

Update corresponding imports to match.

docs-v2/app/docs-og/[...slug]/route.tsx (1)

18-19: Consider making colors configurable.

The primary and secondary colors are hardcoded. Consider extracting these to a configuration file or environment variables to maintain consistency with the theme system used elsewhere in the application.

- primaryTextColor: "rgb(0, 0, 0)",
- primaryColor: "rgb(71, 85, 105)", // slate-600
+ primaryTextColor: process.env.OG_PRIMARY_TEXT_COLOR || "rgb(0, 0, 0)",
+ primaryColor: process.env.OG_PRIMARY_COLOR || "rgb(71, 85, 105)",
docs-v2/components/ui/logo.tsx (1)

44-181: Consider SVG optimization and maintainability.

The SVG is quite complex with many paths and gradients. Consider these improvements:

  1. Performance: The large SVG with multiple gradients might impact rendering performance
  2. Maintainability: Complex path data is hard to modify or maintain
  3. Accessibility: Consider adding more descriptive aria attributes
+ // Consider extracting complex SVG to a separate file or using an icon library
+ // For better maintainability, consider:
+ // 1. Using SVG sprites
+ // 2. Simplifying the design
+ // 3. Adding role="img" for better accessibility
  <svg
    xmlns="http://www.w3.org/2000/svg"
    xmlnsXlink="http://www.w3.org/1999/xlink"
    viewBox="213.17 215.8 597.87 593.21"
    width={width}
    height={height}
    className={className}
+   role="img"
    aria-label="Portr Logo"
docs-v2/content/docs/server/github-oauth-app.mdx (4)

6-8: Unused import Steps – remove to avoid build warnings
Steps is imported but never referenced in this page. Unused imports can trigger ESLint / MDX-bundler warnings during the static build.

-import { Steps } from 'fumadocs-ui/components/steps';
 import { Callout } from 'fumadocs-ui/components/callout';

9-13: Minor wording tweak for clarity
“email-password based login” → “email-password-based login” reads more naturally.


41-46: Highlight secret-management best practice
Consider adding a short note that .env should never be committed to version control to prevent accidental leakage of CLIENT_SECRET.


64-66: Accessibility & UX – add explicit link text
Screen-reader users benefit from descriptive link text instead of “this”/“here”. Consider replacing “the one configured in your GitHub OAuth app” with an inline code block or explicit URL.

docs-v2/content/docs/index.mdx (3)

31-33: Split-infinitive flagged – optional copyedit
Static analysis suggests moving “quickly” → “See how to create a tunnel quickly and inspect …”. Improves flow but purely stylistic.


33-42: Consider adding loading="lazy" to iframes
Lazy-loading the YouTube embeds defers network cost and improves initial page performance and Core Web Vitals.

-<iframe 
+<iframe loading="lazy"

61-80: Consistent casing of protocol names
Elsewhere the docs use upper-case “HTTP/TCP/WebSocket”. Cards 68-70 mix lower/upper. Normalise for professionalism & search consistency.

docs-v2/content/docs/getting-started.mdx (1)

13-16: Capitalise protocol acronyms for consistency
Use “HTTP, TCP, or WebSocket” instead of lower-case variants to match other pages.

docs-v2/content/docs/client/templates.mdx (1)

87-89: Optional: clarify where portr --help should be executed
Adding “on your local machine” avoids confusion for new users.

docs-v2/content/docs/client/websocket-tunnel.mdx (2)

20-24: Numbered list items should end with periods for consistency
Minor style fix—add trailing periods to each step.


45-48: Remove trailing double space
Line 47 ends with two spaces causing a hard line break in rendered Markdown; unnecessary here.

docs-v2/app/(home)/page.tsx (2)

111-132: Consider making the Hacker News score dynamic or removing the specific number.

The hardcoded score "172 ↑" will become outdated over time. Consider either fetching the current score dynamically or removing the specific number to show just "Hacker News".

-              Hacker News • 172 ↑
+              Hacker News

295-304: Consider adding lazy loading to YouTube video embeds for better performance.

The video embeds could benefit from lazy loading to improve initial page load performance.

                <iframe
                  width="100%"
                  height="100%"
                  src="https://www.youtube.com/embed/_4tipDzuoSs"
                  title="Portr Inspector Demo"
                  frameBorder="0"
                  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
                  allowFullScreen
+                 loading="lazy"
                  className="rounded-lg"
                />

Also applies to: 317-326

docs-v2/components/magicui/sparkles-text.tsx (1)

96-129: Consider performance optimization for the sparkle update interval.

The current implementation runs an interval every 100ms to update sparkle lifespans. For better performance, consider using requestAnimationFrame or increasing the interval duration.

    initializeStars();
-   const interval = setInterval(updateStars, 100);
+   const interval = setInterval(updateStars, 200); // Reduce frequency
docs-v2/content/docs/server/start-the-tunnel-server.mdx (2)

55-57: Enhance encryption key generation guidance.

The current Python command is good but could be improved with better error handling and alternative methods.

Consider providing multiple options for key generation:

# Python method
python -c "import base64, os; print(base64.urlsafe_b64encode(os.urandom(32)).decode())"

+# Alternative: OpenSSL method
+openssl rand -base64 32

+# Alternative: Node.js method  
+node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"

119-124: Use placeholder domains consistently.

The troubleshooting section mixes your-domain.com with example.com used elsewhere in the file.

-# Check if port 2222 is accessible
-telnet your-domain.com 2222
+telnet example.com 2222

-# Check if HTTP/HTTPS ports are working
-curl https://your-domain.com
+curl https://example.com
docs-v2/content/docs/local-development/tunnel-server.mdx (2)

128-131: Standardize environment variable format.

The Go code block shows inconsistent environment variable format. Go applications typically use uppercase with underscores.

-// In your .env or config
-LOG_LEVEL=debug
+# In your .env file
+LOG_LEVEL=debug

136-138: Improve log filtering command.

The grep pattern could be more specific and the command could be more robust.

-# Follow server logs
-make runserver | grep -E "(ERROR|WARN|DEBUG)"
+# Follow server logs with timestamps
+make runserver 2>&1 | grep -E "(ERROR|WARN|DEBUG|INFO)" --line-buffered
docs-v2/components/magicui/terminal.tsx (1)

68-76: Consider performance optimization for long text.

For very long text content, the character-by-character animation might cause frequent re-renders.

Consider adding a performance optimization for long text:

  useEffect(() => {
    if (!started) return;

    let i = 0;
+   const batchSize = children.length > 100 ? 3 : 1; // Batch characters for long text
    const typingEffect = setInterval(() => {
      if (i < children.length) {
-       setDisplayedText(children.substring(0, i + 1));
-       i++;
+       const nextIndex = Math.min(i + batchSize, children.length);
+       setDisplayedText(children.substring(0, nextIndex));
+       i = nextIndex;
      } else {
        clearInterval(typingEffect);
      }
    }, duration);
docs-v2/content/docs/local-development/portr-client.mdx (2)

2-3: Use “set up” (verb) instead of “setup” (noun) in the description

Grammatically the verb form is required here:
description: Learn how to set up portr client for local development


70-72: Tautology: “CLI interface” → just “CLI”

The “I” already stands for interface.

- **CLI interface**: Command-line tool for creating tunnels
+ **CLI**: Command-line tool for creating tunnels
docs-v2/content/docs/local-development/admin.mdx (2)

2-3: Use “set up” (verb) instead of “setup” (noun) in the description

description: Learn how to set up portr admin for local development


22-30: Make target names duplicate those in the client guide – clarify scope

make installclient / make runclient are also used by the client component. Consider prefixing with admin- or noting that the targets are context-sensitive to avoid developer confusion when multiple Makefiles exist.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 495024b and f7e0f7e.

⛔ Files ignored due to path filters (7)
  • docs-v2/bun.lock is excluded by !**/*.lock
  • docs-v2/public/apple-touch-icon.svg is excluded by !**/*.svg
  • docs-v2/public/favicon.ico is excluded by !**/*.ico
  • docs-v2/public/icon-192.svg is excluded by !**/*.svg
  • docs-v2/public/icon-512.svg is excluded by !**/*.svg
  • docs-v2/public/icon.svg is excluded by !**/*.svg
  • docs-v2/public/logo.svg is excluded by !**/*.svg
📒 Files selected for processing (52)
  • docs-v2/.gitignore (1 hunks)
  • docs-v2/README.md (1 hunks)
  • docs-v2/app/(home)/layout.tsx (1 hunks)
  • docs-v2/app/(home)/page.tsx (1 hunks)
  • docs-v2/app/api/search/route.ts (1 hunks)
  • docs-v2/app/docs-og/[...slug]/route.tsx (1 hunks)
  • docs-v2/app/docs/[[...slug]]/page.tsx (1 hunks)
  • docs-v2/app/docs/layout.tsx (1 hunks)
  • docs-v2/app/global.css (1 hunks)
  • docs-v2/app/layout.config.tsx (1 hunks)
  • docs-v2/app/layout.tsx (1 hunks)
  • docs-v2/app/og-image/route.tsx (1 hunks)
  • docs-v2/app/sitemap.ts (1 hunks)
  • docs-v2/components.json (1 hunks)
  • docs-v2/components/magicui/sparkles-text.tsx (1 hunks)
  • docs-v2/components/magicui/terminal.tsx (1 hunks)
  • docs-v2/components/structured-data.tsx (1 hunks)
  • docs-v2/components/ui/logo.tsx (1 hunks)
  • docs-v2/content/docs/client/http-tunnel.mdx (1 hunks)
  • docs-v2/content/docs/client/index.mdx (1 hunks)
  • docs-v2/content/docs/client/installation.mdx (1 hunks)
  • docs-v2/content/docs/client/meta.json (1 hunks)
  • docs-v2/content/docs/client/tcp-tunnel.mdx (1 hunks)
  • docs-v2/content/docs/client/templates.mdx (1 hunks)
  • docs-v2/content/docs/client/websocket-tunnel.mdx (1 hunks)
  • docs-v2/content/docs/getting-started.mdx (1 hunks)
  • docs-v2/content/docs/index.mdx (1 hunks)
  • docs-v2/content/docs/local-development/admin.mdx (1 hunks)
  • docs-v2/content/docs/local-development/index.mdx (1 hunks)
  • docs-v2/content/docs/local-development/meta.json (1 hunks)
  • docs-v2/content/docs/local-development/portr-client.mdx (1 hunks)
  • docs-v2/content/docs/local-development/tunnel-server.mdx (1 hunks)
  • docs-v2/content/docs/meta.json (1 hunks)
  • docs-v2/content/docs/resources/index.mdx (1 hunks)
  • docs-v2/content/docs/resources/meta.json (1 hunks)
  • docs-v2/content/docs/resources/route53.mdx (1 hunks)
  • docs-v2/content/docs/server/cloudflare-api-token.mdx (1 hunks)
  • docs-v2/content/docs/server/github-oauth-app.mdx (1 hunks)
  • docs-v2/content/docs/server/index.mdx (1 hunks)
  • docs-v2/content/docs/server/meta.json (1 hunks)
  • docs-v2/content/docs/server/start-the-tunnel-server.mdx (1 hunks)
  • docs-v2/lib/source.ts (1 hunks)
  • docs-v2/lib/utils.ts (1 hunks)
  • docs-v2/mdx-components.tsx (1 hunks)
  • docs-v2/next.config.mjs (1 hunks)
  • docs-v2/package.json (1 hunks)
  • docs-v2/postcss.config.mjs (1 hunks)
  • docs-v2/public/README-icons.md (1 hunks)
  • docs-v2/public/manifest.json (1 hunks)
  • docs-v2/public/robots.txt (1 hunks)
  • docs-v2/source.config.ts (1 hunks)
  • docs-v2/tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
docs-v2/app/layout.config.tsx (1)
docs-v2/components/ui/logo.tsx (1)
  • Logo (9-183)
docs-v2/app/(home)/page.tsx (1)
docs-v2/components/ui/logo.tsx (1)
  • Logo (9-183)
🪛 LanguageTool
docs-v2/content/docs/index.mdx

[style] ~31-~31: Try moving the adverb to make the sentence clearer.
Context: ... Inspector - Request Debugging See how to quickly create a tunnel and inspect HTTP requests using the bui...

(SPLIT_INFINITIVE)

docs-v2/content/docs/local-development/portr-client.mdx

[style] ~72-~72: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...hitecture The client consists of: - CLI interface: Command-line tool for creating tunne...

(ACRONYM_TAUTOLOGY)

docs-v2/content/docs/resources/route53.mdx

[grammar] ~109-~109: Ensure spelling is correct
Context: .... ## DNS Configuration Make sure your Route53 hosted zone has the required DNS record...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 Gitleaks (8.27.2)
docs-v2/content/docs/server/cloudflare-api-token.mdx

89-90: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)

🪛 Biome (2.1.2)
docs-v2/components/structured-data.tsx

[error] 41-41: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)


[error] 47-47: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

🔇 Additional comments (45)
docs-v2/app/global.css (2)

1-5: Possible typo in third-party import

The library is published as tw-animate; the string "tw-animate-css" will 404 at build.

-@import "tw-animate-css";
+@import "tw-animate";

6-7: Custom variant requires plugin support

@custom-variant is only recognised when postcss-extend-rule or a similar plugin is present. Confirm the PostCSS plugin stack contains one that handles this directive, otherwise Tailwind will ignore the variant.

docs-v2/content/docs/local-development/meta.json (1)

1-4: Local Development meta.json pages match MDX files
All entries in docs-v2/content/docs/local-development/meta.json (“index”, “admin”, “tunnel-server”, “portr-client”) correspond exactly to the MDX files present. No missing or extra slugs—no changes needed.

docs-v2/content/docs/resources/meta.json (1)

1-4: Looks good

The metadata format aligns with other sections.

docs-v2/lib/utils.ts (1)

4-6: clsx is fed an array, not variadic arguments

clsx expects variadic arguments (clsx(...args)), but the code is passing a single array (clsx(inputs)), resulting in the entire array stringified as one class. Tailwind merging will therefore never occur across individual class tokens.

-export function cn(...inputs: ClassValue[]) {
-  return twMerge(clsx(inputs))
+export function cn(...inputs: ClassValue[]) {
+  return twMerge(clsx(...inputs))
 }

Likely an incorrect or invalid review comment.

docs-v2/content/docs/server/meta.json (1)

3-8: Ensure server docs are present

Run the same slug-to-file check for the server section to avoid broken sidebar links.
(See previous comment for a reusable script.)

docs-v2/mdx-components.tsx (1)

5-9: Good use of spread order to let local components override defaults.
The custom spread order ensures caller-supplied components win over the defaults, which is the expected ergonomics. No issues here.

docs-v2/lib/source.ts (2)

5-9: Double-check baseUrl: '/docs' – may create a /docs/docs/... route.
Since the Next.js route already lives under app/docs/[[...slug]], adding the same prefix in baseUrl can duplicate the segment when helpers build URLs. Make sure generated links look like /docs/intro rather than /docs/docs/intro.


1-1: Verify the @/.source import path – it’s likely incorrect
I wasn’t able to find any files named .source.ts or .source.js in the repo. With a paths mapping like

{ "@/*": ["docs-v2/*"] }

@/.source resolves to docs-v2/.source.ts, which doesn’t exist and will break the build.

• If you intended to import the source.ts next to this file (docs-v2/lib/source.ts), use a relative path:

import { docs } from './source';

• If the module lives elsewhere (e.g. docs-v2/data/source.ts), adjust to:

import { docs } from '@/data/source';

Please verify where the actual source module lives and update the import accordingly.

docs-v2/app/(home)/layout.tsx (1)

3-3: Confirm that the path alias @/app/layout.config resolves inside docs-v2.
If @ maps to the repository root, the resolver will look for app/layout.config.tsx at the project root, not under docs-v2/app. Ensure the tsconfig/vite alias is {"@/*": ["docs-v2/*"]} or update the import to ../layout.config.

docs-v2/content/docs/resources/index.mdx (1)

6-6: Confirm fumadocs-ui/components/card import path across documentation
Before publishing, please verify that your installed version of fumadocs-ui still exports Card and Cards from components/card. If you encounter a “module not found” error at runtime, update all occurrences to the correct public path (for example, import { Card, Cards } from 'fumadocs-ui/card';).

Affected files:

  • docs-v2/content/docs/client/index.mdx:6
  • docs-v2/content/docs/resources/index.mdx:6
  • docs-v2/content/docs/server/index.mdx:6
  • docs-v2/content/docs/index.mdx:10
  • docs-v2/content/docs/getting-started.mdx:10
  • docs-v2/content/docs/local-development/index.mdx:6
docs-v2/README.md (1)

8-13: Ensure "dev"/"start" scripts exist in package.json
The README advertises npm run dev | pnpm dev | yarn dev, but the scaffold sometimes only creates next dev. Double-check that:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start"
}

are present; otherwise newcomers will hit “missing script” errors.

docs-v2/.gitignore (1)

1-28: No issues – solid, conventional ignores
Covers node, Next, Vercel, and Contentlayer artefacts.

docs-v2/app/docs/layout.tsx (1)

18-19: Verify GitHub repo owner – possible mismatch with organization name

The link is hard-coded to owner="amalshaji", yet the project appears to live under the portr-dev/portr GitHub org (per PR description & prior code). If the repo has moved, this will point users to the wrong place.

-<GithubInfo owner="amalshaji" repo="portr" className="lg:-mx-2" />
+<GithubInfo owner="portr-dev" repo="portr" className="lg:-mx-2" />

Please confirm which namespace is canonical and adjust accordingly.

docs-v2/content/docs/client/installation.mdx (1)

41-43: Relative link may 404 – confirm server docs location

/docs/server assumes an index route exists. In Fumadocs, the actual generated path might be /docs/server/index or similar. Double-check the sidebar tree and adjust to a working URL.

docs-v2/public/manifest.json (1)

10-22: SVG icons are not universally accepted as PWA icons

Many browsers (notably Chrome on Android) still require PNG icons for installation. Relying solely on image/svg+xml may cause the “Add to Home Screen” flow to fall back to generated placeholders.
Provide PNG fallbacks for each size:

{
  "src": "/icon-192.png",
  "sizes": "192x192",
  "type": "image/png",
  "purpose": "any maskable"
}

Keep the SVGs as additional entries if desired.

docs-v2/app/docs-og/[...slug]/route.tsx (2)

5-21: LGTM! Well-structured OG image generation.

The route handler correctly implements async parameter handling, proper 404 responses for missing pages, and generates OG images with appropriate metadata. The implementation follows Next.js 13+ app router conventions.


23-28: Static parameter generation logic confirmed

  • Verified no other OG image routes or conflicting dynamic routes in docs-v2/app/docs-og.
  • Appending "image.png" to each slug array aligns with the /docs-og/[...slug] pattern (e.g. /docs-og/intro/getting-started/image.png).

No changes required.

docs-v2/content/docs/client/tcp-tunnel.mdx (2)

1-46: Excellent documentation structure and content.

The TCP tunnel documentation is well-organized with clear examples, appropriate callouts, and comprehensive coverage of use cases and requirements. The technical explanations are accurate and the progression from basic usage to advanced configuration is logical.


35-37: Port range 30001-40001 verified—no changes required

Verified that the port range is consistently defined in both documentation and code:

  • docs-v2/content/docs/client/tcp-tunnel.mdx (callout)
  • docs-v2/content/docs/server/index.mdx (bullet item)
  • docs/src/content/docs/server/index.md (bullet item)
  • tunnel/internal/utils/port.go (startPort/endPort)
  • tunnel/internal/utils/port_test.go (range check)

All references use 30001-40001, matching the server implementation.

docs-v2/content/docs/client/index.mdx (2)

1-58: Well-structured client documentation hub.

The documentation provides excellent navigation with card-based links and comprehensive quick command examples. The organization into Getting Started, Advanced Features, and Quick Commands sections makes it user-friendly.


39-57: Review CLI command examples for accuracy and completeness

Ensure the listed portr commands in docs-v2/content/docs/client/index.mdx (lines 39–57) match the latest CLI interface and provide clear usage guidance:

  • File: docs-v2/content/docs/client/index.mdx (lines 39–57)
  • Verify that:
    portr auth set --token {your_token} --remote {your_domain} still uses --remote (vs. --url or another flag)
    portr http 3000 and portr http 3000 --subdomain my-app syntax is correct
    portr tcp 5432 remains accurate
    portr start my-service exists as a predefined template command
    portr --help still surfaces the expected CLI reference
  • Consider adding one-sentence notes on when to choose HTTP tunnels vs. TCP tunnels vs. predefined templates
docs-v2/components/ui/logo.tsx (3)

3-7: Good TypeScript interface design.

The props interface is well-defined with appropriate optional properties and sensible defaults.


23-42: Excellent theming system with CSS custom properties.

The use of CSS custom properties with fallback values provides excellent theme adaptation capabilities. The naming convention is consistent and the fallbacks ensure the logo works even without theme variables.


185-185: LGTM! Proper export pattern.

Both named and default exports are provided, giving consumers flexibility in how they import the component.

docs-v2/content/docs/server/index.mdx (3)

1-59: Comprehensive and well-structured server setup guide.

The documentation provides excellent coverage of prerequisites, DNS configuration, and server components. The use of tables, callouts, and card navigation makes it very user-friendly.


23-26: DNS configuration is clear and accurate.

The DNS table provides the essential A records needed for the service. The wildcard subdomain configuration is correctly specified for both root and subdomains.


30-31: Ports consistently documented across docs
All references in both docs/src and docs-v2 use SSH port 2222 and TCP port range 30001–40001 with no discrepancies. Please ensure your actual server is configured to match these values.

docs-v2/app/layout.tsx (1)

1-83: Well-structured root layout with comprehensive metadata configuration.

The implementation follows Next.js best practices with proper SEO metadata, social media tags, and theme support. The robots directive appropriately excludes dynamic OG image routes from crawling.

docs-v2/content/docs/server/cloudflare-api-token.mdx (2)

88-92: Curl example is appropriately documented with placeholder token.

The static analysis tool flagged this as a potential security issue, but this is example documentation using "YOUR_API_TOKEN" as a placeholder. The security warnings elsewhere in the document appropriately caution users about token security.


1-93: Comprehensive and well-structured API token documentation.

The guide provides clear step-by-step instructions, explains permissions appropriately, includes security best practices, and offers troubleshooting guidance. The content is well-organized with appropriate callouts and code examples.

docs-v2/app/(home)/page.tsx (1)

45-396: Well-structured homepage with comprehensive content and interactive elements.

The component effectively showcases Portr's features with an animated terminal demo, feature cards, embedded videos, and clear navigation. The responsive design and metadata configuration are well-implemented.

docs-v2/content/docs/local-development/index.mdx (1)

1-102: Comprehensive and well-structured local development guide.

The documentation provides clear architecture overview, specific prerequisites, practical setup instructions, and helpful development workflow guidance. The use of Fumadocs UI components enhances readability and organization.

docs-v2/components/magicui/sparkles-text.tsx (2)

113-123: Sparkle lifecycle management is well-implemented.

The lifespan-based sparkle replacement system creates a nice continuous effect. The random generation and smooth transitions provide good visual appeal.


42-85: Excellent TypeScript documentation and prop interface design.

The comprehensive JSDoc comments and well-structured props interface make this component easy to use and understand. The default values are sensible.

docs-v2/app/docs/[[...slug]]/page.tsx (2)

12-17: Good error handling implementation.

The async parameter handling and 404 response for missing pages is well implemented.


51-52: Verify OG image route exists and aligns with URL construction
I didn’t find any route.tsx or route.ts handling the /docs-og segment under docs-v2/app. Please confirm that:

  • A route (e.g. docs-v2/app/docs-og/[...slug]/route.tsx) is implemented to serve or proxy the generated OG images.
  • The path built by ["/docs-og", ...(params.slug||[]), "image.png"].join("/") matches the route’s URL pattern.
  • The endpoint returns the correct Open Graph image without errors.
docs-v2/components/magicui/terminal.tsx (2)

46-48: Excellent input validation.

The runtime type checking for string children prevents common usage errors and provides clear error messages.


58-81: Proper cleanup implementation.

The useEffect hooks correctly clean up timeouts and intervals, preventing memory leaks.

docs-v2/content/docs/resources/route53.mdx (4)

32-57: IAM policy follows least privilege principle.

The IAM policy correctly implements minimal permissions for Route53 DNS management, which is a security best practice.


118-121: Excellent security guidance.

The security considerations section properly emphasizes key security practices including minimal permissions, dedicated users, and credential rotation.


24-27: Good use of callout for critical configuration.

The warning callout about replacing the hosted zone ID helps prevent a common configuration mistake.


86-95: Verify Docker Compose label syntax for Route53 credentials

Ensure that the provider-specific credentials are correctly namespaced under tls.dns. In particular, the labels should include the provider name (route53) before each credential key. For example:

 labels:
   caddy_1: "*.$PORTR_DOMAIN"
   caddy_1.reverse_proxy: "{{upstreams http 8001}}"
   caddy_1.tls.dns: "route53"
-  caddy_1.tls.dns.access_key_id: "$ROUTE53_ACCESS_KEY"
-  caddy_1.tls.dns.secret_access_key: "$ROUTE53_SECRET_ACCESS_KEY"
+  caddy_1.tls.dns.route53.access_key_id: "$ROUTE53_ACCESS_KEY"
+  caddy_1.tls.dns.route53.secret_access_key: "$ROUTE53_SECRET_ACCESS_KEY"
   caddy_1.encode: gzip

File: docs-v2/content/docs/resources/route53.mdx (Lines 86–95)

Please manually verify these labels against the official Caddy DNS-Challenge documentation to confirm the correct syntax.

docs-v2/content/docs/local-development/portr-client.mdx (2)

13-15: Verify that the stated minimum Go version (1.23+) actually exists/stable

Go 1.22 is the latest stable release as of Mar 2025. Requiring 1.23 may confuse contributors if the version is not yet available in their package managers.


37-46: Directory context is unclear before running Make targets

The instructions jump from make installclient in the repo root to cd tunnel and immediately invoke make buildcli. If separate Makefiles exist, call this out explicitly; otherwise contributors may run the command in the wrong directory.

amalshaji and others added 3 commits July 27, 2025 23:53
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@amalshaji amalshaji merged commit efcd83f into main Jul 27, 2025
1 check passed
@amalshaji amalshaji deleted the revamp-docs branch July 27, 2025 18:29
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.

1 participant