Skip to content

feat(web): llms.txt, convex live stats, switch to vercel and improved ui - #460

Merged
AmanVarshney01 merged 6 commits into
mainfrom
site-fixess
Aug 2, 2025
Merged

AmanVarshney01 merged 6 commits into
mainfrom
site-fixess

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Aug 2, 2025 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added backend package with Convex functions, health check, HTTP routes, and open-source stats integration.
    • Introduced live analytics, GitHub, and NPM stats on homepage with animated number flows and improved cards.
    • Implemented minimal public analytics JSON and aggregated analytics data for enhanced performance.
    • Added AI-powered copy button and external view options for documentation pages.
    • Introduced dynamic Open Graph image and LLM text API routes for documentation.
    • Added advanced search dialog with custom items and Orama integration.
    • Provided new dropdown menu UI components.
    • Enhanced sponsor banners with clickable links.
    • Added interactive stack builder card and redesigned CLI command selector on homepage.
  • Improvements

    • Migrated deployment from Cloudflare to Vercel, updating scripts and configuration.
    • Upgraded and added dependencies for improved functionality.
    • Unified font styling to Geist fonts and enhanced UI styling for charts and terminal themes.
    • Refined homepage layout, navigation, and interactive elements.
    • Improved analytics page to use pre-aggregated data and standardized color schemes.
    • Updated analytics data aggregation to precompute distributions and summaries server-side.
    • Improved search results by combining custom items with indexed search.
    • Updated Twitter card and Open Graph metadata with social preview images.
    • Replaced GitHub stars fetching with live Convex queries and added NPM download counters.
    • Disabled analytics tracking in development environment.
  • Bug Fixes

    • Ensured proper directory and file ignores in configuration files.
  • Documentation

    • Added README for backend Convex functions with usage examples.
  • Chores

    • Added and updated ignore/configuration files for backend and project tooling.
    • Removed obsolete Cloudflare and Node.js version configuration files.

@changeset-bot

changeset-bot Bot commented Aug 2, 2025 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 95c5df3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 2, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This change migrates the web application from a Cloudflare-based deployment to Vercel, updating deployment scripts, dependencies, and configuration files accordingly. It introduces new backend and analytics infrastructure using Convex and OSS stats, adds multiple new React components and routes for analytics, documentation, and LLM content, and refactors analytics data handling to use pre-aggregated statistics.

Changes

Cohort / File(s) Change Summary
Cloudflare to Vercel Migration
.nvmrc, apps/web/open-next.config.ts, apps/web/package.json, apps/web/next.config.mjs, apps/web/wrangler.jsonc, apps/web/.vercelignore, package.json
Removed Cloudflare-specific configuration and deployment scripts; added Vercel deployment scripts and ignore rules; updated Next.js rewrites; removed Cloudflare dependencies.
Analytics Aggregation Refactor
apps/web/scripts/generate-analytics.ts, apps/web/public/analytics-minimal.json, apps/web/src/app/(home)/analytics/page.tsx
Shifted analytics data handling from raw record storage to aggregated statistics, generating both detailed and minimal analytics JSON, and refactored analytics page to consume pre-aggregated data.
Backend Infrastructure (Convex & OSS Stats)
packages/backend/package.json, packages/backend/convex/README.md, packages/backend/convex/convex.config.ts, packages/backend/convex/healthCheck.ts, packages/backend/convex/http.ts, packages/backend/convex/stats.ts, packages/backend/convex/tsconfig.json, packages/backend/.gitignore
Introduced a new backend package using Convex, added OSS stats integration, health check, HTTP routes, configuration, and documentation.
Dependency and Script Updates
apps/web/package.json, package.json
Upgraded and added dependencies (Convex, OSS stats, UI libraries), removed unused packages, and updated deployment/preview scripts for Vercel.
Font and Theming Overhaul
apps/web/src/app/layout.tsx, apps/web/src/app/global.css, apps/web/src/app/layout.config.tsx
Switched from Poppins to Geist fonts, unified font usage, and introduced extensive terminal-themed chart and UI styling.
Analytics UI and Home Page Refactor
apps/web/src/app/(home)/page.tsx, apps/web/src/app/(home)/_components/stack-builder.tsx, apps/web/src/app/(home)/_components/testimonials.tsx
Refactored home page to use live analytics and NPM/GitHub stats, improved CLI command UX, added Stack Builder and analytics cards, updated testimonials and icon styling.
Docs and LLM Content Routing
apps/web/src/app/docs/[[...slug]]/page.tsx, apps/web/src/app/docs-og/[...slug]/route.tsx, apps/web/src/app/llms.mdx/[[...slug]]/route.ts, apps/web/src/app/llms-full.txt/route.ts
Added new routes for Open Graph images, LLM content (full and per-page), and enhanced docs metadata with OG/Twitter images and new action buttons.
New UI Components
apps/web/src/components/ai/page-actions.tsx, apps/web/src/components/ui/dropdown-menu.tsx, apps/web/src/components/providers.tsx, apps/web/src/components/search.tsx
Introduced components for LLM copy/view actions, Radix-based dropdown menus, Convex/Nuqs provider, and a custom Orama-powered search dialog.
Search Configuration
apps/web/src/lib/search-config.ts
Added custom search item definitions and filtering logic for enhanced documentation search experience.
LLM Content Utility
apps/web/src/lib/get-llm-text.ts
Added utility to process and format page content for LLM consumption with remark plugins.
Instrumentation Update
apps/web/instrumentation-client.ts
Changed PostHog client initialization to skip in development and updated debug flag logic.
Special Sponsor Banner
apps/web/src/components/special-sponsor-banner.tsx
Made sponsor banners clickable links to their respective websites.
Miscellaneous
biome.json
Added ignore pattern for _generated directories to biome configuration.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WebApp
    participant ConvexBackend
    participant AnalyticsScript
    participant OSSStats

    User->>WebApp: Visits Analytics Page
    WebApp->>ConvexBackend: Fetches Aggregated Analytics Data
    ConvexBackend-->>WebApp: Returns Pre-Aggregated Statistics
    WebApp->>User: Renders Analytics UI

    AnalyticsScript->>OSSStats: Fetches Raw Analytics Records
    AnalyticsScript->>AnalyticsScript: Aggregates Data (distributions, time series, summaries)
    AnalyticsScript->>ConvexBackend: Uploads Aggregated Analytics JSON
    AnalyticsScript->>WebApp/public: Writes Minimal Analytics JSON
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • biome ignore .wrangler dir  #392: Also modifies biome.json ignore patterns, focusing on excluding the .wrangler directory, which is similar in intent to this PR's exclusion of _generated directories.

Poem

A rabbit hops through fields anew,
From Cloudflare's clouds to Vercel's blue.
Convex stats and charts appear,
With Geist fonts crisp and data clear.
Docs and LLMs, search with glee—
Such lively stacks for all to see!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch site-fixess

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/AmanVarshney01/create-better-t-stack@460

commit: 95c5df3

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (10)
apps/web/src/lib/search-config.ts (1)

8-51: Consider centralizing external URLs for better maintainability.

The search items are well-organized, but the hardcoded external URLs could be centralized in a configuration object for easier maintenance.

Consider extracting URLs to a constants object:

+const EXTERNAL_URLS = {
+  GITHUB: "https://github.com/AmanVarshney01/create-better-t-stack",
+  NPM: "https://www.npmjs.com/package/create-better-t-stack",
+  TWITTER: "https://x.com/amanvarshney01",
+  DISCORD: "https://discord.gg/ZYsbjpDaM5"
+} as const;
+
 export const customSearchItems: CustomSearchItem[] = [
   // ... other items
   {
     title: "GitHub Repository",
-    url: "https://github.com/AmanVarshney01/create-better-t-stack",
+    url: EXTERNAL_URLS.GITHUB,
     content: "GitHub",
     tags: ["github", "source", "code", "repository", "contribute", "star"],
   },
   // ... apply similar changes to other external URLs
 ];
packages/backend/convex/healthCheck.ts (1)

1-7: LGTM! Basic health check implementation.

The health check query follows Convex patterns correctly and provides a simple endpoint for monitoring service availability.

For production environments, consider enhancing the health check to include more comprehensive status information:

 export const get = query({
   handler: async () => {
-    return "OK";
+    return {
+      status: "OK",
+      timestamp: new Date().toISOString(),
+      service: "convex-backend"
+    };
   },
 });
packages/backend/package.json (1)

8-10: Complete the package metadata.

The package has empty author and description fields. Consider adding appropriate values and additional metadata like repository, homepage, and keywords to improve package discoverability and maintainability.

-  "author": "",
-  "license": "ISC",
-  "description": "",
+  "author": "AmanVarshney01",
+  "license": "MIT",
+  "description": "Backend service for Better T Stack using Convex",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/AmanVarshney01/create-better-t-stack.git",
+    "directory": "packages/backend"
+  },
+  "homepage": "https://github.com/AmanVarshney01/create-better-t-stack#readme"
packages/backend/convex/README.md (1)

4-4: Fix markdown formatting for the bare URL.

The URL should be properly formatted as a markdown link instead of bare text.

-See https://docs.convex.dev/functions for more.
+See [https://docs.convex.dev/functions](https://docs.convex.dev/functions) for more.
apps/web/src/components/search.tsx (2)

17-24: Consider more descriptive schema field names and internationalization support.

The Orama schema uses a non-descriptive field name _ which reduces code readability. Additionally, hardcoding the language to "english" may limit internationalization capabilities.

Consider using more descriptive field names and making the language configurable:

-function initOrama() {
-	return create({
-		schema: {
-			_: "string",
-		},
-		language: "english",
-	});
-}
+function initOrama(language = "english") {
+	return create({
+		schema: {
+			content: "string",
+		},
+		language,
+	});
+}

42-48: Potential ID collision in combined results.

The custom item IDs use a simple index-based pattern (custom-${index}) which could potentially collide with IDs from query.data if they follow a similar pattern.

Consider using a more unique identifier pattern:

-					id: `custom-${index}`,
+					id: `custom-item-${item.url}-${index}`,
apps/web/src/components/ai/page-actions.tsx (2)

20-20: Consider the implications of module-level caching.

The cache is shared across all component instances and persists for the lifetime of the module. This could lead to unbounded memory growth if many different URLs are fetched.

Consider implementing a cache with size limits or TTL:

-const cache = new Map<string, string>();
+const cache = new Map<string, { content: string; timestamp: number }>();
+const CACHE_SIZE_LIMIT = 100;
+const CACHE_TTL = 5 * 60 * 1000; // 5 minutes

Additionally, implement cache eviction logic when the size limit is reached or entries expire.


38-47: Consider using the more compatible clipboard API.

The navigator.clipboard.write with ClipboardItem has limited browser support. Since you're only copying text, the simpler writeText API would be more compatible.

-await navigator.clipboard.write([
-  new ClipboardItem({
-    "text/plain": fetch(markdownUrl).then(async (res) => {
-      const content = await res.text();
-      cache.set(markdownUrl, content);
-
-      return content;
-    }),
-  }),
-]);
+const res = await fetch(markdownUrl);
+if (!res.ok) {
+  throw new Error(`Failed to fetch: ${res.status}`);
+}
+const content = await res.text();
+cache.set(markdownUrl, content);
+await navigator.clipboard.writeText(content);
apps/web/src/app/(home)/analytics/page.tsx (2)

425-1875: Consider splitting this large component for better maintainability.

At 1875 lines, this component is quite large. Consider extracting chart components into separate files:

// Suggested structure:
// components/analytics/TimeSeriesChart.tsx
// components/analytics/PlatformDistributionChart.tsx
// components/analytics/StackConfigurationCharts.tsx
// components/analytics/DevEnvironmentCharts.tsx
// components/analytics/MetricsCards.tsx

This would improve:

  • Code readability and maintainability
  • Testing capabilities
  • Reusability of chart components
  • Bundle splitting potential

941-951: Consider extracting color mapping logic.

The repetitive ternary operators for color mapping could be simplified with a helper function:

const getChartColor = (name: string, colorMap: Record<string, string>) => {
  return colorMap[name] || "hsl(var(--chart-7))";
};

// Usage:
fill={getChartColor(entry.name, {
  darwin: "hsl(var(--chart-1))",
  linux: "hsl(var(--chart-2))",
  win32: "hsl(var(--chart-3))"
})}

Also applies to: 1085-1105, 1146-1160

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 004cc01 and fee011a.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (37)
  • .nvmrc (0 hunks)
  • apps/web/.vercelignore (1 hunks)
  • apps/web/instrumentation-client.ts (1 hunks)
  • apps/web/next.config.mjs (1 hunks)
  • apps/web/open-next.config.ts (0 hunks)
  • apps/web/package.json (1 hunks)
  • apps/web/public/analytics-minimal.json (1 hunks)
  • apps/web/scripts/generate-analytics.ts (5 hunks)
  • apps/web/src/app/(home)/_components/stack-builder.tsx (1 hunks)
  • apps/web/src/app/(home)/_components/testimonials.tsx (2 hunks)
  • apps/web/src/app/(home)/analytics/page.tsx (39 hunks)
  • apps/web/src/app/(home)/page.tsx (3 hunks)
  • apps/web/src/app/docs-og/[...slug]/route.tsx (1 hunks)
  • apps/web/src/app/docs/[[...slug]]/page.tsx (3 hunks)
  • apps/web/src/app/global.css (2 hunks)
  • apps/web/src/app/layout.config.tsx (1 hunks)
  • apps/web/src/app/layout.tsx (3 hunks)
  • apps/web/src/app/llms-full.txt/route.ts (1 hunks)
  • apps/web/src/app/llms.mdx/[[...slug]]/route.ts (1 hunks)
  • apps/web/src/components/ai/page-actions.tsx (1 hunks)
  • apps/web/src/components/providers.tsx (1 hunks)
  • apps/web/src/components/search.tsx (1 hunks)
  • apps/web/src/components/special-sponsor-banner.tsx (2 hunks)
  • apps/web/src/components/ui/dropdown-menu.tsx (1 hunks)
  • apps/web/src/lib/get-llm-text.ts (1 hunks)
  • apps/web/src/lib/search-config.ts (1 hunks)
  • apps/web/wrangler.jsonc (0 hunks)
  • biome.json (1 hunks)
  • package.json (1 hunks)
  • packages/backend/.gitignore (1 hunks)
  • packages/backend/convex/README.md (1 hunks)
  • packages/backend/convex/convex.config.ts (1 hunks)
  • packages/backend/convex/healthCheck.ts (1 hunks)
  • packages/backend/convex/http.ts (1 hunks)
  • packages/backend/convex/stats.ts (1 hunks)
  • packages/backend/convex/tsconfig.json (1 hunks)
  • packages/backend/package.json (1 hunks)
💤 Files with no reviewable changes (3)
  • .nvmrc
  • apps/web/open-next.config.ts
  • apps/web/wrangler.jsonc
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: the angular frontend template uses tailwind css v4, which doesn't require a traditional tailwind.con...
Learnt from: Vijayabaskar56
PR: AmanVarshney01/create-better-t-stack#310
File: apps/cli/templates/frontend/angular/src/app.component.html:1-7
Timestamp: 2025-06-08T17:57:33.083Z
Learning: The Angular frontend template uses Tailwind CSS v4, which doesn't require a traditional tailwind.config.js configuration file.

Applied to files:

  • apps/web/src/app/layout.config.tsx
📚 Learning: for ngxsonnertoaster in the angular template, it's sufficient to import it directly in the app-root ...
Learnt from: Vijayabaskar56
PR: AmanVarshney01/create-better-t-stack#310
File: apps/cli/templates/frontend/angular/src/app.component.html:1-7
Timestamp: 2025-06-08T17:57:33.083Z
Learning: For NgxSonnerToaster in the Angular template, it's sufficient to import it directly in the app-root component's imports array rather than in a module, following the standalone component approach.

Applied to files:

  • apps/web/src/components/providers.tsx
  • apps/web/src/app/layout.tsx
🧬 Code Graph Analysis (5)
apps/web/src/lib/get-llm-text.ts (1)
apps/web/src/lib/source.ts (1)
  • source (4-7)
apps/web/instrumentation-client.ts (1)
apps/cli/src/utils/analytics.ts (1)
  • trackProjectCreation (9-41)
apps/web/src/app/global.css (1)
apps/web/src/components/ui/chart.tsx (1)
  • ChartContainer (37-70)
apps/web/src/app/llms.mdx/[[...slug]]/route.ts (5)
apps/web/src/app/llms-full.txt/route.ts (2)
  • revalidate (5-5)
  • GET (7-12)
apps/web/src/app/docs-og/[...slug]/route.tsx (2)
  • GET (5-18)
  • generateStaticParams (20-25)
apps/web/src/lib/source.ts (1)
  • source (4-7)
apps/web/src/lib/get-llm-text.ts (1)
  • getLLMText (14-26)
apps/web/src/app/docs/[[...slug]]/page.tsx (1)
  • generateStaticParams (40-42)
apps/web/src/components/ui/dropdown-menu.tsx (1)
apps/cli/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx (10)
  • DropdownMenuSubContent (225-239)
  • DropdownMenu (9-13)
  • DropdownMenuItem (62-83)
  • DropdownMenuGroup (54-60)
  • DropdownMenuPortal (15-21)
  • DropdownMenuSub (195-199)
  • DropdownMenuTrigger (23-32)
  • DropdownMenuRadioItem (122-144)
  • DropdownMenuRadioGroup (111-120)
  • DropdownMenuLabel (146-164)
🪛 markdownlint-cli2 (0.17.2)
packages/backend/convex/README.md

4-4: Bare URL used

(MD034, no-bare-urls)

🪛 Biome (2.1.2)
apps/web/src/components/ai/page-actions.tsx

[error] 54-64: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

🔇 Additional comments (44)
packages/backend/.gitignore (1)

1-3: LGTM! Standard .gitignore patterns for backend package.

The ignore patterns are appropriate for a Convex-based backend setup - excluding local environment files and generated code from version control.

biome.json (1)

22-22: Good consistency with .gitignore patterns.

Adding _generated directories to Biome's ignore list aligns with the backend .gitignore and prevents linting/formatting of auto-generated Convex code.

package.json (1)

15-15: Verify Vercel configuration is in place

I ran a check for common Vercel config files (vercel.json or a ​.vercel directory) and didn’t find any in the repo. Please confirm that your project has its Vercel settings defined—either via a vercel.json, the ​.vercel directory, or through the Vercel dashboard—so that the new deploy:web script will succeed.

apps/web/src/lib/get-llm-text.ts (1)

8-12: Well-configured remark processor for MDX content.

The processor setup with MDX, include, and GFM plugins is appropriate for processing documentation content.

packages/backend/convex/tsconfig.json (1)

1-25: LGTM! Standard Convex TypeScript configuration.

The TypeScript configuration follows Convex best practices with appropriate compiler options, strict type checking enabled, and correct exclusion of generated files.

apps/web/src/lib/search-config.ts (2)

1-6: LGTM! Well-defined interface for search items.

The CustomSearchItem interface is properly structured with all necessary fields for search functionality.


53-66: LGTM! Efficient search filtering implementation.

The filtering function correctly handles case-insensitive search across title, content, and tags with proper early return for empty queries.

apps/web/.vercelignore (1)

1-1: LGTM! Appropriate exclusion for Vercel deployment.

Excluding the scripts directory from deployment is correct, as these files are typically used for build processes and shouldn't be deployed to production.

packages/backend/convex/http.ts (1)

1-7: ✅ Verified ossStats integration – ready to merge

The ossStats instance is correctly exported from packages/backend/convex/stats.ts and provides a registerRoutes method. The HTTP router in http.ts imports this instance and calls ossStats.registerRoutes(http) as intended:

• packages/backend/convex/stats.ts
– Exports ossStats via new OssStats(...).
– Exposes API methods and registerRoutes on the instance.
• packages/backend/convex/http.ts
– Imports ossStats and calls ossStats.registerRoutes(http).

No further changes required.

apps/web/next.config.mjs (1)

33-36: Destination route verified and handles dynamic segments correctly

  • Found apps/web/src/app/llms.mdx/[[...slug]]/route.ts, which implements a catch-all slug parameter.
  • This aligns with the /llms.mdx/:path* rewrite and will properly forward all /docs/... MDX requests.

No further changes needed—approve the rewrite rule.

apps/web/src/app/(home)/_components/testimonials.tsx (2)

164-164: LGTM: UI spacing refinement.

The padding adjustment from px-3 to px-2 provides better visual balance in the video card headers.


214-214: LGTM: Proper Twitter component customization.

The components prop correctly customizes Twitter embed rendering using Next.js Image components, which ensures consistent image handling across the application.

packages/backend/convex/convex.config.ts (1)

1-7: LGTM: Clean Convex configuration with OSS stats integration.

The configuration correctly sets up a Convex app with OSS statistics middleware. The structure follows Convex best practices with proper imports, app definition, middleware application, and default export.

packages/backend/package.json (2)

4-6: LGTM: Appropriate Convex development scripts.

The development scripts are well-configured for Convex development workflow, with both basic dev and setup commands.


14-17: LGTM: Focused dependency management.

The dependencies are appropriately focused on the core functionality - Convex framework and OSS statistics middleware.

apps/web/src/app/layout.config.tsx (1)

79-79: LGTM: Typography simplification and consistency.

The change from conditional utility classes to fixed monospace styling simplifies the navigation title appearance and aligns with the broader font migration to Geist fonts across the application.

apps/web/public/analytics-minimal.json (1)

1-6: LGTM - Well-structured analytics data.

The JSON structure is clean and the data types are appropriate for the analytics use case. The file serves as a publicly accessible analytics snapshot.

Note that this file will be publicly accessible since it's in the public folder, but the data appears to be non-sensitive aggregate statistics.

apps/web/instrumentation-client.ts (1)

3-11: LGTM - Proper environment-based analytics initialization.

The conditional initialization prevents unnecessary PostHog setup during development while enabling debug mode in non-production environments. This follows best practices for client-side analytics.

The logic correctly:

  • Skips initialization in development (NODE_ENV !== "development")
  • Enables debug mode in non-production environments (NODE_ENV !== "production")
apps/web/src/app/llms-full.txt/route.ts (1)

4-5: Consider the implications of indefinite caching.

Setting revalidate = false means this route will be cached indefinitely. Ensure that this is appropriate for your use case, especially if the underlying content can change.

If the content is truly static and doesn't need updates, this is fine. Otherwise, consider setting a reasonable revalidation period:

-// cached forever
-export const revalidate = false;
+// cached for 1 hour
+export const revalidate = 3600;
apps/web/src/components/providers.tsx (1)

9-18: LGTM - Well-structured provider hierarchy.

The component correctly:

  • Uses the "use client" directive for client-side functionality
  • Establishes proper provider hierarchy with ConvexProvider wrapping children
  • Places Toaster outside providers to avoid context conflicts
  • Integrates NuqsAdapter within the Convex context

The provider pattern follows React best practices for context composition.

apps/web/src/app/(home)/_components/stack-builder.tsx (1)

1205-1210: LGTM - Improved className handling with conditional logic.

The change enhances icon styling by:

  • Using the cn utility for proper class merging
  • Applying conditional classes based on icon type (file-based vs text-based icons)
  • Preserving custom tech.className properties

This provides better styling consistency and maintainability compared to the previous simple conditional assignment.

packages/backend/convex/README.md (1)

6-91: LGTM! Comprehensive documentation for Convex functions.

The README provides clear, well-structured examples for both query and mutation functions, including proper argument validation, database operations, and React integration patterns. The examples align well with Convex best practices and will help developers understand how to implement and use the functions effectively.

apps/web/src/app/docs-og/[...slug]/route.tsx (2)

5-18: LGTM! Proper implementation of OG image generation route.

The GET handler correctly:

  • Handles async params extraction
  • Uses slug.slice(0, -1) to remove the appended "image.png" segment
  • Properly returns 404 for missing pages
  • Generates OG images with appropriate metadata

20-25: LGTM! Correct static params generation.

The generateStaticParams function properly appends "image.png" to each slug array, which aligns with the GET handler's expectation of removing the last segment to find the actual page.

apps/web/src/app/llms.mdx/[[...slug]]/route.ts (3)

6-6: LGTM! Appropriate ISR configuration.

Setting revalidate = false is suitable for LLM text content that doesn't need frequent regeneration, improving performance by serving static content.


8-17: LGTM! Proper route handler implementation.

The GET handler correctly:

  • Handles async params extraction with optional slug
  • Uses the getLLMText utility for content processing
  • Returns appropriate 404 responses for missing pages
  • Returns processed content wrapped in NextResponse

19-21: LGTM! Consistent static params generation.

The generateStaticParams function properly delegates to source.generateParams(), maintaining consistency with other route handlers in the codebase.

packages/backend/convex/stats.ts (2)

10-19: LGTM! Clean API surface with destructured exports.

The destructured export pattern provides a clean interface for accessing OSS stats functionality, including sync operations and various getter methods for GitHub and npm data.


4-8: OSS stats identifiers verified

The GitHub repository AmanVarshney01/create-better-t-stack and npm package create-better-t-stack were confirmed to exist. No changes required.

apps/web/package.json (3)

11-12: LGTM! Proper migration to Vercel deployment.

The script changes correctly update from Cloudflare-specific commands to Vercel commands:

  • deploy: Uses vercel --prod for production deployment
  • preview: Uses vercel dev for development preview

This aligns with the overall migration from Cloudflare to Vercel infrastructure.


17-44: LGTM! Comprehensive dependency updates for new features.

The dependency changes properly support the new backend integration and UI enhancements:

  • Added @better-t-stack/backend workspace reference for Convex integration
  • Added analytics and stats packages (@erquhart/convex-oss-stats, @number-flow/react)
  • Added UI components (@radix-ui/react-dropdown-menu, @orama/orama)
  • Updated core dependencies to newer versions
  • Removed Cloudflare-specific @opennextjs/cloudflare dependency

The changes are consistent with the migration to Vercel and the introduction of new backend functionality.


49-58: LGTM! Updated dev dependencies.

The dev dependency updates include appropriate version bumps for TypeScript types and tooling packages. The removal of wrangler is consistent with moving away from Cloudflare Workers deployment.

apps/web/src/app/docs/[[...slug]]/page.tsx (1)

44-64: Well-structured metadata generation with social preview support.

The refactored metadata generation properly handles slug defaults and adds comprehensive Open Graph and Twitter card support for better social media previews.

apps/web/src/app/layout.tsx (1)

108-133: Clean implementation of font variables and provider structure.

The layout properly integrates the new Geist fonts using CSS variables and cleanly structures the provider hierarchy with the new Providers component.

apps/web/src/app/global.css (1)

398-533: Excellent terminal-themed chart styling implementation.

The comprehensive Recharts styling creates a cohesive terminal aesthetic with proper hover effects, loading/error states, and consistent use of CSS variables. The monospace font usage enhances the terminal look.

apps/web/src/app/(home)/page.tsx (1)

117-177: Well-implemented package manager selector with excellent UX.

The dropdown menu provides a clean interface for selecting package managers with visual icons, and the copy functionality includes proper user feedback with the "COPIED!" state.

apps/web/src/components/ai/page-actions.tsx (1)

89-95: LGTM! Well-structured URL construction with SSR safety.

The component properly handles SSR with the typeof window !== "undefined" check and constructs URLs appropriately for each service.

apps/web/scripts/generate-analytics.ts (4)

11-55: Well-structured aggregated analytics data model.

The refactored AggregatedAnalyticsData interface provides a comprehensive structure for pre-aggregated analytics, which will improve performance by avoiding client-side processing.


262-294: Robust timestamp parsing with proper error handling.

The timestamp extraction and parsing logic properly validates dates and handles edge cases well.


454-464: Good practice: Creating minimal public analytics file.

Creating a minimal analytics file in the public directory is a good optimization for frequently accessed summary data.


472-482: Safe command execution for R2 upload.

The R2 upload implementation is secure with hardcoded values and proper error handling.

apps/web/src/app/(home)/analytics/page.tsx (2)

163-163: Consider the implications of hardcoded HSL colors.

The change from CSS variables to explicit HSL values (e.g., "hsl(var(--chart-5))") throughout the chart configurations reduces theming flexibility. If theme customization is important, consider keeping the CSS variable approach.

Also applies to: 182-182, 224-224, 267-267, 301-301, 312-312, 323-323, 334-334, 349-349, 399-399


425-442: Clean data fetching implementation.

The analytics data fetching is well-implemented with proper error handling and loading states.

apps/web/src/components/ui/dropdown-menu.tsx (1)

1-257: Well-implemented dropdown menu component suite.

This is a clean implementation of Radix UI dropdown primitives with proper:

  • Component composition and prop forwarding
  • Accessibility attributes with data-slot markers
  • Consistent styling with Tailwind utilities
  • TypeScript type safety

The implementation follows the established pattern from the template and integrates well with the UI system.

Comment thread apps/web/scripts/generate-analytics.ts Resolved
Comment thread apps/web/src/app/(home)/page.tsx Resolved
Comment thread apps/web/src/app/(home)/page.tsx Resolved
Comment thread apps/web/src/app/llms-full.txt/route.ts Resolved
Comment thread apps/web/src/components/providers.tsx Resolved
Comment thread apps/web/src/lib/get-llm-text.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/web/scripts/generate-analytics.ts (2)

61-61: Consider making the analytics URL configurable.

The hardcoded URL https://r2.amanv.dev/export.csv should be moved to an environment variable or configuration file for better maintainability and flexibility across different environments.


472-473: Consider using a more descriptive bucket name.

The bucket name "bucket" is too generic. Consider using a more descriptive name or making it configurable through environment variables.

-const BUCKET_NAME = "bucket";
+const BUCKET_NAME = process.env.R2_ANALYTICS_BUCKET || "create-t3-app-analytics";
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 641b749 and 95c5df3.

📒 Files selected for processing (4)
  • apps/web/scripts/generate-analytics.ts (5 hunks)
  • apps/web/src/app/(home)/page.tsx (3 hunks)
  • apps/web/src/components/ai/page-actions.tsx (1 hunks)
  • apps/web/src/components/ui/dropdown-menu.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/web/src/components/ui/dropdown-menu.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/components/ai/page-actions.tsx
  • apps/web/src/app/(home)/page.tsx

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