Conversation
|
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 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. 📒 Files selected for processing (1)
WalkthroughThis change introduces a new documentation site for the "Portr" project under the Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 inportr-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 linkNice 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 fallbackOKLCH 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 performanceApplying
border-border&outline-ring/50to 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 intentionalThe 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 crawlersAlthough major crawlers follow the “longest match wins” rule, some older or less common bots apply first-match precedence. Placing the specific
Disallowlines before the globalAllow: /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>withrole="img"or providearia-label.
The SVG already carriesaria-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
Listingtailwind.config.mjsandapp/global.cssalongside 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
generateOGImageis pure for identical params. SettingCache-Control: public, max-age=86400, immutable(or similar) cuts render costs.- return generateOGImage({ + return generateOGImage({ title: "Portr", @@ primaryColor: "rgb(71, 85, 105)", // slate-600 });
generateOGImageaccepts aheadersoption; 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 sometimesimport { 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:dangerouslySetInnerHTMLis expected here – silence or scope the lint ruleUsing
dangerouslySetInnerHTMLto embed JSON-LD is the recommended / canonical approach in React. The Biome rulenoDangerouslySetInnerHtmlis 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
aggregateRatingcontains 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 importStepsto avoid MDX/TypeScript warnings
Stepsis 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/docsentry in sitemap
/docsis listed as a static page and may also be produced bysource.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-Protectionis obsoleteModern 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 parityThe project relies on TypeScript strict mode but lacks
type-check,lint, orformatscripts. 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 consistencyMDX
descriptionuses 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 Portrdocs-v2/source.config.ts (1)
10-18:lastModifiedshould be a date to aid sitemap / SEO toolingStoring
lastModifiedas a plain string makes automated consumers guess the format. Switch to an ISO-8601-validatedz.string().datetime()orz.date().- lastModified: z.string().optional(), + lastModified: z.string().datetime().optional(),docs-v2/tsconfig.json (1)
18-21: Alias@/.sourceis fragile and uncommonThe leading dot folder and embedded slash make import paths verbose and error-prone. Unless
.source/is generated code, prefer a conventional alias such as@/libor 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:
- Performance: The large SVG with multiple gradients might impact rendering performance
- Maintainability: Complex path data is hard to modify or maintain
- 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 importSteps– remove to avoid build warnings
Stepsis 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.envshould never be committed to version control to prevent accidental leakage ofCLIENT_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 addingloading="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 whereportr --helpshould 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 frequencydocs-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.comwithexample.comused 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.comdocs-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-buffereddocs-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 descriptionGrammatically 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 tunnelsdocs-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 runclientare also used by the client component. Consider prefixing withadmin-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
⛔ Files ignored due to path filters (7)
docs-v2/bun.lockis excluded by!**/*.lockdocs-v2/public/apple-touch-icon.svgis excluded by!**/*.svgdocs-v2/public/favicon.icois excluded by!**/*.icodocs-v2/public/icon-192.svgis excluded by!**/*.svgdocs-v2/public/icon-512.svgis excluded by!**/*.svgdocs-v2/public/icon.svgis excluded by!**/*.svgdocs-v2/public/logo.svgis 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 importThe 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-variantis only recognised whenpostcss-extend-ruleor 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 indocs-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 goodThe metadata format aligns with other sections.
docs-v2/lib/utils.ts (1)
4-6:clsxis fed an array, not variadic arguments
clsxexpects 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 presentRun 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-checkbaseUrl: '/docs'– may create a/docs/docs/...route.
Since the Next.js route already lives underapp/docs/[[...slug]], adding the same prefix inbaseUrlcan duplicate the segment when helpers build URLs. Make sure generated links look like/docs/introrather than/docs/docs/intro.
1-1: Verify the@/.sourceimport path – it’s likely incorrect
I wasn’t able to find any files named.source.tsor.source.jsin the repo. With apathsmapping like{ "@/*": ["docs-v2/*"] }
@/.sourceresolves todocs-v2/.source.ts, which doesn’t exist and will break the build.• If you intended to import the
source.tsnext 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
sourcemodule lives and update the import accordingly.docs-v2/app/(home)/layout.tsx (1)
3-3: Confirm that the path alias@/app/layout.configresolves insidedocs-v2.
If@maps to the repository root, the resolver will look forapp/layout.config.tsxat the project root, not underdocs-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: Confirmfumadocs-ui/components/cardimport path across documentation
Before publishing, please verify that your installed version offumadocs-uistill exportsCardandCardsfromcomponents/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 inpackage.json
The README advertisesnpm run dev | pnpm dev | yarn dev, but the scaffold sometimes only createsnext 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 nameThe link is hard-coded to
owner="amalshaji", yet the project appears to live under theportr-dev/portrGitHub 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/serverassumes an index route exists. In Fumadocs, the actual generated path might be/docs/server/indexor 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 iconsMany browsers (notably Chrome on Android) still require PNG icons for installation. Relying solely on
image/svg+xmlmay 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 eachslugarray 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 range30001-40001verified—no changes requiredVerified 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 completenessEnsure the listed
portrcommands indocs-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.--urlor another flag)
•portr http 3000andportr http 3000 --subdomain my-appsyntax is correct
•portr tcp 5432remains accurate
•portr start my-serviceexists as a predefined template command
•portr --helpstill 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 bothdocs/srcanddocs-v2use 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 anyroute.tsxorroute.tshandling the/docs-ogsegment underdocs-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 credentialsEnsure 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: gzipFile: 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/stableGo 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 targetsThe instructions jump from
make installclientin the repo root tocd tunneland immediately invokemake buildcli. If separate Makefiles exist, call this out explicitly; otherwise contributors may run the command in the wrong directory.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Documentation
Chores