Skip to content

Bringing Project Back Up to standard #62

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 6, 2025
Merged

Bringing Project Back Up to standard #62

merged 12 commits into from
Apr 6, 2025

Conversation

not-ani
Copy link
Contributor

@not-ani not-ani commented Apr 1, 2025

Summary by CodeRabbit

  • New Features
    • Streamlined sign‑in experience featuring Google authentication with responsive loading indicators and a simplified form.
    • Enhanced project management capabilities with updated task and user data fetching methods.
    • Introduced a new authentication module with improved session handling and validation using the arktype library.
    • Added a reset script for cleaning and reinstalling the workspace environment efficiently.
  • User Interface
    • Consistent, simplified navigation and refined layout across marketing and dashboard pages for improved visual clarity.
  • Performance Improvements
    • Upgraded core dependencies and optimized session handling to deliver faster, more reliable performance.
    • Implemented catalog-based dependency management for improved version control.

Copy link
Contributor

coderabbitai bot commented Apr 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes span configuration updates, dependency refactoring, and comprehensive code reorganization across multiple repositories. Authentication has been refactored to use getSession from the new auth module, replacing legacy logic. Several components and API routes have been updated to leverage React Query’s hooks for mutations and data fetching, while the TRPC integration has been streamlined using a context-based approach. Additionally, the database schema and drizzle configuration have been revised, numerous TypeScript and UI formatting adjustments have been applied, and new configuration files (e.g., turbo.json and auth-schema.ts) have been introduced.

Changes

Files Change Summary
.npmrc, .nvmrc, apps/nextjs/tsconfig.json, apps/website/tsconfig.json, turbo.json Updated package manager configurations, Node.js version, and TypeScript compiler options; added turbo.json for TurboRepo.
Root package.json, packages/api/package.json, packages/auth/package.json, packages/db/package.json, packages/ui/package.json, apps/website/package.json Updated dependency versions to catalog references, raised Node and pnpm version requirements, and removed unused dependencies.
Files in apps/nextjs/src/app/(auth)/…, apps/nextjs/src/lib/auth.ts, apps/nextjs/src/components/UserMenu.tsx, and several files in packages/auth/src/… Replaced legacy auth methods with getSession from @amaxa/auth; refactored sign-in flow, API routes, middleware, and client integration.
Files in apps/nextjs/src/app/(dashboard)/project/[id]/*, apps/nextjs/src/app/(home)/_components/*, apps/nextjs/src/trpc/react.tsx, apps/nextjs/src/trpc/server.tsx, packages/api/src/trpc.ts Refactored data fetching to use useSuspenseQuery and useMutation from @tanstack/react-query; revamped TRPC context creation and client export.
packages/db/src/schema.ts, packages/db/drizzle.config.ts, packages/db/src/client.ts Renamed tables and updated schema fields; introduced a new casing option ("snake_case") and modified drizzle client configuration.
Multiple files in apps/website/src/app/(marketing)/*, apps/website/src/components/*, and packages/ui/* Reordered imports, adjusted className formatting, and updated type declarations and JSX layout for consistency and improved readability.
auth-schema.ts, tsup.config.ts, output.txt Introduced new configuration files and an auth schema; added a linting output file detailing compliance issues.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignInUI as "SignIn Component"
    participant AuthClient as "@amaxa/auth/client"
    participant AuthServer as "Auth API"
    
    User->>SignInUI: Click "Sign In with Google"
    SignInUI->>AuthClient: Call signIn.social()
    AuthClient->>AuthServer: Process authentication request
    AuthServer-->>AuthClient: Return session token
    AuthClient-->>SignInUI: Provide session data
    SignInUI->>User: Update UI / Redirect
Loading
sequenceDiagram
    participant Client
    participant TRPCContext as "TRPC Provider"
    participant QueryHook as "@tanstack/react-query"
    participant TRPCServer as "TRPC Endpoint"
    
    Client->>TRPCContext: Initiate data query
    TRPCContext->>QueryHook: Trigger useSuspenseQuery / useMutation
    QueryHook->>TRPCServer: Send request using queryOptions
    TRPCServer-->>QueryHook: Return requested data
    QueryHook-->>TRPCContext: Pass data to provider
    TRPCContext-->>Client: Component renders with data
Loading

Poem

Hop, hop—my code’s a delight,
Every module shines so bright.
New hooks, fresh queries in the night,
Auth flows reformed with all their might.
With each refactor I dance in pure glee,
A bunny’s cheer for our clean code spree! 🐇


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@not-ani not-ani marked this pull request as ready for review April 1, 2025 03:26
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: 21

🔭 Outside diff range comments (4)
.nvmrc (1)

1-2: 💡 Verification agent

🧩 Analysis chain

Verify compatibility with the updated Node.js version

The Node.js version has been updated from 20.12 to 22.14, which is a significant version upgrade. Node.js 22 includes new features, performance improvements, and potentially breaking changes.

Make sure all dependencies in your project are compatible with Node 22. Run the following script to check for any potential issues:


🏁 Script executed:

#!/bin/bash
# Check for any dependencies that might have compatibility issues with Node 22
npm ls | grep -i deprecated || echo "No deprecated packages found"
npm outdated

Length of output: 604


Action Required: Address Missing Dependencies for Node 22 Compatibility

The .nvmrc file now correctly specifies Node 22.14. Our dependency checks (using npm outdated) did not report any deprecated or outdated packages that would raise immediate compatibility concerns with Node 22. However, the output of npm ls produced several "missing" dependency errors (e.g., @amaxa/prettier-config, @turbo/gen, prettier, turbo, and typescript as required by create-t3-turbo). These errors warrant further investigation to ensure that they are a result of workspace configuration and not an indication of unresolved issues that could impact runtime under Node 22.

Please:

  • Review the missing dependency errors and confirm whether these packages should be installed or handled differently in the workspace.
  • Verify that any adjustments made for these dependencies do not introduce incompatibilities under Node 22.
apps/website/src/lib/constants/projects.tsx (1)

22-24: 💡 Verification agent

🧩 Analysis chain

Consider fixing typo in related component.

While not directly part of this PR, I noticed in the related code snippets that the ProjectContentShell component has a prop named "titile" instead of "title". You might want to fix this typo in a future update.


🏁 Script executed:

#!/bin/bash
# Check if the typo exists in the component file
cat apps/website/src/components/project-content/ProjectContentShell.tsx | grep -n "titile"

Length of output: 190


Attention: Correct the Typo in the ProjectContentShell Component

I verified that in apps/website/src/components/project-content/ProjectContentShell.tsx the prop is indeed misspelled as titile (line 10 and line 25). Please update the prop name to title to ensure consistency.

output.txt (1)

1-618: ⚠️ Potential issue

Address critical linting issues affecting the build process.

The output shows numerous TypeScript errors and linting issues across multiple packages, resulting in build failures. The most critical areas to address are:

  1. TypeScript type errors in the API package related to missing exports in the auth module
  2. Unsafe type assertions and non-null assertions throughout the codebase
  3. Unused variables that need to be prefixed with _ to match naming conventions

These errors are preventing successful builds in 6 packages. Focus on fixing the errors in this order:

  1. First address the @amaxa/auth module errors since other packages depend on it
  2. Fix the TypeScript errors in @amaxa/api related to missing exports
  3. Address the unsafe type assertions that are causing most of the linting errors

For the auth module specifically, there seems to be an issue with loading the TypeScript-eslint rules:

TypeError: Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')

This might indicate an incompatibility between your ESLint version (9.5.0) and the TypeScript-eslint plugin. Consider updating your ESLint configuration or downgrading ESLint to a compatible version.

apps/website/src/app/(marketing)/who-we-are/page.tsx (1)

41-44: ⚠️ Potential issue

SVG syntax error

There's a syntax error in the SVG where the strokeLinecap="round" attribute is floating outside of any element. It should be included within the path element on line 38.

    <path
      d="M1 41C1 41 54 10 81 41C108 72 162 10 189 41C216 72 270 41 270 41"
      stroke="#BCD96C"
      strokeWidth="8"
+     strokeLinecap="round"
    />
-   strokeLinecap="round"
🧹 Nitpick comments (23)
packages/db/drizzle.config.ts (1)

13-13: Using snake_case casing for database identifiers is a good practice

Adding casing: "snake_case" to the Drizzle configuration will enforce snake_case naming for database tables and columns, which is the standard convention for PostgreSQL databases.

This ensures consistent naming across your database schema. Make sure that any existing SQL queries or ORM calls that might reference these database entities are updated to use the new snake_case format if they weren't already.

apps/website/src/components/project-content/ProjectContentShell.tsx (1)

9-10: Typo in Header Property Name
It appears the property key "titile" is used instead of "title". This could lead to confusion or integration issues when accessing the header information. Please rename "titile" to "title" for clarity and consistency.

apps/website/src/components/project-content/Nyaka.tsx (1)

9-9: Formatting improvements for consistency

The removal of trailing spaces in paragraph tags improves code formatting consistency.

Consider implementing an automated formatter like Prettier to handle these kinds of formatting tasks consistently across the codebase, which would reduce the need for manual formatting changes in the future.

Also applies to: 20-20, 37-37

apps/website/src/app/_providers/pageview-tracker.tsx (1)

4-4: Clean up of import ordering

The reordering of imports doesn't affect functionality but improves code organization.

For consistently maintaining import order across the project, consider using an automated import sorter tool like eslint-plugin-import with the import/order rule.

apps/nextjs/src/app/(home)/_components/project-cards.tsx (1)

13-15: Query implementation refactored and useless rename

Two issues to address:

  1. The destructuring contains a useless rename const { data: data }
  2. The query has been properly refactored to use React Query's useSuspenseQuery

Remove the useless rename:

-  const { data: data } = useSuspenseQuery(
+  const { data } = useSuspenseQuery(
   api.projects.findAll.queryOptions({}),
 );
🧰 Tools
🪛 Biome (1.9.4)

[error] 13-13: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

apps/nextjs/src/app/(home)/events/_components/CreateEvent.tsx (1)

52-64: Refactored to use React Query's useMutation

Good migration from the tRPC-specific mutation hook to the more standardized React Query approach. This change aligns with modern best practices and maintains the same functionality.

However, I notice that trpc is declared on line 48 but never used in this component. Consider removing it if it's not needed.

-  const trpc = useTRPC();
auth-schema.ts (2)

3-11: Check alignment with existing user table.
These columns closely match a standard user table, but note that the snippet from packages/db/src/schema.ts includes additional fields such as status and role. If you aim to unify schemas, consider adding these fields here or renaming the table to avoid potential duplication.


44-51: Consider default timestamps for createdAt and updatedAt.
Including defaults can improve data consistency if values are not always set at insertion time.

apps/nextjs/src/trpc/react.tsx (1)

35-43: TRPC client configuration looks solid.
The combination of loggerLink and httpBatchStreamLink is a recommended pattern. Consider applying transformer: SuperJSON at the top-level if you need serialization across all calls, though this is optional.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx (1)

42-42: trpc variable is unused.
Consider referencing trpc for these queries, or remove it if no longer needed.

apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx (1)

37-37: Remove unused variable

The trpc constant is declared but never used in this component.

-  const trpc = useTRPC();
apps/website/src/app/(marketing)/newsletter/page.tsx (1)

137-137: Fix contradictory font styles

This line contains both font-light and font-normal which contradict each other. Choose one style for consistency.

-                <p className="text-sm font-light font-normal leading-relaxed text-[#3B3B3B] md:text-sm lg:text-sm">
+                <p className="text-sm font-light leading-relaxed text-[#3B3B3B] md:text-sm lg:text-sm">
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (2)

24-24: Remove unused variable

The trpc constant is declared but never used in this component.

-  const trpc = useTRPC();

43-43: Remove console.log statement

This debug statement should be removed before deploying to production.

-    console.log(permission);
apps/website/src/components/ui/focus-cards.tsx (1)

15-15: Consider using a proper type instead of any

The card prop is typed as any, which reduces type safety. Consider using a more specific type or leveraging the Card interface defined on lines 53-57 for better type checking and autocompletion.

-    card: any;
+    card: Card;
package.json (1)

6-8: Consider aligning pnpm minimum version with packageManager

There's a discrepancy between the minimum pnpm version requirement (>=9.6.0) and the actual packageManager version (10.6.3). Consider aligning these to avoid confusion.

-    "pnpm": ">=9.6.0"
+    "pnpm": ">=10.6.3"
apps/nextjs/src/app/(auth)/sign-in/page.tsx (2)

38-83: Improved authentication flow with better UX

The implementation of the Google sign-in button with loading state and visual feedback is a significant improvement. The use of the SVG icon enhances the user experience.

Consider adding aria-label to the SVG icon for better accessibility:

 <svg
   xmlns="http://www.w3.org/2000/svg"
   width="0.98em"
   height="1em"
   viewBox="0 0 256 262"
+  aria-label="Google logo"
+  role="img"
 >

41-57: Ensure proper error handling during sign-in

The sign-in process handles the loading state but doesn't appear to handle potential errors. Consider adding error handling.

 onClick={async () => {
-  await signIn.social(
+  try {
+    await signIn.social(
     {
       provider: "google",
       callbackURL: "/",
     },
     {
       onRequest: () => {
         setLoading(true);
       },
       onResponse: () => {
         setLoading(false);
       },
     },
-  );
+    );
+  } catch (error) {
+    setLoading(false);
+    // Add error handling here, e.g., toast notification
+    console.error("Sign-in failed:", error);
+  }
 }}
apps/website/src/app/(marketing)/project/page.tsx (2)

29-54: Add appropriate ARIA attributes to inline SVG for decorative elements.
If the SVG is purely decorative, consider adding aria-hidden="true" or role="presentation" to improve accessibility.

<svg
+  aria-hidden="true"
+  role="presentation"
  viewBox="0 0 325 500"
  ...

67-83: Spelling fix suggestion: standardize "LBGTQ+" to "LGBTQ+".
Consider updating the text to match conventional usage.

- ...focusing on {" "}<strong>mental health, feminism, and LBGTQ+ representation.</strong>...
+ ...focusing on {" "}<strong>mental health, feminism, and LGBTQ+ representation.</strong>...
packages/db/src/schema.ts (1)

15-22: Consider providing a default value for emailVerified.
Currently, emailVerified is notNull() with no default. If new user records typically start unverified, you might want default(false) to prevent insertion errors.

-emailVerified: boolean("email_verified").notNull(),
+emailVerified: boolean("email_verified").notNull().default(false),
apps/website/src/app/layout.tsx (1)

80-80: Consider error handling for the analytics provider

While the PostHog integration looks good, it would be beneficial to ensure that the PostHogProvider handles potential initialization errors gracefully to prevent application crashes if the analytics service is unavailable.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx (1)

1-1: Update ESLint disable comment

Since you've removed most non-null assertions in this file, consider updating or removing this ESLint disable comment to make it more targeted or to remove it if no longer needed.

-/** eslint-disable @typescript-eslint/no-non-null-assertion */
+// Only disable for the avatar image which we ensure exists
+/** eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 18f2094 and ce473c2.

⛔ Files ignored due to path filters (3)
  • packages/api/.cache/tsbuildinfo.json is excluded by !**/.cache/**
  • packages/db/.cache/tsbuildinfo.json is excluded by !**/.cache/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (107)
  • .npmrc (1 hunks)
  • .nvmrc (1 hunks)
  • apps/nextjs/package.json (1 hunks)
  • apps/nextjs/src/app/(auth)/sign-in/page.tsx (1 hunks)
  • apps/nextjs/src/app/(auth)/unverified/page.tsx (1 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx (2 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx (1 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/add-user-form.tsx (2 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx (1 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (1 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/settings/_components/update-project-info.tsx (3 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts (2 hunks)
  • apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx (2 hunks)
  • apps/nextjs/src/app/(home)/_components/project-cards.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/_components/sidebar.tsx (2 hunks)
  • apps/nextjs/src/app/(home)/admin/_components/form.tsx (2 hunks)
  • apps/nextjs/src/app/(home)/admin/_components/table.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/events/_components/CreateEvent.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/guides/action-guides/_components/GuideCard.tsx (2 hunks)
  • apps/nextjs/src/app/(home)/guides/action-guides/_components/create-action-guide.tsx (2 hunks)
  • apps/nextjs/src/app/(home)/loading.tsx (4 hunks)
  • apps/nextjs/src/app/_components/flow-provider.tsx (1 hunks)
  • apps/nextjs/src/app/api/auth/[...all]/route.ts (1 hunks)
  • apps/nextjs/src/app/api/auth/[...nextauth]/route.ts (0 hunks)
  • apps/nextjs/src/app/api/trpc/[trpc]/route.ts (3 hunks)
  • apps/nextjs/src/components/UserMenu.tsx (2 hunks)
  • apps/nextjs/src/components/calendar-full.tsx (3 hunks)
  • apps/nextjs/src/components/layout-tabs.tsx (0 hunks)
  • apps/nextjs/src/lib/auth.ts (1 hunks)
  • apps/nextjs/src/middleware.ts (1 hunks)
  • apps/nextjs/src/trpc/query-client.ts (1 hunks)
  • apps/nextjs/src/trpc/react.tsx (3 hunks)
  • apps/nextjs/src/trpc/server.ts (0 hunks)
  • apps/nextjs/src/trpc/server.tsx (1 hunks)
  • apps/nextjs/tsconfig.json (1 hunks)
  • apps/nextjs/turbo.json (1 hunks)
  • apps/website/next.config.js (1 hunks)
  • apps/website/package.json (2 hunks)
  • apps/website/src/app/(marketing)/_sections/hero.tsx (17 hunks)
  • apps/website/src/app/(marketing)/_sections/project-shell.tsx (6 hunks)
  • apps/website/src/app/(marketing)/_sections/spotlight.tsx (2 hunks)
  • apps/website/src/app/(marketing)/_sections/take-action.tsx (2 hunks)
  • apps/website/src/app/(marketing)/layout.tsx (1 hunks)
  • apps/website/src/app/(marketing)/newsletter/page.tsx (2 hunks)
  • apps/website/src/app/(marketing)/page.tsx (5 hunks)
  • apps/website/src/app/(marketing)/program/page.tsx (22 hunks)
  • apps/website/src/app/(marketing)/project/[id]/page.tsx (1 hunks)
  • apps/website/src/app/(marketing)/project/page.tsx (1 hunks)
  • apps/website/src/app/(marketing)/who-we-are/_components/people.tsx (1 hunks)
  • apps/website/src/app/(marketing)/who-we-are/page.tsx (4 hunks)
  • apps/website/src/app/_providers/pageview-tracker.tsx (1 hunks)
  • apps/website/src/app/_providers/posthog-provider.tsx (1 hunks)
  • apps/website/src/app/layout.tsx (1 hunks)
  • apps/website/src/components/animated-list-landing.tsx (1 hunks)
  • apps/website/src/components/apply.tsx (3 hunks)
  • apps/website/src/components/bento-landing.tsx (2 hunks)
  • apps/website/src/components/footer.tsx (3 hunks)
  • apps/website/src/components/header.tsx (2 hunks)
  • apps/website/src/components/platform/beam-section.tsx (1 hunks)
  • apps/website/src/components/platform/platform-hero.tsx (1 hunks)
  • apps/website/src/components/project-content/Gaza.tsx (3 hunks)
  • apps/website/src/components/project-content/Nyaka.tsx (3 hunks)
  • apps/website/src/components/project-content/ProjectContentShell.tsx (1 hunks)
  • apps/website/src/components/project-content/_components/person-card.tsx (1 hunks)
  • apps/website/src/components/ui/apple-cards.tsx (4 hunks)
  • apps/website/src/components/ui/bento-grid.tsx (1 hunks)
  • apps/website/src/components/ui/focus-cards.tsx (2 hunks)
  • apps/website/src/components/ui/layout-grid.tsx (1 hunks)
  • apps/website/src/components/ui/linear-gradient.tsx (1 hunks)
  • apps/website/src/components/ui/magic-card.tsx (2 hunks)
  • apps/website/src/components/ui/marquee.tsx (0 hunks)
  • apps/website/src/components/ui/navigation-menu.tsx (1 hunks)
  • apps/website/src/components/ui/radial-graident.tsx (1 hunks)
  • apps/website/src/components/ui/shine-border.tsx (1 hunks)
  • apps/website/src/components/ui/span-cards.tsx (2 hunks)
  • apps/website/src/components/ui/sticky-scroll-reveal.tsx (1 hunks)
  • apps/website/src/components/ui/wobble-card.tsx (1 hunks)
  • apps/website/src/lib/constants/projects.tsx (4 hunks)
  • apps/website/src/lib/projects.ts (11 hunks)
  • apps/website/src/lib/utils.ts (1 hunks)
  • apps/website/tailwind.config.ts (2 hunks)
  • apps/website/tsconfig.json (0 hunks)
  • apps/website/turbo.json (1 hunks)
  • auth-schema.ts (1 hunks)
  • output.txt (1 hunks)
  • package.json (2 hunks)
  • packages/api/package.json (1 hunks)
  • packages/api/src/trpc.ts (2 hunks)
  • packages/api/tsconfig.json (0 hunks)
  • packages/auth/package.json (2 hunks)
  • packages/auth/src/actions.ts (0 hunks)
  • packages/auth/src/auth.ts (1 hunks)
  • packages/auth/src/client.ts (1 hunks)
  • packages/auth/src/config.ts (0 hunks)
  • packages/auth/src/index.rsc.ts (1 hunks)
  • packages/auth/src/index.ts (1 hunks)
  • packages/auth/src/middleware.ts (1 hunks)
  • packages/auth/src/permissions.ts (0 hunks)
  • packages/auth/src/types.ts (1 hunks)
  • packages/auth/tsconfig.json (1 hunks)
  • packages/auth/tsup.config.ts (1 hunks)
  • packages/db/drizzle.config.ts (1 hunks)
  • packages/db/package.json (1 hunks)
  • packages/db/src/client.ts (1 hunks)
  • packages/db/src/schema.ts (5 hunks)
  • packages/db/tsconfig.json (0 hunks)
  • packages/ui/package.json (1 hunks)
⛔ Files not processed due to max files limit (24)
  • packages/ui/src/button.tsx
  • packages/ui/src/carousel.tsx
  • packages/ui/src/chart.tsx
  • packages/ui/src/command.tsx
  • packages/ui/src/dialog.tsx
  • packages/ui/src/navigation-menu.tsx
  • packages/ui/src/sheet.tsx
  • pnpm-workspace.yaml
  • tooling/eslint/base.js
  • tooling/eslint/package.json
  • tooling/eslint/react.js
  • tooling/eslint/tsconfig.json
  • tooling/eslint/types.d.ts
  • tooling/github/setup/action.yml
  • tooling/prettier/index.js
  • tooling/prettier/package.json
  • tooling/prettier/tsconfig.json
  • tooling/tailwind/package.json
  • tooling/tailwind/tsconfig.json
  • tooling/typescript/base.json
  • tooling/typescript/internal-package.json
  • turbo.json
  • turbo/generators/templates/package.json.hbs
  • turbo/generators/templates/tsconfig.json.hbs
💤 Files with no reviewable changes (10)
  • packages/db/tsconfig.json
  • apps/website/tsconfig.json
  • packages/api/tsconfig.json
  • apps/nextjs/src/components/layout-tabs.tsx
  • apps/website/src/components/ui/marquee.tsx
  • apps/nextjs/src/trpc/server.ts
  • packages/auth/src/permissions.ts
  • packages/auth/src/actions.ts
  • packages/auth/src/config.ts
  • apps/nextjs/src/app/api/auth/[...nextauth]/route.ts
🧰 Additional context used
🧬 Code Definitions (15)
packages/auth/src/types.ts (1)
packages/auth/src/auth.ts (1)
  • auth (37-37)
auth-schema.ts (1)
packages/db/src/schema.ts (4)
  • user (15-30)
  • session (38-49)
  • account (51-67)
  • verification (69-76)
apps/nextjs/src/middleware.ts (1)
packages/auth/src/middleware.ts (1)
  • authMiddleware (7-24)
packages/auth/src/index.rsc.ts (2)
packages/auth/src/index.ts (1)
  • getSession (4-7)
packages/auth/src/auth.ts (1)
  • auth (37-37)
apps/website/src/app/(marketing)/_sections/spotlight.tsx (1)
apps/website/src/lib/projects.ts (1)
  • SpotlightData (1-9)
packages/auth/src/auth.ts (1)
apps/nextjs/src/middleware.ts (1)
  • config (6-8)
apps/website/src/lib/constants/projects.tsx (1)
apps/website/src/components/project-content/ProjectContentShell.tsx (1)
  • ProjectContentShell (8-63)
apps/website/src/app/(marketing)/newsletter/page.tsx (1)
apps/website/src/components/apply.tsx (1)
  • ApplyButton (70-79)
apps/nextjs/src/components/UserMenu.tsx (3)
auth-schema.ts (2)
  • session (13-24)
  • user (3-11)
packages/auth/src/index.rsc.ts (1)
  • getSession (5-8)
packages/auth/src/index.ts (1)
  • getSession (4-7)
apps/website/src/components/ui/apple-cards.tsx (2)
apps/website/src/components/ui/focus-cards.tsx (1)
  • Card (8-49)
apps/website/src/components/ui/span-cards.tsx (1)
  • Card (42-61)
apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (1)
apps/nextjs/src/lib/types/index.tsx (1)
  • ProjectRoles (1-1)
apps/website/src/components/ui/focus-cards.tsx (2)
apps/website/src/lib/utils.ts (1)
  • cn (42-44)
apps/website/src/components/ui/apple-cards.tsx (1)
  • Card (150-194)
apps/website/src/app/(marketing)/_sections/hero.tsx (1)
apps/website/src/components/apply.tsx (1)
  • ApplyButton (70-79)
apps/nextjs/src/trpc/server.tsx (3)
apps/nextjs/src/trpc/react.tsx (1)
  • createTRPCContext (30-30)
packages/api/src/trpc.ts (1)
  • createTRPCContext (28-36)
apps/nextjs/src/trpc/query-client.ts (1)
  • createQueryClient (7-33)
packages/db/src/schema.ts (1)
auth-schema.ts (4)
  • user (3-11)
  • account (26-42)
  • session (13-24)
  • verification (44-51)
🪛 Biome (1.9.4)
apps/nextjs/src/app/(home)/_components/project-cards.tsx

[error] 13-13: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

🪛 GitHub Actions: CI
packages/auth/src/auth.ts

[error] 1-1: ESLint: Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')

🪛 GitHub Check: lint
apps/website/src/app/(marketing)/_sections/hero.tsx

[warning] 49-49:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 49-49:
Forbidden non-null assertion


[warning] 258-258:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 258-258:
Forbidden non-null assertion


[warning] 287-287:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 287-287:
Forbidden non-null assertion


[warning] 286-286:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 286-286:
Forbidden non-null assertion


[warning] 313-313:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 313-313:
Forbidden non-null assertion

🔇 Additional comments (195)
apps/website/src/app/(marketing)/layout.tsx (1)

2-2: LGTM!

This is a minor formatting change adding a blank line after the import statement, which improves readability.

apps/website/src/components/animated-list-landing.tsx (1)

73-73: LGTM!

This change removes a trailing whitespace in the className string, which is a good practice for code cleanliness.

apps/website/src/components/platform/beam-section.tsx (1)

31-31: Clean formatting improvement.

The extra space has been removed from the className attribute, improving code consistency.

packages/auth/src/types.ts (1)

1-3: Good type export for enhanced type safety.

Exporting the Session type from the auth module provides proper type definitions for session handling throughout the application, enhancing type safety when working with authentication.

apps/nextjs/src/app/api/auth/[...all]/route.ts (1)

1-5: Clean implementation of auth route handlers.

The code effectively creates API route handlers for both GET and POST methods using the auth handlers from the authentication module. This is a standard pattern for Next.js API routes and follows best practices for route handling.

apps/website/src/components/platform/platform-hero.tsx (1)

54-54: Clean formatting improvement.

The extra space has been removed from the className attribute, improving code consistency.

apps/website/src/components/project-content/ProjectContentShell.tsx (1)

38-41: Cosmetic Formatting Update in Paragraph Element
The trailing whitespace removal in the <p> tag improves code consistency without affecting functionality.

apps/website/src/components/ui/layout-grid.tsx (1)

32-32: Cleaned Up ClassName Formatting
The adjustment to the <div> element's className (removing an extra space) enhances consistency and readability without impacting functionality.

packages/auth/src/client.ts (1)

1-4: Solid Initialization of the Authentication Client
The new file cleanly imports and initializes the auth client using createAuthClient from "better-auth/react", and it neatly exports the key authentication methods (signIn, signOut, signUp, useSession). Confirm that any existing references in the codebase have been updated to use this new API.

apps/website/src/app/_providers/posthog-provider.tsx (1)

5-6: Improved Import Order for PostHog Modules
Reordering the imports to group posthog and PostHogProvider together aids in code readability and reflects a clear separation of concerns. No functional changes are introduced.

apps/website/src/components/ui/bento-grid.tsx (1)

1-1: Adopting Type-Only Import for ReactNode
Switching to a type-only import for ReactNode is a best practice; it clarifies that the import is used solely for type checking and avoids unnecessary inclusion in the runtime bundle.

apps/nextjs/src/trpc/query-client.ts (1)

20-27: Well-documented error handling configuration for Next.js 15 compatibility

The addition of shouldRedactErrors function with clear comments is excellent. This change correctly configures error handling for compatibility with Next.js 15's approach to detecting dynamic pages while letting Next.js handle error redaction with its own improved mechanisms.

apps/website/src/app/(marketing)/project/[id]/page.tsx (1)

2-4: Improved import organization

The reordering of imports and adjustment of blank lines improves code readability without affecting functionality.

apps/website/src/components/ui/linear-gradient.tsx (1)

1-1: Improved import syntax using type-only import.

The change to a type-only import for CSSProperties is a good practice since this is only used for type checking. This helps clarify intent and may lead to slightly smaller bundle sizes as type imports are removed during transpilation.

apps/website/turbo.json (1)

1-13: Good addition of Turborepo configuration.

This new file correctly configures Turborepo with:

  • Proper schema reference
  • Inheritance from base configuration
  • Appropriate build dependencies and output definitions
  • Correct persistent flag for dev task

This will improve build and development workflows in the monorepo.

apps/nextjs/src/app/(auth)/unverified/page.tsx (1)

12-12:

✅ Verification successful

Potential null reference issue by removing optional chaining.

The removal of optional chaining (?.) when accessing auth.user.status could lead to runtime errors if auth or auth.user is undefined.

Verify that auth.user is guaranteed to be defined at this point or restore the optional chaining:

-if (auth.user.status === "Unverified" || auth.user.status === "Pending") {
+if (auth.user?.status === "Unverified" || auth.user?.status === "Pending") {

🏁 Script executed:

#!/bin/bash
# Check if auth.user is guaranteed to be defined by checking the checkAuth implementation

# First, let's look at the checkAuth implementation
if [ -f "apps/nextjs/src/lib/auth.ts" ]; then
  echo "=== Checking auth implementation ==="
  cat "apps/nextjs/src/lib/auth.ts"
fi

# Let's also check if there are any other references to auth.user without optional chaining
echo -e "\n=== Checking for other direct references to auth.user ==="
rg -A 2 -B 2 "auth\.user" --no-ignore | grep -v "auth\.user\?"

Length of output: 1282


Verification confirmed: Removal of optional chaining is safe in this context.

The check in the checkAuth implementation ensures that if no session is returned (i.e. auth is null), a redirection to /sign-in is triggered. This, along with similar usage patterns elsewhere (e.g., in the dashboard layout), indicates that when execution reaches this point, auth.user is guaranteed to be defined, making the use of auth.user.status safe without optional chaining.

apps/website/tailwind.config.ts (2)

3-3: Added missing semicolon for consistent code style.

Good change to maintain code style consistency.


95-95: Added missing semicolon for consistent code style.

Properly terminated the statement with a semicolon, which maintains consistency in the codebase.

apps/nextjs/turbo.json (1)

1-13: Well-structured Turborepo configuration

This new configuration file properly sets up Turborepo for the Next.js application with appropriate task definitions for build and dev processes. The configuration correctly specifies build dependencies and output files, which will improve the build efficiency in the monorepo setup.

apps/website/next.config.js (1)

7-11: Consistent string quote style

The change from single quotes to double quotes for string properties maintains consistency with the project's coding style. This type of standardization improves code readability across the codebase.

apps/website/src/components/ui/wobble-card.tsx (1)

47-47: Cleaned up className formatting

The removal of extra whitespace in the className string improves code cleanliness and consistency. This type of formatting standardization helps maintain a more readable codebase.

apps/nextjs/src/app/_components/flow-provider.tsx (1)

14-14: Removed SessionProvider wrapper

The SessionProvider has been removed from the component hierarchy. This change aligns with the broader authentication refactoring mentioned in the PR summary, which now uses the new auth module instead of the previous session-based approach.

Make sure this change doesn't break authentication in the Flow components. Verify that any components using session data within the ReactFlow context can still access it through the new authentication mechanism.

apps/website/src/components/ui/radial-graident.tsx (1)

1-1: Good use of type-only import.

Changing to a type-only import is a TypeScript best practice as it clarifies that CSSProperties is only used for type checking and not at runtime, which can help with tree-shaking and bundle size optimization.

apps/website/src/components/project-content/_components/person-card.tsx (1)

17-17: Good cleanup of whitespace in className string.

Removing the extra whitespace in the className string improves code consistency and readability without affecting functionality.

apps/nextjs/src/lib/auth.ts (2)

3-3: Good authentication module refactoring.

Importing getSession from the new auth module aligns with the PR objective of updating to the latest tech. This is part of a broader refactoring of authentication handling across the codebase.


6-6:

✅ Verification successful

Consistent implementation of new auth pattern.

Replacing auth() with getSession() maintains the same functionality while using the updated authentication pattern. This change should be applied consistently across all auth-related files.


🏁 Script executed:

#!/bin/bash
# Verify that the auth to getSession migration is consistent across the codebase
echo "Checking for remaining usage of the old auth() function:"
rg "await auth\(\)" --type ts
echo "\nChecking adoption of new getSession() function:"
rg "await getSession\(\)" --type ts

Length of output: 645


Verified Consistent Usage of Updated Auth Pattern

The shell script confirms that all usages of the old auth() have been replaced with getSession() across the codebase. Specifically, the following files correctly adopt the new auth pattern:

  • apps/nextjs/src/lib/auth.ts
  • apps/nextjs/src/components/UserMenu.tsx
  • apps/nextjs/src/app/(home)/_components/sidebar.tsx
  • apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts

No instances of the old auth() remain, so the updated authentication implementation is consistent.

apps/nextjs/src/app/(home)/loading.tsx (4)

1-2: Import statements have been formatted with semicolons.

The import statements now include semicolons, providing consistent formatting throughout the codebase.


15-18: Props formatting improves readability.

The Card component props have been reformatted to place each prop on its own line, enhancing code readability and consistency with modern React formatting practices.


33-36: Consistent prop formatting applied to second Card instance.

Similar formatting improvements have been applied to the second Card component instance, maintaining consistency throughout the file.


49-49: Function return statement formatting.

The closing parenthesis for the return statement has been properly formatted, providing clean code structure.

apps/website/src/components/ui/navigation-menu.tsx (1)

72-72: Removed trailing whitespace from className string.

The trailing whitespace in the className string has been removed, improving code cleanliness. This is a good practice to maintain consistent formatting.

packages/db/src/client.ts (1)

6-10:

❓ Verification inconclusive

Updated drizzle initialization to use the new API format.

The drizzle client initialization has been updated to match the newer API format, using an object with client, schema, and casing properties. This change aligns with the drizzle-orm upgrade from ^0.31.2 to ^0.41.0 mentioned in the package.json changes.

The addition of casing: "snake_case" ensures consistent naming conventions between your database and code.


🏁 Script executed:

#!/bin/bash
# Check if other places in the codebase are using the updated drizzle initialization pattern

# Look for any other drizzle initializations that might need updating
rg "drizzle\(.*\)" --type ts --not-file "packages/db/src/client.ts"

Length of output: 509


Drizzle Initialization Update Verification

The drizzle client initialization in packages/db/src/client.ts (lines 6–10) now correctly uses the new API format with an object containing the client, schema, and casing properties. This update aligns with the upgrade to drizzle-orm ^0.41.0 and ensures that snake_case naming is enforced between your database and code.

To double-check that there aren’t any residual instances of the old initialization pattern elsewhere in the codebase, please run the following script manually:

#!/bin/bash
# Verify that no deprecated drizzle initialization patterns are present outside of packages/db/src/client.ts
rg "drizzle\s*\(" -g '!packages/db/src/client.ts' --type ts

If additional occurrences are found, please update them accordingly. Otherwise, you can proceed with approving the change.

apps/website/src/components/bento-landing.tsx (2)

44-44: Removed trailing whitespace from Marquee className.

The trailing whitespace in the Marquee component's className has been removed, improving code cleanliness.


58-58: Removed trailing whitespace from figcaption className.

The trailing whitespace in the figcaption element's className has been removed, maintaining consistent formatting.

apps/website/src/components/ui/shine-border.tsx (1)

41-41: Code cleanup - good spacing adjustment.

Removed an extra space in the className string which improves code formatting consistency.

apps/website/src/components/ui/sticky-scroll-reveal.tsx (2)

2-2: Looks good.

Proper spacing in the import section.


5-5: Good import organization.

Consolidated the motion-related imports into a single import statement, which improves code cleanliness and maintainability.

apps/website/src/components/project-content/Gaza.tsx (1)

11-11: Good formatting cleanup.

Removed trailing spaces in the paragraph opening tags, improving code consistency and cleanliness.

Also applies to: 24-24, 40-40

apps/website/src/components/ui/magic-card.tsx (2)

4-5: Improved TypeScript imports.

Changed to a type-only import for the React types and separated the runtime hooks import, which is a better practice that clearly distinguishes between type imports and runtime imports.


45-45: More concise type declaration.

Changed the type annotation from Array<HTMLElement> to the more concise HTMLElement[] syntax, which is the preferred TypeScript array type notation.

packages/auth/tsup.config.ts (1)

1-12: Configuration for TypeScript bundling looks well structured.

This is a well-configured tsup setup for bundling the authentication module. The configuration properly defines the entry point, supports both ESM and CJS formats, and generates TypeScript declaration files.

apps/nextjs/src/middleware.ts (1)

1-3: Good simplification of authentication middleware.

Refactoring to use the centralized authMiddleware from the auth package is a positive change that improves maintainability and consistency. This aligns well with the project's goal of updating to the latest tech stack.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx (1)

8-16: Good refactoring to separate React Query from TRPC

The migration from TRPC's built-in React Query hooks to using React Query directly with TRPC's query options is a good architectural improvement. It provides better separation of concerns and aligns with modern best practices.

apps/nextjs/tsconfig.json (2)

4-4: Casing change in TypeScript lib option

The casing change from "es2022" to "ES2022" is a minor standardization. This aligns with the official TypeScript documentation which uses uppercase for ECMAScript version names.


7-9:

❓ Verification inconclusive

Removed path alias may require import updates

The removal of the "@/*" path alias could affect existing import statements throughout the codebase. Ensure all imports have been updated to use the "~/*" alias instead.

Run this script to check if there are still imports using the removed alias pattern:


🏁 Script executed:

#!/bin/bash
# Find any remaining imports using the @/* pattern
echo "Checking for imports using the removed @/* pattern..."
rg "from\s+['\"]@/" --type=tsx --type=ts

Length of output: 189


Below is an updated review comment. It now includes instructions to run a revised verification script (using a glob pattern for both TS and TSX files) to ensure that no residual @/* imports remain. The tag has been appended since we now need further manual verification with the new script.


Action Required: Verify Removal of the @/* Alias

File: apps/nextjs/tsconfig.json (Lines 7-9)

Snippet:

    "paths": {
      "~/*": ["./src/*"]
    },

Comment:
The previous removal of the "@/*" alias may still affect import statements if any instances remain in the codebase. The initial verification script encountered a file type error with TSX files. Please re-run the updated verification script below to search for any imports using the old alias:

#!/bin/bash
# Revised check for imports using the removed @/* pattern across TS and TSX files
echo "Checking for imports using the removed @/* pattern in .ts and .tsx files..."
rg "from\s+['\"]@/" -g "*.{ts,tsx}"

If any imports are found that still reference "@/*", update them to use "~/*" instead.

apps/nextjs/src/app/(home)/guides/action-guides/_components/GuideCard.tsx (2)

3-3: Added "use client" directive

Adding the "use client" directive is good as it explicitly marks this component as a client component in Next.js, which is necessary when using hooks and client-side APIs.


19-25: Good refactoring to separate React Query from TRPC

The migration from TRPC's built-in React Query hooks to using React Query directly with TRPC's query options is a good architectural improvement that provides better separation of concerns.

apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts (2)

6-6: Authentication method updated to use getSession

This change aligns with the broader refactoring to standardize authentication patterns across the application.


56-56: Authentication implementation properly updated

The implementation has been correctly updated to use getSession() instead of auth() while maintaining the same security check for user authentication.

apps/nextjs/src/app/(home)/admin/_components/form.tsx (3)

29-29: React Query import added correctly

This aligns with the standardization to use React Query directly for data mutations.


41-44: Type changed to interface

This is a minor styling change that doesn't affect functionality.


49-61: Mutation implementation refactored to use React Query directly

The code has been updated to use React Query's useMutation with TRPC's mutationOptions. This is a good refactoring that maintains the same functionality while standardizing the approach to mutations.

apps/nextjs/src/app/(home)/_components/project-cards.tsx (1)

9-9: React Query import added correctly

This aligns with the standardization to use React Query directly for data fetching.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/settings/_components/update-project-info.tsx (2)

30-30: React Query import added correctly

This aligns with the standardization to use React Query directly for data mutations.


62-72: Mutation implementation refactored to use React Query directly

The code has been updated to use React Query's useMutation with TRPC's mutationOptions. This is a good refactoring that maintains the same functionality while standardizing the approach to mutations.

apps/website/src/app/(marketing)/who-we-are/_components/people.tsx (1)

22-22: Class name reorganization looks good!

The restructuring of class names maintains the same styling while improving consistency with other components in the project.

Also applies to: 24-26, 29-32

packages/auth/tsconfig.json (1)

4-6: TypeScript compiler options have been enhanced!

The added compiler options improve the project's TypeScript configuration:

  • downlevelIteration: Enables better array/iterable support in older JavaScript environments
  • useDefineForClassFields: Ensures class fields follow ECMAScript standards
  • skipLibCheck: Improves build performance by skipping type checking of declaration files

These are beneficial changes that follow modern TypeScript best practices.

apps/nextjs/src/app/(home)/_components/sidebar.tsx (1)

6-6: Auth module refactoring looks good

The change from auth() to getSession() is consistent with the broader authentication refactoring mentioned in the summary. The new approach maintains the same functional behavior while standardizing session management across the codebase.

Also applies to: 19-19

apps/website/src/app/(marketing)/page.tsx (2)

5-9: Import reorganization looks good

The reordering of imports improves code readability and organization.


120-168: Spotlight data structure improved

Converting the spotlight data to a structured array with consistent fields improves maintainability and makes the code more readable.

apps/website/src/lib/utils.ts (1)

1-2: TypeScript type import improvement

Separating the type import from the value import follows TypeScript best practices. Using import type ensures that type information doesn't affect the runtime bundle.

apps/nextjs/src/app/api/trpc/[trpc]/route.ts (2)

4-6: Added Edge runtime and improved type safety

The changes add proper TypeScript typing for the request parameter and explicitly set the Edge runtime, which should improve performance for this API route.


27-43:

✅ Verification successful

Authentication pattern updated

The auth wrapper has been removed from the handler function, which aligns with the broader authentication refactoring in the codebase. The authentication is now likely handled in the createTRPCContext function instead.

Let's verify that authentication is properly maintained in this new approach:


🏁 Script executed:

#!/bin/bash
# Search for how createTRPCContext handles authentication now
grep -rn "createTRPCContext" --include="*.ts" --include="*.tsx" . | head -10
cat $(find . -path "*packages/api/src/trpc*" -type f | head -1)

Length of output: 4045


Authentication Refactoring Verified: Authentication is properly managed via the new context

The removal of the auth wrapper from the handler in apps/nextjs/src/app/api/trpc/[trpc]/route.ts is correct. The updated createTRPCContext in packages/api/src/trpc.ts now retrieves the session via auth.api.getSession using the request headers, and the protectedProcedure further ensures that only authenticated users are granted access. This confirms that the overall approach to authentication refactoring is sound.

  • Verified that createTRPCContext correctly fetches the session using the auth.api.getSession call.
  • Confirmed that the authentication check in protectedProcedure is appropriately implemented.
apps/website/src/components/header.tsx (1)

2-17: Improved import organization

The imports have been reorganized to follow a more consistent pattern, with client-side React imports at the top, followed by UI component imports. This improves code readability and maintainability.

apps/nextjs/src/components/UserMenu.tsx (2)

4-4: Authentication approach updated

Import changed from auth to getSession, aligning with the codebase's authentication refactoring.


20-20: Updated session retrieval method

The session retrieval now uses the new getSession() function instead of auth(), which is part of the broader authentication refactoring.

apps/website/src/components/apply.tsx (5)

2-8: Improved import organization

The imports have been reorganized for better readability, with React imports at the top, followed by next/navigation, then UI components. This follows best practices for import ordering.


34-34: Reordered CSS classes

The CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.


43-43: Reordered CSS classes

The CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.


51-55: Reordered CSS classes and component properties

The CSS classes have been reordered and the ArrowRight component's className properties have been reordered from w-5 h-5 to h-5 w-5. This maintains the same styling but follows a more consistent pattern.


61-61: Reordered CSS classes

The CSS classes have been reordered but maintain the same styling. This is likely for consistency with the project's CSS class ordering conventions.

auth-schema.ts (3)

1-2: Imports look good.
The drizzle-orm/pg-core import is correctly set up.


13-24: Session table implementation looks consistent.
No immediate issues. Columns and foreign key constraints align well with a typical session design.


26-42: Account table implementation is clear.
All references and optional tokens are well-defined.

apps/nextjs/src/trpc/react.tsx (3)

6-11: Imports updated to the new TRPC approach.
Switching from unstable_httpBatchStreamLink to httpBatchStreamLink and adding createTRPCContext is correct for the new library structure.


30-30: Context-based TRPC usage is appropriate.
Exporting { useTRPC, TRPCProvider } from createTRPCContext aligns with the new, more flexible API.


58-60: Usage of <TRPCProvider> is well-integrated.
Wrapping the queryClient and trpcClient is a clean approach for handling both React Query and TRPC contexts.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/_components/ChartData.tsx (4)

32-32: Correct import for useSuspenseQuery.
Ensures alignment with the new TanStack approach.


43-47: Refactored query for task data is consistent.
Calling useSuspenseQuery with api.tasks.getTasksOverTime.queryOptions(...) is a clean approach for strongly typed data.


48-52: Priority data fetching approach looks correct.
Matches the suspense query pattern introduced above.


53-57: Status data loading is properly handled.
Once again, consistency in suspense query usage is beneficial for clarity and maintainability.

packages/auth/src/index.rsc.ts (3)

2-3: Imports for Next.js and local auth module are valid.
No issues with the headers import or the local auth reference.


5-8: Caching session retrieval is a neat optimization.
Using cache(auth.api.getSession) can improve performance, but consider any edge cases where the session might expire or become invalid.


10-10: Exporting everything from ./auth is straightforward.
This re-export approach helps centralize your auth functionality in one place.

apps/website/src/lib/constants/projects.tsx (4)

33-34: Improved title formatting for better readability.

Breaking long titles into multiple lines improves code readability while maintaining the same functionality.


49-64: Good restructuring of the Karina's Library project entry.

The reformatting makes this entry consistent with the structure of other projects in the array.


104-105: Consistent formatting improvement for LGBTQ+ project title.

Breaking this long title across multiple lines matches the formatting style used for other projects.


121-122: Consistent formatting improvement for Mental Health project title.

The multi-line formatting improves readability and maintains consistency with other project titles.

apps/website/src/components/footer.tsx (6)

3-3: Added helpful import comment.

The added comment clarifies the purpose of the Link import, which is helpful for maintainability.


7-14: Improved class name ordering and formatting.

The reordering of class names and restructuring of elements makes the code more consistent and readable without changing functionality.


15-28: Enhanced newsletter section formatting.

The newsletter section has been reformatted with more consistent class name ordering and better indentation.


34-35: Consistent formatting for container and navigation elements.

The container and navigation elements have been reformatted with consistent class name ordering.

Also applies to: 41-43


62-77: Improved Link component formatting.

The Link components have been reformatted with consistent attributes and line breaks.


85-92: Better comment formatting.

The commented-out section has been formatted more consistently with the rest of the code.

apps/website/src/components/ui/span-cards.tsx (3)

22-22: Removed extra spaces in className string.

Removing unnecessary spaces in the className string improves code cleanliness without changing functionality.


27-27: Consistent formatting for div element.

The div element has been reformatted for consistency with the project's coding style.


52-52: Removed extra spaces in MagicCard className string.

Removing unnecessary spaces in the className string improves code cleanliness and readability.

apps/website/src/app/(marketing)/program/page.tsx (7)

8-46: Improved header section formatting.

The header section has been reformatted with more consistent class name ordering and better structure for the SVG element, improving readability while maintaining functionality.


91-92: Enhanced section container formatting.

Section containers have been reformatted with consistent class name ordering for better readability.


97-107: Consistent heading and paragraph formatting.

Headings and paragraphs have been reformatted with consistent class name ordering throughout the component.


158-207: Standardized program sections formatting.

The high school and college program sections have been reformatted with consistent class name ordering and spacing for better readability.


215-275: Improved timeline section formatting.

The timeline section with steps has been reformatted with consistent class name ordering for each step.


297-316: Consistent section container and heading formatting.

The section containers and headings have been reformatted with consistent class name ordering.


329-475: Standardized feature sections formatting.

All feature sections have been reformatted with consistent class name ordering and spacing between elements for better readability.

apps/nextjs/src/app/(home)/_components/create-project-dialog.tsx (1)

50-63: LGTM! Good refactor to React Query

The refactoring from TRPC's mutation hook to React Query's useMutation hook is a good change that decouples the mutation logic from TRPC's implementation. This will make the code more maintainable and consistent with other non-TRPC mutations.

apps/website/src/app/(marketing)/newsletter/page.tsx (1)

80-84: Good use of React.Suspense

The addition of React.Suspense around the ApplyButton components is a good practice for handling loading states.

Also applies to: 144-148

apps/website/src/app/(marketing)/_sections/spotlight.tsx (1)

1-48: LGTM! Clean type imports and improved formatting

The changes in this file improve code quality in several ways:

  1. Using import type for type imports is a TypeScript best practice
  2. The reordering of class names improves readability
  3. The component structure is better organized

These changes enhance code maintainability without changing functionality.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/update-role-optimistic.tsx (1)

29-39: LGTM! Good refactor to React Query

The refactoring from TRPC's mutation hook to React Query's useMutation hook is a good change that decouples the mutation logic from TRPC's implementation. This improves consistency with the rest of the codebase that's being updated to use direct React Query hooks.

apps/website/src/app/(marketing)/_sections/take-action.tsx (4)

3-3: Improved import organization.

The import statement has been updated to combine React and useState into a single import, which follows best practices for React imports.


13-13: Enhanced className organization.

The class names have been reordered to follow a more logical grouping pattern (container, layout, styling), which improves readability and maintainability.


24-24: Consistent className pattern.

Class names have been reordered following the same pattern as other elements in the file, maintaining consistency throughout the component.


57-65: Improved JSX formatting.

The formatting of the text content within the motion.div has been simplified while preserving the same content and functionality. This improves code readability.

packages/ui/package.json (1)

63-67:

❓ Verification inconclusive

Standardized dependency management with catalog references.

Dependencies have been updated to use catalog references, which provides consistent versioning across the project. This is a good practice for maintaining version consistency in a monorepo.

Note that while devDependencies now use catalog references, peerDependencies still specify exact versions. Verify if this was intentional or if the peerDependencies should also use catalog references:


🏁 Script executed:

#!/bin/bash
# Check for any other package.json files that might still use fixed versions instead of catalog references
grep -r "\"react\": \"18.3.1\"" --include="package.json" . | grep -v "peerDependencies"

# Check if there's documentation about the catalog approach
find . -type f -name "*.md" | xargs grep -l "catalog:" || echo "No documentation found about catalog references"

Length of output: 291


Action Required: Verify Consistency for React Dependency Versions

The update to use catalog references in devDependencies (as shown in lines 63–67 of packages/ui/package.json) is a strong move for enforcing version consistency. However, verification revealed that a fixed version for React ("react": "18.3.1") still exists in the same file. Additionally, no markdown documentation covering the catalog reference approach was found in the repository. Please confirm:

  • Should peerDependencies (or any other dependency sections) also transition to catalog references instead of fixed versions?
  • If the use of a fixed version (e.g., "18.3.1") for React was intentional, could we document the rationale to avoid confusion?
  • Can we add documentation outlining the catalog reference approach for future clarity?
apps/website/src/app/(marketing)/_sections/hero.tsx (2)

3-7: Improved import organization.

The import statements have been reordered to group related imports together, improving code organization.


18-20: Simplified function parameters.

Default parameters have been simplified by removing explicit type annotations while maintaining the default values, making the code cleaner.

packages/api/src/trpc.ts (2)

13-13: Proper import of auth module.

The import of the auth module from "@amaxa/auth" is correctly implemented, aligning with the PR's objective of updating authentication handling.


28-31: Clean simplification of session handling.

This change streamlines the session retrieval process by:

  1. Removing the need to pass session as a parameter
  2. Using the auth.api.getSession method directly
  3. Passing only the headers needed for authentication

This is a good architectural improvement that centralizes authentication logic.

apps/nextjs/src/components/calendar-full.tsx (3)

82-96: Appropriate type to interface conversion.

Changing from type to interface for ContextType is consistent with TypeScript best practices for objects that represent a clear entity with a stable structure. Interfaces are more extensible and better suited for object shapes that might be implemented or extended.


100-106: Consistent type declaration approach.

Converting CalendarEvent from type to interface maintains consistency with other type declarations in the file and aligns with the broader refactoring effort toward standardization.


108-118: Standardized props interface declaration.

Converting CalendarProps to an interface follows the same pattern applied to other type definitions, creating a more consistent codebase.

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/add-user-form.tsx (2)

50-51: Add import for useMutation from React Query.

Proper import for the React Query's useMutation hook, which is needed for the refactored mutation handling.


74-86: Improved mutation pattern using React Query.

The mutation implementation has been properly refactored to use React Query's useMutation with TRPC's mutationOptions. This change:

  1. Makes the code more consistent with modern React Query patterns
  2. Maintains the same functionality with identical success and error handling
  3. Better separates concerns between data fetching and UI

This is a positive architectural improvement that aligns with the project's tech stack update goals.

apps/website/src/app/(marketing)/_sections/project-shell.tsx (4)

3-5: Improved import organization.

The import of TakeActionSection is now properly separated from other imports and placed in a logical position, improving code organization.


24-25: Consistent className ordering.

The className attributes in these elements now follow a consistent pattern with spacing-related classes first followed by sizing classes, improving readability.


91-114: Well-structured media rendering component.

The code now properly handles different types of media (video, image, or fallback) with appropriate conditional rendering. The JSX structure is clean with consistent className patterns.


116-171: Improved conditional rendering pattern.

The conditional rendering for spotlightData1 has been refactored to use the ternary operator with a null fallback, which is more idiomatic in React. The JSX structure within the condition is well-formatted with proper indentation and className consistency.

apps/website/src/components/ui/focus-cards.tsx (4)

29-34: Good improvement with absolute positioning

The Image component is now properly positioned using absolute positioning and the inset-0 class, which ensures it covers the entire card area. This is a cleaner approach than the previous implementation.


36-45: Good enhancement to the hover effect

The opacity transition with absolute positioning for the content overlay provides a clean, consistent hover effect. The gradient background and transparent text create an appealing visual effect.


53-57: Type declaration improvement

Changing from a type alias to an interface is good practice for object types that might be extended later. This matches similar changes in apple-cards.tsx for consistency across the codebase.


63-63: Improved grid layout

The updated grid layout with consistent gap spacing and responsive columns provides a cleaner appearance.

apps/website/src/lib/projects.ts (5)

57-58: Good formatting improvement

Breaking the URL into separate lines improves readability without affecting functionality.


76-93: Better paragraph formatting

The updated paragraph formatting with consistent indentation and line breaks makes the content easier to read and maintain. Removing the trailing comma on the last array item is also good practice.


98-102: Improved array formatting

The formatting changes to the paragraphs array with consistent indentation improves readability.


124-128: Content consolidation improvement

Consolidating the paragraphs while maintaining proper formatting improves the structure and makes the content more maintainable.


138-139: Consistent URL formatting across the file

All URL properties now follow the same formatting pattern, which improves consistency and readability throughout the file.

Also applies to: 172-173, 208-209, 242-243, 275-276

apps/website/src/components/ui/apple-cards.tsx (5)

3-6: Improved import organization

The import statements have been reorganized with type imports separated from regular imports, which follows best practices for TypeScript code organization.


17-23: Type declaration consistency improvement

Changing from a type alias to an interface is consistent with similar changes in focus-cards.tsx, which helps maintain a uniform type declaration pattern across the codebase.


29-29: Minor formatting improvement

Removing the space between parentheses and curly braces is a small but valid code style improvement.


158-162: Code style consistency with semicolons

Adding semicolons at the end of statements improves code style consistency.


95-96: Class name formatting consistency

The class name formatting has been adjusted for better readability, which is a minor but welcome improvement.

Also applies to: 122-122

apps/nextjs/src/app/(home)/guides/action-guides/_components/create-action-guide.tsx (4)

29-31: Good upgrade to React Query imports

The addition of React Query imports is part of the migration to use TanStack Query's more powerful hooks instead of direct TRPC mutations.


39-39: TRPC hook initialization

This adds the TRPC hook which is necessary for the new mutation approach.


50-59: Improved mutation handling with React Query

The migration from direct TRPC mutation to React Query's useMutation hook follows modern best practices. This approach:

  1. Uses the query client for cache invalidation
  2. Maintains the same functionality with cleaner code
  3. Follows the pattern used in other updated components

This change aligns with the PR objective of updating to the latest tech.


51-59:

✅ Verification successful

Verify the mutation invalidation path

Ensure that trpc.actionGuides.pathFilter() returns the correct query key pattern that matches any queries that need to be invalidated when a new guide is created.


🏁 Script executed:

#!/bin/bash
# Check for other invalidation patterns in the codebase for comparison
rg -A 2 "invalidateQueries" | grep "actionGuides"

Length of output: 207


Mutation Invalidation Path Verification Complete

The grep output confirms that the only invalidation call for action guides is:

void queryClient.invalidateQueries(trpc.actionGuides.pathFilter());

There are no conflicting or additional invalidation patterns elsewhere in the codebase. Please ensure that the value returned by trpc.actionGuides.pathFilter() indeed matches the query key(s) for all queries that must be refreshed upon creating a new guide.

package.json (2)

28-31: LGTM - Consistent dependency management using catalog references

The switch to catalog: for dependencies like prettier and typescript is a good practice for maintaining consistent versions across the codebase.


5-6:

✅ Verification successful

Verify Node.js version compatibility

The Node.js requirement has been significantly increased from Node 20 to Node 22. Node 22 is relatively new and may not be widely adopted in production environments yet. This could create deployment challenges.


🌐 Web query:

Is Node.js 22 in LTS status?

💡 Result:

Yes, Node.js 22 is in Long-Term Support (LTS) status as of October 29, 2024[3][4]. Key details about its LTS phase:

  • Active LTS Phase: Runs until October 2025[3][4]
  • Maintenance LTS Phase: Continues until April 2027[3][4]
  • Codename: 'Jod'[3][4]

This LTS designation occurred exactly 6 months after Node.js 22's initial release in April 2024[1][2], following the standard Node.js release lifecycle where even-numbered versions achieve LTS status[7][10]. As of April 2025, it remains in the Active LTS phase that prioritizes stability with security updates and critical bug fixes[3][4].

Production users should note that Node.js 18 reached end-of-life in April 2025[11], while Node.js 20 entered Maintenance LTS in October 2024[3][4]. Major cloud platforms like AWS Lambda and Heroku already support Node.js 22 for production workloads[5][9].

Citations:


Node.js Version Requirement is Validated for Production Use

The current minimum version ("node": ">=22.14.0") is now acceptable since Node.js 22 is confirmed to be in Active LTS—with support until October 2025 and maintenance until April 2027—and is already adopted by major platforms (e.g., AWS Lambda, Heroku). There is no longer a significant deployment risk related to this update.

apps/nextjs/src/app/(home)/admin/_components/table.tsx (2)

24-25: LGTM - Good switch to Tanstack React Query hooks

Moving to direct React Query hook imports makes the code more maintainable and aligned with standard practices.


30-38:

❓ Verification inconclusive

Migration to React Query hooks looks good, but ensure proper typing

The transition from TRPC-specific hooks to more generic React Query hooks is good. However, ensure that type safety is maintained with the new approach.


🏁 Script executed:

#!/bin/bash
# Check how useMutation is typed in other files to ensure consistency
rg "useMutation.*mutationOptions" --type=tsx -A 3 -B 3

Length of output: 84


Below is an updated verification step that re-runs the search using a glob pattern (since the previous command failed due to an unrecognized file type):

Once you run this command, please verify that the typing for useMutation is consistent with our expected patterns. The migration to React Query hooks looks solid; however, ensure that the new approach maintains proper type safety across all TSX files.

Action:

  • Manually review the output from the script above to confirm that all usages of mutationOptions in useMutation have the correct typing.

If everything checks out, you can confirm that no further changes are needed. Otherwise, please update the code accordingly.


🏁 Script executed:

#!/bin/bash
# Search for all instances of useMutation with mutationOptions across TSX files using a glob pattern.
rg "useMutation.*mutationOptions" -g "*.tsx" -A 3 -B 3

Length of output: 178


Manual Verification Needed: Confirm Type Safety for React Query Hooks
While the migration from TRPC-specific hooks to React Query looks solid, our automated search for consistent typing in useMutation with mutationOptions did not yield any output. This outcome may indicate that the pattern isn’t present in a way that our script could detect, or that such usages are minimal in the codebase.

Action Items:

  • Manually verify the type safety of the new React Query hooks implementation in apps/nextjs/src/app/(home)/admin/_components/table.tsx and other relevant TSX files.
  • Look for any potential discrepancies in how the mutationOptions type is applied across the codebase.

Please ensure that all usages maintain proper type safety as expected with the migration.

packages/api/package.json (3)

25-27: LGTM - Improved dependency management

The shift to catalog references for dependencies simplifies version management and ensures consistency across the project.


33-35: LGTM - Consistent use of catalog references for dev dependencies

Using catalog references for eslint, prettier, and typescript ensures consistent tooling across the project.


26-26:

❓ Verification inconclusive

Verify superjson compatibility with other dependencies

The superjson package was updated from 2.2.1 to 2.2.2. While this is a minor update, ensure it doesn't cause any compatibility issues with TRPC or other dependent packages.


🌐 Web query:

Are there any known issues with superjson 2.2.2 and TRPC?

💡 Result:

When using SuperJSON v2.2.2 with tRPC, several compatibility challenges and edge cases have been documented:

Backward Compatibility and Client Migration

The primary challenge occurs during migration where older clients (like React Native apps) encounter errors when a tRPC server switches to SuperJSON without client updates. Developers solved this by implementing conditional deserialization logic that checks for SuperJSON's signature data.json property before parsing[1].

Example workaround code:

// Client-side transformer
deserialize: (data: any) => {
  const isSuperJson = data.json !== undefined;
  return isSuperJson ? superjson.deserialize(data) : data;
}

// Server-side transformer
deserialize: (data: any) => {
  if (!data) return data;
  return data.json ? superjson.deserialize(data) : data;
}

This requires temporarily disabling server-side serialization until all clients update[1].

Edge Runtime Compatibility

Recent reports highlight issues with Date deserialization in tRPC mutations when using edge runtimes like Vercel Edge Functions. The problem manifests when Date objects aren't properly reconstructed after serialization[5].

Technical Limitations

  1. Input Mapping Bugs: An open issue reports inconsistent behavior when mapping complex input types during serialization/deserialization cycles[5].
  2. Dependency Conflicts: Some environments encounter module resolution errors when combining tRPC, SuperJSON, and modern React/Next.js versions, particularly around ESM/CJS interoperability[7][10].

Version-Specific Considerations

While SuperJSON 2.2.2 itself has no critical vulnerabilities[15], its ES Module-only distribution since v2.x requires Node.js v16+ and proper TS configuration (moduleResolution: "Node16" or "Bundler")[12]. This can cause issues in older projects or those using CommonJS modules[10].

Developers should test serialization boundaries thoroughly and consider phased rollouts when updating existing tRPC implementations. The tRPC community recommends using SuperJSON's custom transformer configuration to handle these edge cases systematically[4][8].

Citations:


Action: Verify SuperJSON v2.2.2 Integration with tRPC & Dependent Packages

The update from SuperJSON v2.2.1 to 2.2.2 is minor but introduces several known compatibility challenges with tRPC. In particular, be aware of:

  • Backward Compatibility & Client Migration: Older clients (e.g., React Native) might encounter errors if the server updates without corresponding client changes. Ensure that any custom transformer logic (conditional deserialization based on the presence of the data.json property) is correctly implemented.
  • Edge Runtime Considerations: Testing is needed for scenarios such as Date deserialization issues in environments like Vercel Edge Functions.
  • ESM/CJS Interoperability: Verify that your Node.js version (v16+ required) and TypeScript configuration (e.g., setting moduleResolution to "Node16" or "Bundler") are compatible with SuperJSON's ES Module-only distribution.

Please add tests or review configurations where needed to ensure these issues are addressed.

apps/nextjs/src/app/(auth)/sign-in/page.tsx (2)

16-16: LGTM - Updated import path for auth client module

The import has been updated to use the more specific client-side module from the auth package.


18-19: LGTM - Component renamed for clarity and loading state added

Renaming from LoginForm to SignIn improves clarity, and adding the loading state is a good UX enhancement.

apps/website/src/app/(marketing)/who-we-are/page.tsx (4)

1-3: Code organization improvement

Moving the React import to the top of the file follows best practices for import organization.


9-16: Improved className organization

The className attributes have been reorganized to follow a more consistent pattern, grouping related utility classes together (layout, sizing, styling). This improves code readability and maintainability.


82-111: Improved className structure for better maintainability

The className attributes in this section have been reordered to group related properties, making the code more readable and maintainable. The spacing, sizing, and color properties are now organized in a more logical manner.


150-168: Enhanced button styling and layout organization

The className reorganization for the section and button elements improves readability while maintaining the same visual appearance. The button's className now groups related properties (layout, border, spacing, text) in a more logical order.

packages/auth/package.json (3)

11-13: New module exports enhance package flexibility

Adding dedicated export paths for expo, middleware, and client components improves the package's modularity and allows for more targeted imports based on the context (mobile, server middleware, client-side).


36-39: Standardized dependency management with catalog references

Moving to catalog references for eslint, prettier, and typescript helps maintain consistent tooling versions across the project. Adding tsup as a build tool suggests changes in how the package is built and distributed.


26-30:

❓ Verification inconclusive

Major authentication library change

The package is migrating from @auth/core and @auth/drizzle-adapter to a custom better-auth package. Additionally, Next.js has been updated from v14 to v15, which is a major version upgrade.

Please verify that all components using the old auth library have been updated to use the new better-auth package. Major version upgrades of Next.js often introduce breaking changes that need to be addressed.


🏁 Script executed:

#!/bin/bash
# Check if better-auth package exists and what it provides

# Look for imports of better-auth in the codebase
echo "Checking usage of better-auth in the codebase:"
rg -A 2 "from ['\"]better-auth" --type ts

# Check for migration documentation
echo "Looking for migration documentation:"
fd -t f "migration|upgrade|changelog" --exec grep -l "auth|better-auth" {} \;

Length of output: 1144


Authentication and Next.js Upgrade Verification

  • Verified that all components have been updated to use the new better-auth package (e.g., in packages/auth/src/client.ts, packages/auth/src/middleware.ts, and packages/auth/src/auth.ts).
  • No traces of the old authentication libraries (such as @auth/core or @auth/drizzle-adapter) were detected.
  • Note that the search for migration or upgrade documentation did not return any results; please ensure that any necessary migration notes or documentation regarding the new better-auth integration are provided.
  • Given that Next.js has been upgraded to v15—a major version update—please double-check that all potential breaking changes have been accounted for and thoroughly tested.
packages/db/package.json (2)

43-47: Standardized tooling with catalog references

Shifting to catalog references for eslint, prettier, and typescript ensures consistent tooling versions across the project. The update to newer versions of dotenv-cli and drizzle-kit suggests improvements in the development workflow.


35-37:

❓ Verification inconclusive

Significant database library updates

Updating drizzle-orm from v0.31.2 to v0.41.0 and drizzle-zod from v0.5.1 to v0.7.0 represents major version jumps that may include breaking changes. The removal of the postgres dependency (mentioned in the AI summary) suggests a change in how database connections are managed.

Please ensure that all database access code has been updated to accommodate the breaking changes in these major version updates of drizzle-orm and drizzle-zod.


🏁 Script executed:

#!/bin/bash
# Check for breaking changes in drizzle ORM updates

# Look for drizzle-orm usage in the codebase
echo "Checking usage patterns that might be affected by drizzle-orm updates:"
rg -A 3 "from ['\"]drizzle-orm" --type ts

# Check for database connection code that might have changed
echo "Looking for database connection code:"
rg -A 5 "postgres|createPool|connection" --type ts

Length of output: 5398


Ensure All Database Connection Changes Align with Updated Drizzle Versions

The major version bumps for both drizzle-orm (v0.31.2 → v0.41.0) and drizzle-zod (v0.5.1 → v0.7.0) introduce potentially breaking changes. Verification indicates that:

  • drizzle-orm usage:
    Key files such as packages/db/src/index.ts and packages/db/src/schema.ts now import and use types and functions from the updated modules (e.g. "drizzle-orm", "drizzle-orm/pg-core", and "drizzle-orm/sql").

  • Database connection updates:
    The new connection configuration in packages/db/drizzle.config.ts (using dialect: "postgresql" and custom credentials) and the client code in packages/db/src/client.ts importing from "drizzle-orm/vercel-postgres" reflect that the previous postgres dependency has been removed and replaced.

Please verify manually that:

  • All instances of database connection logic fully align with the new APIs.
  • There aren’t any lingering dependencies or usage patterns tied to the previous postgres integration.
apps/nextjs/src/trpc/server.tsx (5)

1-11: Well-structured imports for tRPC server integration

The imports are organized logically, separating external dependencies from internal project imports. The use of type imports helps reduce bundle size by ensuring types are only used at compile time.


16-23: Efficient context creation for server components

Using React's cache function for the context creation is a good practice as it ensures the context is only created once per request, improving performance. Setting the "x-trpc-source" header to "rsc" allows backend tracking of request sources.


27-31: Clean tRPC setup with proper type safety

The tRPC setup is well-structured, using the appropriate type parameters to ensure type safety throughout the application. Using the cached context and query client is a good performance optimization.


33-40: Effective hydration boundary implementation

The HydrateClient component correctly implements hydration for the query client state, following best practices for React Server Components by providing a clear boundary between server and client hydration.


41-52:

❓ Verification inconclusive

Type-safety concerns in prefetch function

The function uses ESLint disable comments to bypass TypeScript's type checking in two places. While sometimes necessary for complex generic types, this could hide potential issues.

Consider exploring more type-safe alternatives to the any casting if possible. If this approach is necessary, add more detailed comments explaining why type safety needs to be bypassed here.


🏁 Script executed:

#!/bin/bash
# Check if this pattern is used consistently across the codebase

# Look for similar usage patterns of prefetchInfiniteQuery
echo "Checking for similar patterns in the codebase:"
rg -A 3 "prefetchInfiniteQuery.*as any" --type ts

# Check for alternative approaches that might be more type-safe
echo "Looking for alternative approaches to infinite query prefetching:"
rg -A 5 "prefetchInfiniteQuery(?!.*as any)" --type ts

Length of output: 867


Action Required: Revisit Type-Casting in prefetch Function

  • The current implementation casts queryOptions to any when calling prefetchInfiniteQuery (in apps/nextjs/src/trpc/server.tsx at lines 41–52).
  • A codebase search confirms that this pattern appears only here, and no built-in or alternative type-safe approach has been identified.
  • If refactoring to improve type safety isn’t feasible in the short term, please add a clear inline comment that explains why bypassing TypeScript’s checks is necessary (for example, due to complex generic types or limitations in the TRPC type definitions).
apps/website/src/app/(marketing)/project/page.tsx (9)

4-4: No concerns with these new imports.
No issues or conflicts identified.

Also applies to: 6-6, 9-9


19-19: Background container changes appear consistent.
No functional impact. Preserving the invisible container for reference is valid.

Also applies to: 21-25


58-58: No concerns.
No functional changes or issues.


62-66: Layout changes look good.
No performance or readability issues identified.


90-94: No concerns.
The updated text is clear and grammatically sound.


98-99: FocusCards usage is appropriate.
No issues with data binding or performance.


100-101: No concerns.
Closing tags and structure remain consistent.


103-103: Section background and spacing.
No concerns regarding the updated styles for the section.


106-106: No concerns.
The heading is descriptive and well-placed.

packages/db/src/schema.ts (8)

26-26: No concerns.
Minor enumerated status field is properly typed.


32-35: Relation definitions look correct.
The references to account, tasks, and project_tracker are consistent with the new schema.


38-49: Session table adjustments look consistent.
The new references and usage of onDelete: "cascade" is appropriate, ensuring session cleanup when a user is removed.


51-67: Account table updates align with the new user schema.
The additional token fields and onDelete: "cascade" reference appear properly structured.


69-76: New verification table is well-defined.
No concerns with the fields for storing verification details and timestamps.


122-122: Task-assignee relation correctly references the new user table.
The updated reference ensures data consistency.


211-211: Composite primary key introduced.
This effectively enforces uniqueness across userId and projectId.


222-224: Relation to user is updated.
The reference to user.id is consistent with the renamed table.

apps/website/package.json (2)

42-42: Catalog references for devDependencies appear consistent.
No issues found; the shift to catalog: versioning aligns with the project's new approach.

Also applies to: 43-43, 44-44, 45-45, 46-46, 48-48, 49-49, 50-50


24-24:

✅ Verification successful

Upgrading Next.js & React to new catalog references.
Ensure the move to Next ^15.2.3 and catalog:react19 doesn't introduce breaking changes.

To verify any potential breaking changes, you can run a script to search for deprecated APIs or known issues in your codebase:

Also applies to: 26-27


🏁 Script executed:

#!/bin/bash
# Searching for Next.js and React 14/18 usage in code comments or config files
rg -A 5 "next14|react18|deprecated"

Length of output: 2681


Next.js & React Upgrade Verified

  • The update in apps/website/package.json—with "next": "^15.2.3" on line 24 and the corresponding React upgrade on lines 26-27 to use catalog:react19—has been checked.
  • A repository-wide search for outdated Next.js (e.g., "next14") and React (e.g., "react18") usages, as well as deprecated API notes, returned only unrelated deprecated warnings in the lockfile.
  • No evidence of breaking changes stemming from these dependency updates was found. Standard integration tests are still recommended to confirm runtime behavior.
apps/nextjs/package.json (7)

25-25: Standardize React Query dependency.
Changing @tanstack/react-query to "catalog:" reflects the new centralized dependency management strategy. Please ensure that this update integrates well with your workspace’s version resolution.


29-31: Refactor TRPC dependencies.
The updates for @trpc/client, @trpc/server, and the addition of @trpc/tanstack-react-query now use the "catalog:" reference. This unifies dependency management and should simplify version maintenance. Confirm that any usage of these packages in your codebase remains compatible with the new sourcing.


38-38: Upgrade Next.js version.
Updating Next.js from ^14.2.14 to ^15.2.3 unlocks the latest features and performance improvements. Please verify that all custom configurations and plugins are compatible with this new version.


41-42: Migrate React dependencies.
Switching "react" and "react-dom" to "catalog:react19" indicates a move to React 19. Make sure to test your application for any breaking changes or compatibility issues related to this major update.


47-47: Apply Superjson patch.
The update of superjson to version 2.2.2 should bring minor bug fixes or improvements. It is recommended to run your serialization and deserialization tests to ensure no regression occurs.


48-48: Centralize Zod dependency management.
Changing zod to use a "catalog:" reference streamlines version control for validation schemas. Verify that this change does not impact any library-specific behaviors in your schema definitions.


56-64: Standardize devDependencies versions.
The updates to dev dependencies—including @types/node, @types/react, @types/react-dom, dotenv-cli, eslint, tailwindcss, and typescript—now use either new version numbers or catalog references. This approach provides consistency in development tooling across the project. Please ensure that linting, formatting, and type-checking workflows are all functioning as expected after these changes.

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

5-6: Analytics integration looks good!

The PostHog analytics provider has been properly integrated into the application. This will enable tracking user interactions and gathering analytics data across the website.

Also applies to: 80-80

apps/nextjs/src/app/(dashboard)/project/[id]/(root)/layout.tsx (1)

57-59: Verify components handle optional properties

Make sure any components consuming the name and email properties properly handle undefined or null values, as they're no longer guaranteed to be non-null by the type system.

@@ -1,3 +1,2 @@
node-linker=hoisted
@tiptap-pro:registry=https://registry.tiptap.dev/
//registry.tiptap.dev/:_authToken=token-here
link-workspace-packages=true
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Good monorepo configuration update.

Setting link-workspace-packages=true in pnpm makes local packages symlinked to node_modules, which improves the development experience by making changes to local packages immediately available without requiring rebuilds or reinstalls.


🏁 Script executed:

#!/bin/bash
# Verify if any remaining references to Tiptap registry exist in package.json files
echo "Checking for any remaining Tiptap registry references in package.json files:"
fd 'package.json' --type f | xargs grep -l "tiptap" || echo "No Tiptap references found in package.json files"

Length of output: 237


Actionable: Resolve Tiptap Registry Reference

Great update to the monorepo configuration with link-workspace-packages=true, which will indeed improve your development workflow by symlinking local packages. However, the verification script found that apps/nextjs/package.json still contains a Tiptap registry reference. Please confirm whether this reference is intentional. If it’s a leftover from a previous configuration, it should be removed or updated accordingly.

  • File to review: apps/nextjs/package.json – verify the Tiptap reference.
  • File updated: .npmrc (Line 2 is correct).

Once the Tiptap reference issue is addressed, this update can be approved.

Comment on lines +22 to +25
const trpc = useTRPC();
const { data: actionGuides } = useSuspenseQuery(
api.actionGuides.getActionGuides.queryOptions(),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing import for useTRPC

The code references useTRPC() but there's no import statement for this function. This will cause a runtime error.

Add the following import statement at the top of the file:

import { useSuspenseQuery } from "@tanstack/react-query";
+import { useTRPC } from "~/trpc/client";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const trpc = useTRPC();
const { data: actionGuides } = useSuspenseQuery(
api.actionGuides.getActionGuides.queryOptions(),
);
import { useSuspenseQuery } from "@tanstack/react-query";
import { useTRPC } from "~/trpc/client";
// ... other imports (if any)
const trpc = useTRPC();
const { data: actionGuides } = useSuspenseQuery(
api.actionGuides.getActionGuides.queryOptions(),
);
// ... rest of the file

Comment on lines +17 to +18
import { useMutation } from "@tanstack/react-query";

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add the missing import for useTRPC

The code is importing useMutation from React Query but missing the import for useTRPC which is used on line 24.

import { useMutation } from "@tanstack/react-query";
+import { useTRPC } from "~/trpc/react";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { useMutation } from "@tanstack/react-query";
import { useMutation } from "@tanstack/react-query";
import { useTRPC } from "~/trpc/react";

Comment on lines +49 to 50
currentText?.substring(0, displayedText.length + 1)!,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Replace non-null assertions with safer alternatives.

The use of non-null assertions (!) with optional chaining (?.) is flagged by the linter as unsafe. These could potentially lead to runtime errors if the values are undefined.

Consider replacing these non-null assertions with safer alternatives such as nullish coalescing or conditional rendering:

- currentText?.substring(0, displayedText.length + 1)!,
+ currentText?.substring(0, displayedText.length + 1) ?? "",

- src={content[prevIndex]?.image!}
+ src={content[prevIndex]?.image ?? defaultImage}

- src={content[activeIndex]?.image!}
- alt={content[activeIndex]?.statement!}
+ src={content[activeIndex]?.image ?? defaultImage}
+ alt={content[activeIndex]?.statement ?? ""}

- src={content[nextIndex]?.image!}
+ src={content[nextIndex]?.image ?? defaultImage}

Also applies to: 258-259, 286-288, 313-314

🧰 Tools
🪛 GitHub Check: lint

[warning] 49-49:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 49-49:
Forbidden non-null assertion

@@ -63,23 +64,26 @@ export default function AddUserForm({
label: string;
}[];
}) {
const trpc = useTRPC();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing import for useTRPC.

The code is using useTRPC() but there's no import statement for this function.

Add the missing import at the top of the file:

import { api } from "~/trpc/react";
+import { useTRPC } from "~/trpc/react";
import { useMutation } from "@tanstack/react-query";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const trpc = useTRPC();
import { api } from "~/trpc/react";
import { useTRPC } from "~/trpc/react";
import { useMutation } from "@tanstack/react-query";
// ... rest of the file's code ...
const trpc = useTRPC();

export function UserManagement() {
const trpc = useTRPC();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix undefined useTRPC reference

The code introduces useTRPC() but doesn't import this function. This will cause a runtime error.

+import { api } from "~/trpc/react";
 export function UserManagement() {
-  const trpc = useTRPC();
+  // Remove if not needed, or properly import the hook

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +57 to 59
name: auth.user.name,
email: auth.user.email,
avatar: auth.user.image!,
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Inconsistent non-null assertion handling

You've removed non-null assertions for name and email properties, which is good for type safety, but image still has a non-null assertion. Consider treating all user properties consistently by removing the remaining assertion or document why it's needed.

user={{
  name: auth.user.name,
  email: auth.user.email,
- avatar: auth.user.image!,
+ avatar: auth.user.image,
}}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: auth.user.name,
email: auth.user.email,
avatar: auth.user.image!,
name: auth.user.name,
email: auth.user.email,
avatar: auth.user.image,

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/auth/src/middleware.ts (1)

1-33: Consider adding configuration for customizable public paths.

While the current implementation works well, consider making the public paths configurable through a parameter or environment variable. This would make the middleware more flexible for different applications without code changes.

-export const client = createAuthClient();
+export const client = createAuthClient();
+
+// Default public paths that don't require authentication
+export const DEFAULT_PUBLIC_PATHS = ["/sign-in", "/sign-up", "/api/auth"];
+
-export async function authMiddleware(request: NextRequest) {
+export async function authMiddleware(
+  request: NextRequest,
+  options?: { publicPaths?: string[] }
+) {
  // Check if the request is for a public route
  const url = new URL(request.url);
-  const publicPaths = ["/sign-in", "/sign-up", "/api/auth"];
+  const publicPaths = options?.publicPaths || DEFAULT_PUBLIC_PATHS;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce473c2 and 4380968.

📒 Files selected for processing (1)
  • packages/auth/src/middleware.ts (1 hunks)
🔇 Additional comments (4)
packages/auth/src/middleware.ts (4)

1-5: LGTM: Clean imports and client setup.

The import statements are clean and focused, bringing in only what's needed. The createAuthClient usage looks correct for setting up the auth client.


7-14: Proper handling of public routes implemented.

The code correctly implements the public routes handling that was suggested in a previous review comment. This prevents redirect loops for paths like sign-in pages.


16-28: Session retrieval implementation looks good.

The session retrieval from request headers is properly implemented, with good documentation comments explaining the purpose.


29-33: Authentication flow correctly returns responses.

This implementation properly returns responses in all code paths, fixing the issue highlighted in a previous review. The code returns a redirect response for unauthenticated users and allows authenticated requests to proceed.

@not-ani not-ani changed the title Updating project to latest tech Bringing Project Back Up to standard Apr 3, 2025
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: 3

🔭 Outside diff range comments (2)
apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx (1)

1-2: 🛠️ Refactor suggestion

Consider addressing the ts-nocheck directive.

The file has TypeScript checking disabled. This can hide type errors and make the codebase less robust. As part of bringing the project back up to standard, consider addressing the issues that required this directive to be added.

apps/nextjs/src/app/(home)/events/page.tsx (1)

24-28: ⚠️ Potential issue

Potential runtime error with data mapping

The code assumes data is always an array that can be mapped over, but if validation fails, data would be an error object.

<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
-  {data.map((event) => (
+  {Array.isArray(data) && data.map((event) => (
     <EventCard key={event.id} event={event} />
   ))}
</div>
🧹 Nitpick comments (7)
apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx (2)

218-218: Good change from || to ?? operator for Select value prop.

The change from logical OR (||) to nullish coalescing (??) improves the behavior. While || would provide a fallback for any falsy value (including empty strings), ?? only provides a fallback for null or undefined, preserving other falsy values that might be intentionally set.

Consider adding a brief comment explaining this intentional behavior:

-              value={timezone ?? ""} // Added a fallback empty string
+              value={timezone ?? ""} // Using ?? instead of || to preserve empty string values as valid selections

217-217: Typo in heading text "Avaliable".

There's a typo in the heading text for available time slots.

-            <h3 className="text-lg font-semibold">Avaliable Time Slots</h3>
+            <h3 className="text-lg font-semibold">Available Time Slots</h3>
packages/api/src/router/users.ts (3)

21-25: Migration to arktype validation

The change from Zod to arktype for input validation is consistent with other changes in the PR. The string literal type "'admin' | 'coach' | 'student'" should work but would be better expressed as a union type.

Consider using a proper union type instead of a string literal:

-        permission: "'admin' | 'coach' | 'student'",
+        permission: type.union(["admin", "coach", "student"]),

37-55: Standardized function naming and updated joins

The function name findusersForProject should be camelCase (findUsersForProject) to maintain consistency with other function names.

The join operation has been correctly updated to use the new lowercase user table.

Correct the function name for consistency:

-  findusersForProject: publicProcedure
+  findUsersForProject: publicProcedure

58-62: Type definition inconsistency

There's an inconsistency in how types are defined between this function and others. Here you're using string literals ("string") while elsewhere you use type.string.

Standardize the type definitions for consistency:

-        projectId: "string",
-        userId: "string",
+        projectId: type.string,
+        userId: type.string,
packages/validators/src/index.ts (2)

25-26: Synchronize naming of role constants with database definitions.

You’re defining role as 'User' | 'Admin' and userRoles as 'admin' | 'coach' | 'student', which may create confusion with the database table enums (role vs. permission). Consider consolidating or renaming them for clarity.


162-188: Rename “assigneName” for clarity.

“assigneName” may be a misspelling of “assigneeName,” especially since you have an “assigne” field. This can lead to confusion when referencing the property.

Apply this diff to rename the field:

-    assigneName: "string | null",
+    assigneeName: "string | null",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4380968 and 5f40b86.

⛔ Files ignored due to path filters (3)
  • packages/api/.cache/tsbuildinfo.json is excluded by !**/.cache/**
  • packages/db/.cache/tsbuildinfo.json is excluded by !**/.cache/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • apps/nextjs/package.json (1 hunks)
  • apps/nextjs/src/app/(auth)/sign-in/page.tsx (2 hunks)
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/events/page.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/layout.tsx (1 hunks)
  • apps/nextjs/src/app/(home)/loading.tsx (2 hunks)
  • apps/nextjs/src/app/(scheduling)/schedule/[coachId]/_components/date-time-picker.tsx (1 hunks)
  • apps/nextjs/tsconfig.json (1 hunks)
  • packages/api/package.json (1 hunks)
  • packages/api/src/root.ts (0 hunks)
  • packages/api/src/router/auth.ts (0 hunks)
  • packages/api/src/router/events.ts (2 hunks)
  • packages/api/src/router/projects.ts (2 hunks)
  • packages/api/src/router/tasks.ts (10 hunks)
  • packages/api/src/router/users.ts (2 hunks)
  • packages/db/package.json (1 hunks)
  • packages/db/src/schema.ts (5 hunks)
  • packages/validators/package.json (1 hunks)
  • packages/validators/src/index.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • reset.sh (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/api/src/root.ts
  • packages/api/src/router/auth.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/nextjs/src/app/(home)/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/nextjs/src/app/(home)/loading.tsx
  • apps/nextjs/src/app/(dashboard)/project/[id]/(root)/permissions/_components/table.tsx
  • apps/nextjs/tsconfig.json
  • packages/db/package.json
🧰 Additional context used
🧬 Code Definitions (6)
packages/api/src/router/events.ts (1)
packages/validators/src/index.ts (1)
  • eventsInsertSchema (117-117)
packages/api/src/router/projects.ts (1)
packages/validators/src/index.ts (1)
  • projectsInsertSchema (78-78)
packages/db/src/schema.ts (1)
auth-schema.ts (4)
  • user (3-11)
  • account (26-42)
  • session (13-24)
  • verification (44-51)
packages/api/src/router/users.ts (2)
packages/db/src/schema.ts (2)
  • user (13-28)
  • project_tracker (183-197)
packages/validators/src/index.ts (1)
  • userUpdateSchema (30-32)
packages/validators/src/index.ts (1)
packages/db/src/schema.ts (12)
  • user (13-28)
  • session (36-47)
  • account (49-65)
  • verification (73-80)
  • tasks (81-120)
  • edges (134-147)
  • Projects (166-177)
  • project_tracker (183-197)
  • skills (216-225)
  • skillsToGuide (231-246)
  • guides (259-270)
  • events (276-293)
packages/api/src/router/tasks.ts (2)
packages/validators/src/index.ts (4)
  • tasksSelectSchema (58-60)
  • flowDataSchema (199-203)
  • tasksInsertSchema (61-63)
  • tasksUpdateSchema (64-67)
packages/db/src/schema.ts (1)
  • tasks (81-120)
🪛 Shellcheck (0.10.0)
reset.sh

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

🔇 Additional comments (47)
packages/api/src/router/events.ts (2)

4-5: Import updated to use centralized validation schemas

The code now imports the database schema and validation schema from dedicated packages, which is a good practice for maintaining consistent validation across the application.


25-25: Standardized input validation using eventsInsertSchema

The change from createEventSchema to eventsInsertSchema aligns with the PR objective of standardizing validation schemas. This is a good refactoring that centralizes validation logic and ensures consistency.

packages/api/src/router/projects.ts (2)

8-9: Import updated to use centralized validation schemas

The imports have been updated to bring in the Projects schema from the database package and the projectsInsertSchema from the validators package. This is a good refactoring that promotes separation of concerns.


25-25: Standardized input validation using projectsInsertSchema

The change from createProjectSchema to projectsInsertSchema aligns with the PR's objective of standardizing validation. This centralization of validation schemas enhances maintainability and consistency across the application.

packages/api/src/router/tasks.ts (13)

2-2: Transitioning from zod to arktype for validation

The import of type from 'arktype' indicates the transition from zod to arktype for validation schemas. This aligns with the PR's objective of standardizing the codebase.


4-11: Comprehensive import update for centralized validation

The imports have been significantly refactored to use dedicated schemas from the validators package instead of inline schema definitions. This is a good practice that enhances code organization and maintainability.


18-18: Using tasksSelectSchema for consistent validation

The change to use tasksSelectSchema for input validation standardizes the approach to validating task selection operations. This schema includes proper type refinement for the position field, as seen in the validators package.


78-78: Using flowDataSchema for save procedure

The change to use the specialized flowDataSchema for the save procedure provides proper validation for the complex structure required, including projectId, tasks, and edges. This improves type safety and code readability.


127-127: Using tasksInsertSchema for create procedure

The change to tasksInsertSchema for the create procedure ensures consistent validation for task creation across the application. This schema properly refines the position field using the positionSchema.


137-137: Using tasksUpdateSchema for update procedure

The change to tasksUpdateSchema for the update procedure is appropriate as it ensures the ID field is required for updates and properly refines the position field. This improves type safety during task updates.


143-145: Improved input parameter naming and transition to arktype

The change from z.object({ id: z.string() }) to type({ projectId: "string" }) both transitions to arktype and improves parameter naming clarity. Using projectId instead of id more accurately describes what the parameter represents.


161-161: Updated query parameter to use projectId

This change correctly updates the query to use input.projectId instead of input.id, aligning with the parameter name change in the input schema.


171-173: Consistent parameter naming and transition to arktype

Similar to the previous schema change, this updates the input for the getPriorityData procedure to use arktype and the more descriptive projectId parameter name.


182-182: Updated query parameter to use projectId

This change correctly updates the query to use input.projectId instead of input.id, maintaining consistency with the parameter name change.


188-190: Consistent parameter naming and transition to arktype

The input schema for getPositionData follows the same pattern, transitioning to arktype and using the more descriptive projectId parameter name.


199-199: Updated query parameter to use projectId

This change correctly updates the query to use input.projectId instead of input.id, maintaining consistency with the parameter name changes.


205-205: Consistent input schema pattern across procedures

The getTasksOverTime, getTaskPriorities, and getTaskStatuses procedures all use the same standardized input schema pattern with arktype. This consistency improves code readability and maintainability.

Also applies to: 221-221, 236-236

packages/validators/package.json (2)

22-24: New validation dependencies look good

Adding arktype, drizzle-arktype, and drizzle-zod aligns with the project's shift from using zod to arktype for validation.


28-28: Appropriate workspace dependency added

Adding @amaxa/db as a workspace dependency makes sense since validators likely need access to database types and schemas.

pnpm-workspace.yaml (2)

6-28: Well-organized catalog for centralized dependency management

The catalog structure is well-organized with clear categorization of dependencies (Auth, Dev tooling, Misc, Tanstack & tRPC).


30-35: React19 catalog for consistent React version management

Good approach to create a dedicated React19 catalog to standardize React and its type definitions across the project.

apps/nextjs/src/app/(home)/events/page.tsx (2)

1-1: Import from arktype aligns with project's validation strategy shift

The change from zod to arktype imports is consistent with the project-wide dependency updates.


6-8: Schema definition updated to use arktype

The schema definition has been updated to use arktype's type system instead of zod.

apps/nextjs/src/app/(auth)/sign-in/page.tsx (5)

1-4: LGTM: Client-side directive and updated imports

The "use client" directive correctly marks this as a client component, and imports have been properly updated to use the new auth client module.


14-14: Component renamed to better reflect its purpose

Renaming from LoginForm to SignIn improves clarity and aligns with the component's functionality.


16-17: Improved layout with semantic HTML

Good change from div to main for better semantics, and the increased max-width (max-w-md) provides a better user experience for the sign-in card.


19-22: Updated component text for consistency

Text changes from "Login" to "Sign In" maintain consistency with the component name and function.


26-67: Simplified authentication with social login

The removal of email/password form in favor of Google sign-in streamlines the authentication flow. The implementation using signIn.social with Google provider is correct, and the SVG icon enhances the visual experience.

packages/api/package.json (2)

25-29: Good dependency management improvements

Switching to catalog references for @trpc/server, arktype, and zod ensures consistent versioning across the monorepo. Adding drizzle-zod (v0.7.1) supports schema validation between Drizzle ORM and Zod, which aligns with the database schema changes in this PR.

The update to superjson 2.2.2 is also appropriate.


35-37: Consistent dev dependencies

Moving dev dependencies to catalog references ensures development tools are consistent across the monorepo, reducing potential conflicts from mismatched versions.

packages/db/src/schema.ts (8)

13-28: Good schema standardization for user table

The user table refactoring follows modern naming conventions (lowercase) and aligns with auth provider expectations. The schema now includes important fields like emailVerified, createdAt, and updatedAt for better user management.


30-34: Updated relation definitions

Relations have been properly updated to reference the new lowercase table names, maintaining referential integrity in the database structure.


36-47: Improved session management schema

The session table refactoring adds important fields like expiresAt, token, and user agent tracking, enabling better session management and security.


49-71: Enhanced authentication provider support

The account table changes introduce fields needed for modern OAuth providers (like Google sign-in implemented in the sign-in page), including proper token management and expiration tracking.


73-80: Good addition of verification table

The new verification table supports email verification workflows, which is essential for ensuring user identity and preventing spam accounts.


125-127: Properly updated task relations

The task relations correctly reference the new user table, maintaining data integrity for task assignments.


195-197: Improved primary key definition

The updated primary key definition for project_tracker uses a cleaner array syntax, which is more maintainable and follows modern Drizzle ORM best practices.


207-210: Consistent relation definitions

The project tracker relations correctly reference the new user table structure, ensuring data integrity between projects and users.

packages/api/src/router/users.ts (5)

1-6: Updated imports for schema validation

Good transition to use arktype alongside zod for schema validation, and proper updates to schema references from uppercase User to lowercase user.


14-17: Updated table references in query

Correctly updated references from User to user in the select statement to align with the schema changes.


28-34: Simplified permission handling

The code now directly uses the permission value without additional validation checks. This assumes that the arktype validation is sufficient for ensuring valid permissions.

Verify that arktype properly validates the permission value before it's used in the database operation. If not, invalid values could be inserted into the database.


79-79: Simplified user query

Good simplification of the user query to directly select from the user table.


83-89: Using shared schema for user updates

Good practice to use the shared userUpdateSchema for validation, improving consistency across the codebase.

apps/nextjs/package.json (2)

25-25: Confirm that the custom “catalog:” references are recognized.

It appears that multiple libraries (e.g., React) have been updated to reference a custom string literal “catalog:”. Verify that your package manager and build environment handle these references properly to avoid installation or resolution errors.

To confirm, you can run a dependency resolution script or attempt a fresh install and ensure no 404 or dependency resolution issues arise.

Also applies to: 29-31, 34-34, 42-43, 49-49, 58-59, 61-61, 64-65


39-39: Check potential breaking changes in Next.js 15.2.3 upgrade.

Next.js 15.x may introduce changes that could break existing functionality. Ensure you’ve tested critical paths and consulted the Next.js migration notes to prevent runtime issues.

Please do a local development run and confirm that there are no warnings or failures related to the Next.js upgrade.

packages/validators/src/index.ts (2)

1-205: Overall schema definitions look consistent.

Apart from the minor naming inconsistencies, all other uses of createSelectSchema, createInsertSchema, and createUpdateSchema appear correct and align with their respective Drizzle definitions.


186-186:

❓ Verification inconclusive

Verify Date object usage in ArkType schemas.

doneBy: "Date" requires the caller to pass a Date object rather than a string. Confirm that all call sites correctly provide a Date object to avoid schema validation errors.

You can search for references to “doneBy” in the codebase to check for string vs. Date usage:


🏁 Script executed:

#!/bin/bash
# Searching codebase for doneBy references
rg -A 3 "doneBy"

Length of output: 2797


Action Required: Confirm Date Object Conversion for doneBy Usage

Based on the verification:

  • In packages/validators/src/index.ts, the doneBy field is defined as "Date", implying that a Date object must be provided.
  • In apps/nextjs/src/lib/init.ts and apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_components/flowchart.tsx, a Date object is explicitly constructed using new Date().
  • In apps/nextjs/src/app/(dashboard)/project/[id]/(tasks)/tasks/_actions.ts and packages/api/src/router/tasks.ts, the schema is enforced via z.date() or new Date() in some cases.
  • However, there are instances where doneBy is directly passed from task.data.doneBy without an explicit conversion.

Please ensure that all such direct references (e.g., task.data.doneBy) are validated to be Date objects and not strings to prevent schema validation errors.

Comment on lines +1 to +4
pnpm clean:workspaces
pnpm store prune,
rm -rf .turbo
pnpm i
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add shebang and improve script robustness

The script is missing a shebang line to specify which shell to use for execution.

+#!/bin/bash
+set -e  # Exit immediately if a command exits with a non-zero status
 pnpm clean:workspaces
-pnpm store prune,
+pnpm store prune
 rm -rf .turbo
 pnpm i
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pnpm clean:workspaces
pnpm store prune,
rm -rf .turbo
pnpm i
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
pnpm clean:workspaces
pnpm store prune
rm -rf .turbo
pnpm i
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

Comment on lines +10 to +16
export default function Home(props: {
searchParams: Record<string, string | string[] | undefined>;
}) {
noStore();
const { name } = searchParamsSchema.parse(props.searchParams);

const data = await api.events.all({
name: name,
});
const data = searchParamsSchema(props.searchParams);
if (data instanceof type.errors) {
console.error(data);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve error handling in arktype validation

The error handling logic logs to console but doesn't provide fallback behavior when validation fails.

export default function Home(props: {
  searchParams: Record<string, string | string[] | undefined>;
}) {
  const data = searchParamsSchema(props.searchParams);
  if (data instanceof type.errors) {
    console.error(data);
+   return (
+     <div className="min-h-screen w-full p-4 sm:p-6 lg:p-8">
+       <div className="mb-6 flex items-center justify-between">
+         <h1 className="text-3xl font-bold">Events</h1>
+         <CreateEvent />
+       </div>
+       <p>Error loading events. Please try again.</p>
+     </div>
+   );
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function Home(props: {
searchParams: Record<string, string | string[] | undefined>;
}) {
noStore();
const { name } = searchParamsSchema.parse(props.searchParams);
const data = await api.events.all({
name: name,
});
const data = searchParamsSchema(props.searchParams);
if (data instanceof type.errors) {
console.error(data);
}
export default function Home(props: {
searchParams: Record<string, string | string[] | undefined>;
}) {
const data = searchParamsSchema(props.searchParams);
if (data instanceof type.errors) {
console.error(data);
return (
<div className="min-h-screen w-full p-4 sm:p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between">
<h1 className="text-3xl font-bold">Events</h1>
<CreateEvent />
</div>
<p>Error loading events. Please try again.</p>
</div>
);
}
// ...rest of the component's code
}

Comment on lines +92 to 96
deleteuser: protectedProcedure
.input(z.object({ id: z.string() }))
.mutation(async ({ ctx, input }) => {
if (!isAdmin(ctx.session))
throw new TRPCError({
code: "UNAUTHORIZED",
message: "You do not have permissions to delete this user",
});
return await ctx.db.delete(User).where(eq(User.id, input.id));
return await ctx.db.delete(user).where(eq(user.id, input.id));
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Function naming inconsistency

The function has been renamed from deleteUser to deleteuser, which breaks the camelCase naming convention used throughout the codebase.

Correct the function name to maintain camelCase consistency:

-  deleteuser: protectedProcedure
+  deleteUser: protectedProcedure
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
deleteuser: protectedProcedure
.input(z.object({ id: z.string() }))
.mutation(async ({ ctx, input }) => {
if (!isAdmin(ctx.session))
throw new TRPCError({
code: "UNAUTHORIZED",
message: "You do not have permissions to delete this user",
});
return await ctx.db.delete(User).where(eq(User.id, input.id));
return await ctx.db.delete(user).where(eq(user.id, input.id));
}),
deleteUser: protectedProcedure
.input(z.object({ id: z.string() }))
.mutation(async ({ ctx, input }) => {
return await ctx.db.delete(user).where(eq(user.id, input.id));
}),

@not-ani not-ani merged commit cd4f615 into main Apr 6, 2025
0 of 4 checks passed
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