Skip to content

Feat/orpc#6

Merged
FindMalek merged 13 commits intomainfrom
feat/orpc
Jun 20, 2025
Merged

Feat/orpc#6
FindMalek merged 13 commits intomainfrom
feat/orpc

Conversation

@FindMalek
Copy link
Owner

@FindMalek FindMalek commented Jun 16, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new RPC-based backend architecture with authenticated CRUD operations for cards, credentials, secrets, containers, platforms, tags, and users.
    • Added comprehensive React Query hooks for all entities, supporting data fetching, caching, optimistic updates, and mutations.
    • Implemented a centralized server client and context creation for streamlined data access and SSR optimization.
    • Added middleware for authentication enforcement in RPC context.
    • Enhanced schema validation and type safety with extensive Zod schemas for all API inputs and outputs.
  • Refactor

    • Replaced direct server action calls in components with mutation hooks and query objects for improved state management and error handling.
    • Migrated encryption and tag utilities into dedicated helper modules.
    • Refined query client instantiation to maintain stable instances with default options.
  • Bug Fixes

    • Improved error handling and user feedback in form submissions and mutations, including detailed toast messages.
  • Chores

    • Updated Prisma schema with explicit table mappings and performed a comprehensive database migration.
    • Added new dependencies for ORPC ecosystem and React Query Devtools.
    • Removed legacy server action files and consolidated exports to streamline codebase.
  • Documentation

    • Expanded schema and DTO exports for containers, platforms, tags, credentials, cards, secrets, and users to enhance developer experience.

@FindMalek FindMalek self-assigned this Jun 16, 2025
@vercel
Copy link
Contributor

vercel bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
findaccount ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 5:39pm

@coderabbitai
Copy link

coderabbitai bot commented Jun 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update transitions the application from a direct server action and utility-based architecture to a modular oRPC-based structure. It removes legacy server action files, introduces orpc routers, hooks, and context, and refactors components to use the new query/mutation hooks. Prisma schemas are updated for explicit table mapping, and new utility functions and DTO schemas are added for strong typing and modularity.

Changes

Files/Paths Change Summary
actions/card/, actions/credential/, actions/encryption/, actions/secrets/, actions/user/, actions/utils/, hooks/use-platforms.ts, hooks/use-tags.ts Deleted: All legacy server action files and related hooks for cards, credentials, encryption, secrets, users, containers, tags.
components/app/dashboard-add-card-dialog.tsx, components/app/dashboard-add-credential-dialog.tsx, components/app/dashboard-add-secret-dialog.tsx, components/app/marketing-waitlist-form.tsx Refactored: Data operations now use new orpc-based mutation/query hooks instead of direct async calls or legacy actions.
components/app/dashboard-add-card-form.tsx, schemas/card/card.ts Updated: Changed import path for CardExpiryDateUtils to new helpers location.
components/app/dashboard-overview-stats.tsx Cleaned up: Removed commented-out legacy stats fetching logic.
app/(dashboard)/dashboard/page.tsx, app/(marketing)/page.tsx Refactored: Data fetching uses the new serverClient abstraction instead of direct action imports.
components/layout/layout-wrapper.tsx Updated: QueryClient is now instantiated with React state and global defaults.
lib/utils/encryption-helpers.ts, lib/utils/tag-helpers.ts Added: New server-only utility functions for encrypted data and tag creation/connection.
lib/utils/index.ts Updated: Clarified server-only utilities and re-exported new helpers.
middleware/auth.ts, middleware/index.ts Added: Middleware for public and authenticated context handling, exported from index.
orpc/client/*, orpc/context.ts, orpc/types.ts Added: oRPC client setup, query client utilities, context creation, and context type definitions.
orpc/hooks/* Added: Modular React hooks for cards, credentials, secrets, containers, tags, users, using orpc and React Query.
orpc/routers/* Added: oRPC routers for cards, credentials, secrets, containers, platforms, tags, users, with full CRUD and list operations.
orpc/routers/index.ts Added: Aggregates all routers into a single appRouter export.
app/api/orpc/[[...rest]]/route.ts Added: New API route handler for all orpc requests, supporting all HTTP verbs.
schemas/card/dto.ts, schemas/credential/dto.ts, schemas/credential/credential-with-metadata.ts, schemas/secrets/dto.ts, schemas/utils/dto.ts, schemas/utils/container-with-secrets.ts, schemas/user/statistics.ts, schemas/user/waitlist.ts Added: Zod schemas and TypeScript types for all DTOs used in orpc routers and hooks.
schemas/credential/index.ts, schemas/user/index.ts, schemas/utils/index.ts Updated: Re-exported new DTO and helper modules.
prisma/schema/cards.prisma, prisma/schema/credential.prisma, prisma/schema/encryption.prisma, prisma/schema/secrets.prisma, prisma/schema/utils.prisma Updated: Added explicit @@Map attributes to models for database table mapping.
prisma/schema/migrations/20250616192028_usage_of_map/migration.sql Added: Migration script to drop and recreate all major tables with new mappings and constraints.
package.json Updated: Added orpc, tanstack, and superjson dependencies; upgraded react-query.
prettier.config.js Updated: Removed import order pattern for "@/actions/(.*)".
TODO.md Updated: Added task to migrate non-DB functions from lib to a new services folder.

Sequence Diagram(s)

sequenceDiagram
    participant UI as React Component
    participant Hook as orpc Hook (useX)
    participant orpc as orpc Client/Router
    participant DB as Database

    UI->>Hook: Call useQuery/useMutation
    Hook->>orpc: Send request (query/mutation)
    orpc->>DB: Perform CRUD operation (with auth/context)
    DB-->>orpc: Return data/result
    orpc-->>Hook: Return typed response
    Hook-->>UI: Provide data, status, errors
Loading

Poem

The old ways are gone, the actions retired,
Now oRPC routers and hooks are inspired!
With schemas and types, our data flows neat,
Prisma models mapped, migrations complete.
Queries and mutations, all in a row,
This bunny’s excited—let’s watch it all grow!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

orpc/routers/credential.ts

Oops! Something went wrong! :(

ESLint: 9.26.0

ESLint couldn't find the plugin "eslint-plugin-react-hooks".

(The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react-hooks@latest --save-dev

The plugin "eslint-plugin-react-hooks" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.2_eslint@9.26.0_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.

app/(marketing)/page.tsx

Oops! Something went wrong! :(

ESLint: 9.26.0

ESLint couldn't find the plugin "eslint-plugin-react-hooks".

(The package "eslint-plugin-react-hooks" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react-hooks@latest --save-dev

The plugin "eslint-plugin-react-hooks" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.2_eslint@9.26.0_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@FindMalek FindMalek marked this pull request as ready for review June 19, 2025 16:53
Copy link

@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: 10

🔭 Outside diff range comments (1)
prisma/schema/migrations/20250616192028_usage_of_map/migration.sql (1)

1-430: ⚠️ CRITICAL: This migration will DELETE ALL DATA!

This migration drops all existing tables before recreating them, which will result in complete data loss. This is extremely dangerous for production environments.

If you need to rename tables while preserving data, use ALTER TABLE statements instead:

-- Example of safe table renaming
ALTER TABLE "Card" RENAME TO "card";
ALTER TABLE "CardMetadata" RENAME TO "card_metadata";
-- ... etc for all tables

If this is intentionally destructive (e.g., for initial setup only), please:

  1. Add a clear warning comment at the top of the migration
  2. Ensure this migration is never run on production
  3. Consider adding a safety check or requiring explicit confirmation
🧹 Nitpick comments (12)
TODO.md (1)

54-56: Add priority label to the new TODO item.
To maintain the established format, append || Low (or an appropriate priority) after the new task Use services instead of \lib` files`.

orpc/context.ts (1)

7-24: Consider structured logging for production environments.

The context creation function is well-implemented with proper error handling and appropriate fallback values. However, consider replacing console.error with structured logging for production environments to improve observability and error tracking.

For production, consider using a logging library:

  } catch (error) {
-    console.error("Failed to get session:", error)
+    // Use your preferred logging library (e.g., winston, pino)
+    logger.error("Failed to get session", { error: error.message, stack: error.stack })
    return {
      session: null,
      user: null,
    }
  }
app/api/orpc/[[...rest]]/route.ts (1)

10-10: Consider caching context creation for performance.

Creating context on every request might be expensive, especially if createContext() performs database queries or external API calls. Consider implementing request-level caching or memoization if appropriate.

lib/utils/encryption-helpers.ts (1)

23-23: Consider structured logging for production.

While console.error works for development, consider using a structured logging solution for production environments.

-    console.error("Error creating encrypted data:", error)
+    console.error("Error creating encrypted data:", {
+      error: error instanceof Error ? error.message : String(error),
+      stack: error instanceof Error ? error.stack : undefined,
+    })
middleware/auth.ts (1)

14-31: Consider simplifying context object construction in authMiddleware.

The middleware correctly enforces authentication and narrows the context type. However, the context reconstruction could be simplified.

Instead of spreading the entire context and then explicitly setting session and user, consider using type assertion since we've already validated their presence:

  return next({
-   context: {
-     session: context.session,
-     user: context.user,
-   },
+   context: context as AuthenticatedContext,
  })

This approach is more efficient and leverages TypeScript's type system effectively.

schemas/credential/credential-with-metadata.ts (1)

12-17: Consider clarifying the distinction between error and issues fields.

Having both error and issues as optional fields in the output schema could be confusing. Consider documenting when each field is used, or combining them into a single field for consistency.

export const createCredentialWithMetadataOutputSchema = z.object({
  success: z.boolean(),
  credential: credentialOutputSchema.optional(),
-  error: z.string().optional(),
-  issues: z.array(z.string()).optional(),
+  error: z.string().optional(), // For general errors
+  issues: z.array(z.string()).optional(), // For validation errors
})
components/app/dashboard-add-credential-dialog.tsx (2)

150-159: Remove redundant validation checks.

These validation checks for identifier and password are redundant since the form already uses zodResolver(credentialDtoSchema) which should handle this validation. The form's trigger() method on line 172 will catch these validation errors.

-    if (!sensitiveData.identifier.trim()) {
-      toast("Identifier is required", "error")
-      return
-    }
-
-    if (!sensitiveData.password.trim()) {
-      toast("Password is required", "error")
-      return
-    }
-
     try {

326-330: Simplify the tag mapping.

Explicitly setting optional fields to undefined is unnecessary. TypeScript already treats missing optional properties as undefined.

-            availableTags={availableTags.map((tag) => ({
-              name: tag.name,
-              containerId: tag.containerId || undefined,
-              color: tag.color || undefined,
-            }))}
+            availableTags={availableTags}
orpc/routers/user.ts (1)

67-67: Consider using z.void() for procedures without input.

For procedures that don't require any input, using z.void() is cleaner than z.object({}).

-  .input(z.object({}))
+  .input(z.void())

Also applies to: 76-76, 85-85

orpc/hooks/use-containers.ts (1)

161-164: Consider using setQueryData instead of removeQueries for better UX.

Using removeQueries completely removes the cached data, which might cause loading states to appear. Consider setting the data to null or undefined instead to maintain smoother UI transitions.

-        // Optimistically remove from cache
-        queryClient.removeQueries({
-          queryKey: orpc.containers.get.key({ input: { id: input.id } }),
-        })
+        // Optimistically mark as deleted in cache
+        queryClient.setQueryData(
+          orpc.containers.get.queryKey({ input: { id: input.id } }),
+          null
+        )
orpc/routers/secret.ts (1)

55-59: Consider the implications of updating lastViewed on every get operation.

Updating the lastViewed timestamp on every GET request is a side effect that might not be expected from a read operation. This could also impact performance with frequent reads and may not align with RESTful principles where GET operations should be idempotent.

Consider either:

  1. Making this update optional via a query parameter
  2. Moving this to a separate "markAsViewed" procedure
  3. Documenting this behavior clearly for API consumers
-    // Update last viewed timestamp
-    await database.secret.update({
-      where: { id: input.id },
-      data: { lastViewed: new Date() },
-    })
+    // Optionally update last viewed timestamp
+    if (input.updateLastViewed !== false) {
+      await database.secret.update({
+        where: { id: input.id },
+        data: { lastViewed: new Date() },
+      })
+    }
orpc/hooks/use-credentials.ts (1)

35-56: Consider more robust error handling.

The current error handling only logs to console. Consider exposing errors to the UI for better user feedback.

You could enhance error handling by:

  1. Using toast notifications to display errors to users
  2. Returning the error from the hook for component-level handling
  3. Implementing a global error boundary

Example with toast:

 onError: (error) => {
   console.error("Failed to create credential:", error)
+  // toast.error("Failed to create credential. Please try again.")
 },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 34c58e3 and e153806.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (82)
  • TODO.md (1 hunks)
  • actions/card/card-metadata.ts (0 hunks)
  • actions/card/card.ts (0 hunks)
  • actions/card/index.ts (0 hunks)
  • actions/credential/credential-metadata.ts (0 hunks)
  • actions/credential/credential.ts (0 hunks)
  • actions/credential/index.ts (0 hunks)
  • actions/encryption/card-encryption.ts (0 hunks)
  • actions/encryption/credential-encryption.ts (0 hunks)
  • actions/encryption/encrypted-data.ts (0 hunks)
  • actions/encryption/index.ts (0 hunks)
  • actions/encryption/secret-encryption.ts (0 hunks)
  • actions/secrets/index.ts (0 hunks)
  • actions/secrets/secret-metadata.ts (0 hunks)
  • actions/secrets/secret.ts (0 hunks)
  • actions/user/index.ts (0 hunks)
  • actions/user/user.ts (0 hunks)
  • actions/user/waitlist.ts (0 hunks)
  • actions/utils/container.ts (0 hunks)
  • actions/utils/index.ts (0 hunks)
  • actions/utils/platform.ts (0 hunks)
  • actions/utils/tag.ts (0 hunks)
  • app/(dashboard)/dashboard/page.tsx (3 hunks)
  • app/(marketing)/page.tsx (1 hunks)
  • app/api/orpc/[[...rest]]/route.ts (1 hunks)
  • components/app/dashboard-add-card-dialog.tsx (5 hunks)
  • components/app/dashboard-add-card-form.tsx (1 hunks)
  • components/app/dashboard-add-credential-dialog.tsx (8 hunks)
  • components/app/dashboard-add-secret-dialog.tsx (5 hunks)
  • components/app/dashboard-overview-stats.tsx (0 hunks)
  • components/app/marketing-waitlist-form.tsx (5 hunks)
  • components/layout/layout-wrapper.tsx (1 hunks)
  • hooks/use-platforms.ts (0 hunks)
  • hooks/use-tags.ts (0 hunks)
  • lib/utils/encryption-helpers.ts (1 hunks)
  • lib/utils/index.ts (2 hunks)
  • lib/utils/tag-helpers.ts (1 hunks)
  • middleware/auth.ts (1 hunks)
  • middleware/index.ts (1 hunks)
  • orpc/client/index.ts (1 hunks)
  • orpc/client/query.ts (1 hunks)
  • orpc/client/rpc.ts (1 hunks)
  • orpc/client/server.ts (1 hunks)
  • orpc/client/utils.ts (1 hunks)
  • orpc/context.ts (1 hunks)
  • orpc/hooks/index.ts (1 hunks)
  • orpc/hooks/use-cards.ts (1 hunks)
  • orpc/hooks/use-containers.ts (1 hunks)
  • orpc/hooks/use-credentials.ts (1 hunks)
  • orpc/hooks/use-platforms.ts (1 hunks)
  • orpc/hooks/use-secrets.ts (1 hunks)
  • orpc/hooks/use-tags.ts (1 hunks)
  • orpc/hooks/use-users.ts (1 hunks)
  • orpc/routers/card.ts (1 hunks)
  • orpc/routers/container.ts (1 hunks)
  • orpc/routers/credential.ts (1 hunks)
  • orpc/routers/index.ts (1 hunks)
  • orpc/routers/platform.ts (1 hunks)
  • orpc/routers/secret.ts (1 hunks)
  • orpc/routers/tag.ts (1 hunks)
  • orpc/routers/user.ts (1 hunks)
  • orpc/types.ts (1 hunks)
  • package.json (3 hunks)
  • prettier.config.js (1 hunks)
  • prisma/schema/cards.prisma (2 hunks)
  • prisma/schema/credential.prisma (3 hunks)
  • prisma/schema/encryption.prisma (1 hunks)
  • prisma/schema/migrations/20250616192028_usage_of_map/migration.sql (1 hunks)
  • prisma/schema/secrets.prisma (2 hunks)
  • prisma/schema/utils.prisma (3 hunks)
  • schemas/card/card.ts (1 hunks)
  • schemas/card/dto.ts (1 hunks)
  • schemas/credential/credential-with-metadata.ts (1 hunks)
  • schemas/credential/dto.ts (1 hunks)
  • schemas/credential/index.ts (1 hunks)
  • schemas/secrets/dto.ts (1 hunks)
  • schemas/user/index.ts (1 hunks)
  • schemas/user/statistics.ts (1 hunks)
  • schemas/user/waitlist.ts (1 hunks)
  • schemas/utils/container-with-secrets.ts (1 hunks)
  • schemas/utils/dto.ts (1 hunks)
  • schemas/utils/index.ts (1 hunks)
💤 Files with no reviewable changes (24)
  • actions/user/index.ts
  • actions/secrets/index.ts
  • actions/encryption/index.ts
  • components/app/dashboard-overview-stats.tsx
  • actions/utils/index.ts
  • actions/card/index.ts
  • hooks/use-platforms.ts
  • actions/encryption/credential-encryption.ts
  • actions/credential/index.ts
  • actions/encryption/secret-encryption.ts
  • hooks/use-tags.ts
  • actions/secrets/secret-metadata.ts
  • actions/encryption/card-encryption.ts
  • actions/credential/credential-metadata.ts
  • actions/encryption/encrypted-data.ts
  • actions/utils/platform.ts
  • actions/card/card-metadata.ts
  • actions/user/user.ts
  • actions/credential/credential.ts
  • actions/utils/container.ts
  • actions/user/waitlist.ts
  • actions/utils/tag.ts
  • actions/card/card.ts
  • actions/secrets/secret.ts
🧰 Additional context used
🧬 Code Graph Analysis (27)
orpc/client/utils.ts (2)
orpc/client/index.ts (2)
  • orpc (1-1)
  • rpcClient (2-2)
orpc/client/rpc.ts (1)
  • rpcClient (16-16)
orpc/routers/index.ts (7)
orpc/routers/card.ts (1)
  • cardRouter (292-298)
orpc/routers/credential.ts (1)
  • credentialRouter (352-359)
orpc/routers/secret.ts (1)
  • secretRouter (215-221)
orpc/routers/container.ts (1)
  • containerRouter (278-285)
orpc/routers/platform.ts (1)
  • platformRouter (82-84)
orpc/routers/tag.ts (1)
  • tagRouter (77-79)
orpc/routers/user.ts (1)
  • userRouter (93-98)
app/(dashboard)/dashboard/page.tsx (6)
schemas/card/dto.ts (1)
  • ListCardsOutput (44-44)
schemas/secrets/dto.ts (1)
  • ListSecretsOutput (44-44)
schemas/credential/dto.ts (1)
  • ListCredentialsOutput (45-45)
orpc/context.ts (1)
  • createContext (7-24)
orpc/client/server.ts (1)
  • createServerClient (11-17)
config/consts.ts (1)
  • MAX_RECENT_ITEMS (10-10)
orpc/types.ts (1)
types/dashboard.d.ts (1)
  • User (1-9)
orpc/client/rpc.ts (2)
orpc/client/index.ts (1)
  • rpcClient (2-2)
orpc/routers/index.ts (1)
  • AppRouter (19-19)
orpc/routers/platform.ts (3)
orpc/types.ts (1)
  • ORPCContext (3-6)
schemas/utils/dto.ts (3)
  • listPlatformsInputSchema (53-57)
  • listPlatformsOutputSchema (61-67)
  • ListPlatformsOutput (109-109)
prisma/client/index.ts (1)
  • database (31-31)
orpc/client/server.ts (2)
orpc/types.ts (1)
  • ORPCContext (3-6)
orpc/routers/index.ts (1)
  • appRouter (9-17)
orpc/hooks/use-users.ts (1)
orpc/client/utils.ts (1)
  • orpc (6-8)
lib/utils/encryption-helpers.ts (2)
schemas/encryption/encryption.ts (1)
  • EncryptedDataDto (9-9)
prisma/client/index.ts (1)
  • database (31-31)
lib/utils/tag-helpers.ts (2)
schemas/utils/tag.ts (1)
  • TagDto (9-9)
prisma/client/index.ts (1)
  • database (31-31)
app/api/orpc/[[...rest]]/route.ts (2)
orpc/routers/index.ts (1)
  • appRouter (9-17)
orpc/context.ts (1)
  • createContext (7-24)
orpc/context.ts (2)
orpc/types.ts (1)
  • ORPCContext (3-6)
lib/auth/server.ts (1)
  • auth (9-21)
schemas/secrets/dto.ts (1)
schemas/secrets/secret.ts (5)
  • secretDtoSchema (6-14)
  • getSecretByIdDtoSchema (35-37)
  • updateSecretDtoSchema (41-43)
  • deleteSecretDtoSchema (47-49)
  • secretSimpleRoSchema (18-31)
schemas/card/dto.ts (1)
schemas/card/card.ts (5)
  • cardDtoSchema (61-79)
  • getCardByIdDtoSchema (110-112)
  • updateCardDtoSchema (116-118)
  • deleteCardDtoSchema (122-124)
  • cardSimpleRoSchema (83-106)
middleware/auth.ts (2)
middleware/index.ts (2)
  • publicMiddleware (1-1)
  • authMiddleware (1-1)
orpc/types.ts (2)
  • PublicContext (13-13)
  • AuthenticatedContext (8-11)
orpc/routers/tag.ts (3)
orpc/types.ts (1)
  • ORPCContext (3-6)
schemas/utils/dto.ts (3)
  • listTagsInputSchema (75-80)
  • listTagsOutputSchema (84-90)
  • ListTagsOutput (118-118)
prisma/client/index.ts (1)
  • database (31-31)
app/(marketing)/page.tsx (1)
orpc/client/server.ts (1)
  • createServerClient (11-17)
schemas/credential/dto.ts (1)
schemas/credential/credential.ts (5)
  • credentialDtoSchema (17-29)
  • getCredentialByIdDtoSchema (52-54)
  • updateCredentialDtoSchema (58-60)
  • deleteCredentialDtoSchema (64-66)
  • credentialSimpleRoSchema (33-48)
schemas/utils/container-with-secrets.ts (3)
schemas/utils/dto.ts (2)
  • createContainerInputSchema (26-26)
  • containerOutputSchema (37-37)
schemas/encryption/encryption.ts (1)
  • encryptedDataDtoSchema (3-7)
schemas/secrets/dto.ts (1)
  • secretOutputSchema (26-26)
schemas/credential/credential-with-metadata.ts (2)
schemas/credential/dto.ts (2)
  • createCredentialInputSchema (12-12)
  • credentialOutputSchema (27-27)
schemas/credential/credential-metadata.ts (1)
  • credentialMetadataDtoSchema (3-11)
orpc/hooks/use-containers.ts (2)
orpc/client/utils.ts (1)
  • orpc (6-8)
schemas/utils/dto.ts (2)
  • ListContainersInput (97-97)
  • ContainerOutput (99-99)
orpc/hooks/use-credentials.ts (3)
orpc/client/index.ts (1)
  • orpc (1-1)
orpc/client/utils.ts (1)
  • orpc (6-8)
schemas/credential/dto.ts (2)
  • ListCredentialsInput (42-42)
  • CredentialOutput (44-44)
orpc/routers/user.ts (4)
orpc/types.ts (1)
  • ORPCContext (3-6)
schemas/user/waitlist.ts (5)
  • joinWaitlistInputSchema (4-6)
  • joinWaitlistOutputSchema (8-11)
  • JoinWaitlistOutput (19-19)
  • getWaitlistCountOutputSchema (13-15)
  • GetWaitlistCountOutput (20-22)
prisma/client/index.ts (1)
  • database (31-31)
schemas/user/statistics.ts (4)
  • getUserCountOutputSchema (4-6)
  • GetUserCountOutput (13-13)
  • getEncryptedDataCountOutputSchema (8-10)
  • GetEncryptedDataCountOutput (14-16)
orpc/routers/container.ts (5)
orpc/types.ts (1)
  • ORPCContext (3-6)
schemas/utils/dto.ts (7)
  • getContainerInputSchema (27-27)
  • containerOutputSchema (37-37)
  • listContainersInputSchema (31-35)
  • listContainersOutputSchema (39-45)
  • createContainerInputSchema (26-26)
  • updateContainerInputSchema (28-28)
  • deleteContainerInputSchema (29-29)
entities/utils/container/entity.ts (1)
  • ContainerEntity (7-63)
lib/utils/tag-helpers.ts (1)
  • createTagsAndGetConnections (5-42)
schemas/utils/container-with-secrets.ts (3)
  • createContainerWithSecretsInputSchema (8-17)
  • createContainerWithSecretsOutputSchema (19-24)
  • CreateContainerWithSecretsOutput (29-31)
schemas/utils/dto.ts (3)
schemas/utils/container.ts (5)
  • containerDtoSchema (6-14)
  • getContainerByIdDtoSchema (35-37)
  • updateContainerDtoSchema (41-43)
  • deleteContainerDtoSchema (47-49)
  • containerSimpleRoSchema (18-31)
schemas/utils/platform.ts (5)
  • platformDtoSchema (4-14)
  • getPlatformByIdDtoSchema (36-38)
  • updatePlatformDtoSchema (42-44)
  • deletePlatformDtoSchema (48-50)
  • platformSimpleRoSchema (18-32)
schemas/utils/tag.ts (5)
  • tagDtoSchema (3-7)
  • getTagByIdDtoSchema (23-25)
  • updateTagDtoSchema (29-31)
  • deleteTagDtoSchema (35-37)
  • tagSimpleRoSchema (11-19)
orpc/hooks/use-secrets.ts (2)
orpc/client/utils.ts (1)
  • orpc (6-8)
schemas/secrets/dto.ts (2)
  • ListSecretsInput (41-41)
  • SecretOutput (43-43)
orpc/hooks/use-cards.ts (3)
schemas/card/dto.ts (2)
  • ListCardsInput (41-41)
  • CardOutput (43-43)
orpc/client/index.ts (1)
  • orpc (1-1)
orpc/client/utils.ts (1)
  • orpc (6-8)
🔇 Additional comments (80)
prettier.config.js (1)

27-27: Approve removal of deprecated import order pattern.
The legacy @/actions/(.*) grouping is obsolete after migrating to ORPC routers and has been rightly removed.

schemas/card/card.ts (1)

5-5: Approve updated import path for card expiry utilities.
This change aligns with the relocated helper in lib/utils and ensures the schema’s expiry validation continues to work.

components/app/dashboard-add-card-form.tsx (1)

12-12: Approve import path update for expiry helpers.
The component now correctly references the moved card-expiry-helpers, preserving expiry field handling.

schemas/utils/index.ts (1)

2-2: Approve export of container-with-secrets.
Re-exporting this schema supports the new ORPC createContainerWithSecrets router and hook.

schemas/user/index.ts (1)

2-3: Verify that the exported modules exist.

Ensure that the ./waitlist and ./statistics modules exist in the schemas/user directory to prevent import errors.

#!/bin/bash
# Description: Verify that the waitlist and statistics modules exist in the schemas/user directory
# Expected: Both waitlist.ts and statistics.ts files should exist

fd -t f "waitlist\.(ts|js)" schemas/user/
fd -t f "statistics\.(ts|js)" schemas/user/
middleware/index.ts (1)

1-1: Verify that the auth module exists and exports the expected functions.

Ensure that the ./auth module exists and exports both publicMiddleware and authMiddleware functions to prevent import errors.

#!/bin/bash
# Description: Verify that the auth module exists and exports the expected middleware functions
# Expected: auth.ts file should exist and export publicMiddleware and authMiddleware

# Check if auth module exists
fd -t f "auth\.(ts|js)" middleware/

# Check for the exported functions in the auth module
if [ -f "middleware/auth.ts" ]; then
  echo "=== Checking exports in middleware/auth.ts ==="
  rg -A 3 "export.*publicMiddleware|export.*authMiddleware" middleware/auth.ts
elif [ -f "middleware/auth.js" ]; then
  echo "=== Checking exports in middleware/auth.js ==="
  rg -A 3 "export.*publicMiddleware|export.*authMiddleware" middleware/auth.js
fi
prisma/schema/encryption.prisma (1)

35-35: LGTM! Good practice for explicit table mapping.

Adding the @@map("encrypted_data") attribute ensures explicit mapping to the database table name, which is a good practice for maintaining clear naming conventions and avoiding potential issues with Prisma's default table naming.

components/layout/layout-wrapper.tsx (2)

3-3: LGTM! Proper React import for useState.

Adding the useState import is necessary for the QueryClient initialization pattern.


10-20: LGTM! Excellent QueryClient setup following React Query best practices.

The lazy initialization pattern using useState(() => new QueryClient(...)) ensures the QueryClient instance remains stable across renders. The configuration options are well-chosen:

  • staleTime: 60 * 1000 prevents unnecessary refetches for 1 minute
  • refetchOnWindowFocus: false prevents automatic refetching when the window regains focus

This implementation follows React Query best practices for client-side QueryClient instantiation.

schemas/credential/index.ts (1)

2-2: Verify that the exported module exists.

Ensure that the ./credential-with-metadata module exists in the schemas/credential directory to prevent import errors.

#!/bin/bash
# Description: Verify that the credential-with-metadata module exists in the schemas/credential directory
# Expected: credential-with-metadata.ts file should exist

fd -t f "credential-with-metadata\.(ts|js)" schemas/credential/
orpc/client/index.ts (1)

1-3: Centralized ORPC client exports
This index file cleanly consolidates the core RPC client and query utilities for easy imports across the app.

lib/utils/index.ts (2)

1-2: Clarify server-only utilities
The added comments clearly indicate that encryption-helpers and tag-helpers are server-only, improving maintainability.


27-28: Re-export new helper modules
Centralizing card-expiry-helpers and password-helpers simplifies imports and maintains consistency with other utility exports.

orpc/client/utils.ts (1)

1-8: Instantiate Tanstack Query utilities
Creating and exporting the orpc instance with createTanstackQueryUtils and the RPC client correctly sets up typed, cache-aware RPC hooks.

prisma/schema/cards.prisma (2)

65-65: Explicit table mapping for Card model
Mapping the Card model to the card table ensures alignment with the existing database naming conventions and migrations.


105-105: Explicit table mapping for CardMetadata model
Mapping CardMetadata to card_metadata keeps the schema and migration in sync.

prisma/schema/secrets.prisma (2)

41-41: Explicit table mapping for Secret model
Adding @@map("secret") correctly aligns the Prisma model with the underlying secret table.


68-68: Explicit table mapping for SecretMetadata model
The @@map("secret_metadata") directive ensures the metadata model matches the renamed table.

orpc/hooks/use-tags.ts (1)

1-15: Well-implemented React Query hook with proper defaults.

The hook implementation follows React Query best practices with appropriate default pagination values, proper TypeScript typing, and placeholder data handling for UI stability during refetches.

orpc/client/rpc.ts (1)

8-16: Verify environment variable configuration.

The RPC client setup is well-implemented with proper typing. However, ensure that NEXT_PUBLIC_APP_URL is properly configured in your environment variables since this is critical for the client to connect to the correct API endpoint.

#!/bin/bash
# Description: Check if NEXT_PUBLIC_APP_URL is defined in environment files
# Expected: Find the environment variable definition

fd -e env -e local | xargs grep -l "NEXT_PUBLIC_APP_URL" || echo "Environment variable not found in .env files"
prisma/schema/credential.prisma (3)

54-54: Good practice: Explicit table mapping for Credential model.

Adding explicit @@map("credential") directive improves clarity and ensures consistent table naming across environments.


85-85: Consistent table mapping for CredentialHistory.

The @@map("credential_history") mapping maintains consistency with the database naming convention.


112-112: Consistent table mapping for CredentialMetadata.

The @@map("credential_metadata") mapping completes the consistent explicit table naming pattern.

orpc/hooks/index.ts (1)

1-7: Clean barrel export pattern for centralized hook imports.

The barrel export provides a convenient centralized import point for all orpc hooks, following consistent naming conventions across all domain entities.

orpc/hooks/use-platforms.ts (2)

8-17: LGTM! Well-structured React Query hook with good UX considerations.

The hook implementation follows React Query best practices:

  • Sensible default pagination parameters
  • placeholderData maintains UI stability during refetches
  • Proper integration with oRPC client

4-4: Verify the DTO schema import path.

Ensure that the ListPlatformsInput type is correctly exported from the specified schema path and matches the expected structure for the oRPC router.

#!/bin/bash
# Description: Verify that ListPlatformsInput is properly exported from the schema file
# Expected: The type should be exported and match pagination structure

# Check if the schema file exists and exports ListPlatformsInput
fd "dto.ts" --exec grep -l "ListPlatformsInput" {} \;

# Look for the actual type definition
ast-grep --pattern 'export type ListPlatformsInput = $_'
schemas/user/waitlist.ts (3)

4-6: LGTM! Proper email validation with clear error message.

The input schema correctly validates email format with a user-friendly error message.


8-11: Good error handling structure in output schema.

The output schema properly handles both success and error states with optional error messaging.


13-15: Appropriate constraints for waitlist count.

Using int().min(0) ensures the count is a non-negative integer, which is logically correct for a count value.

package.json (3)

88-88: Good addition of superjson for RPC serialization.

Adding superjson is appropriate for handling complex data serialization in oRPC calls, supporting dates, undefined values, and other JavaScript types.


29-33: Verify oRPC package versions are latest and secure.

The oRPC packages are added with specific version constraints. Ensure these are the latest stable versions and check for any known security vulnerabilities.

What are the latest stable versions of @orpc/client, @orpc/server, @orpc/next, @orpc/react-query, and @orpc/tanstack-query packages?

63-64: Verify React Query version compatibility.

The React Query version was upgraded to ^5.80.7. Ensure this version is compatible with the oRPC React Query integration and check for any breaking changes.

Are there any breaking changes in @tanstack/react-query version 5.80.7 that might affect the oRPC integration?
prisma/schema/utils.prisma (3)

39-39: Good practice: Explicit table mapping added.

Adding @@map("platform") provides explicit control over the database table name and improves schema clarity.


68-68: Consistent table mapping for Tag model.

The explicit mapping to "tag" table maintains consistency with the Platform model changes.


110-110: Consistent table mapping for Container model.

The explicit mapping to "container" table completes the consistent approach across all utility models.

app/(marketing)/page.tsx (3)

1-1: LGTM! Correct import for server client.

The import follows the new oRPC client architecture pattern.


11-14: Appropriate server client creation for public marketing page.

Creating the server client with null session and user is correct for a public marketing page that doesn't require authentication.


17-19: Let's inspect how the results are used in app/(marketing)/page.tsx to confirm property access:

#!/bin/bash
set -e

# Show surrounding lines where each method is called
rg -n -C3 "serverClient.users.getWaitlistCount" --glob "app/(marketing)/page.tsx"
rg -n -C3 "serverClient.users.getUserCount" --glob "app/(marketing)/page.tsx"
rg -n -C3 "serverClient.users.getEncryptedDataCount" --glob "app/(marketing)/page.tsx"

# Check property access in this file
rg -n -C3 "\.total" --glob "app/(marketing)/page.tsx"
rg -n -C3 "\.count" --glob "app/(marketing)/page.tsx"
orpc/client/server.ts (1)

7-17: LGTM! Clean and well-documented SSR client implementation.

The server client factory is well-designed with:

  • Clear JSDoc documentation explaining the SSR optimization purpose
  • Proper type safety with RouterClient generic
  • Correct context callback pattern for oRPC
orpc/routers/index.ts (1)

9-17: LGTM! Clean router aggregation with consistent naming.

The router consolidation follows good practices:

  • Consistent naming between imports and exported properties
  • Clean aggregation pattern
  • Proper type export for strong typing
components/app/marketing-waitlist-form.tsx (1)

22-44: LGTM! Well-executed refactor to use oRPC mutation hook.

The migration from direct action calls to the useJoinWaitlist hook is well-implemented:

  • Proper error handling for both success with error and actual errors
  • Consistent toast notifications for user feedback
  • Correct usage of mutation state for loading indicators
orpc/hooks/use-users.ts (2)

10-25: LGTM! Well-implemented mutation hook with proper cache management.

The useJoinWaitlist hook demonstrates good practices:

  • Proper cache invalidation to keep data fresh
  • Error logging for debugging
  • Clean integration with React Query patterns

28-55: LGTM! Consistent query hooks with appropriate caching strategy.

The query hooks are well-implemented with:

  • Consistent 5-minute stale time across all count queries
  • Proper empty input objects for parameterless queries
  • Clean, predictable API surface
lib/utils/tag-helpers.ts (1)

5-9: Add error handling and consider transaction management.

The function lacks proper error handling and doesn't use database transactions, which could lead to inconsistent state if operations fail partway through.

Consider wrapping the database operations in a transaction:

export async function createTagsAndGetConnections(
  tags: TagDto[],
  userId: string,
  containerId?: string
-): Promise<Prisma.TagCreateNestedManyWithoutContainerInput> {
+): Promise<Prisma.TagCreateNestedManyWithoutContainerInput> {
+  try {
+    return await database.$transaction(async (tx) => {
      // ... database operations using tx instead of database
+    })
+  } catch (error) {
+    console.error("Error in createTagsAndGetConnections:", error)
+    throw error
+  }

Likely an incorrect or invalid review comment.

orpc/routers/platform.ts (3)

21-33: Well-implemented authentication middleware.

The authentication procedure correctly validates session and user presence, ensuring type safety by narrowing the context types.


53-61: Good use of Promise.all for concurrent queries.

Efficiently fetches both the data and total count concurrently, which improves performance compared to sequential queries.


48-50: Verify case-insensitive search behavior.

The search uses mode: "insensitive" which works well for PostgreSQL, but ensure this behaves as expected across all supported database providers.

#!/bin/bash
# Description: Check database provider and search behavior
# Expected: Confirm database provider supports case-insensitive search

# Check the database provider in Prisma schema
fd -e prisma | xargs grep -n "provider"
lib/utils/encryption-helpers.ts (1)

4-29: Clean implementation with proper error handling.

The function follows good practices with structured return types and comprehensive error handling.

schemas/user/statistics.ts (1)

4-16: Well-structured schema definitions.

The schemas correctly validate statistics outputs with appropriate constraints (min(0) for counts) and provide proper TypeScript type exports.

app/(dashboard)/dashboard/page.tsx (3)

2-6: Clean migration to ORPC architecture.

The imports have been properly updated to use the new ORPC client and explicit DTO types, improving type safety.


77-78: Proper context and client initialization.

The server client is correctly initialized with the authentication context, following the ORPC pattern.


82-93: Explicit pagination parameters improve clarity.

The refactored calls now explicitly specify pagination parameters instead of relying on defaults, making the behavior more predictable and maintainable.

orpc/types.ts (1)

1-14: Well-structured context type definitions for ORPC architecture.

The context interfaces are cleanly designed with proper separation between public and authenticated contexts. The type hierarchy correctly ensures that AuthenticatedContext guarantees non-null session and user properties while ORPCContext allows them to be nullable.

middleware/auth.ts (1)

4-12: LGTM: Public middleware correctly passes through context.

The publicMiddleware function properly passes the public context unchanged to the next middleware in the chain.

schemas/card/dto.ts (3)

11-23: Well-designed DTO schemas with proper validation constraints.

The input schemas are correctly aliased from the base schemas, and the listCardsInputSchema includes appropriate pagination constraints (max limit of 100) and optional filtering parameters.


25-34: Consistent output schema structure for API responses.

The output schemas follow a consistent pattern with proper pagination metadata including hasMore flag, which is helpful for UI implementations.


36-44: Complete type exports for strong typing.

All schemas have corresponding TypeScript type exports, ensuring type safety throughout the application.

schemas/secrets/dto.ts (2)

11-34: Consistent DTO schema pattern across domains.

The secret DTO schemas follow the same well-established pattern as the card schemas, maintaining consistency in pagination limits, validation constraints, and output structure. This uniformity is excellent for API predictability.


36-44: Complete type safety with proper exports.

All schemas have corresponding TypeScript type exports, maintaining the same type safety standards across the application.

orpc/routers/tag.ts (2)

36-74: Well-implemented paginated listing with proper optimization.

The listTags procedure demonstrates good practices:

  • Proper input validation with Zod schemas
  • Efficient parallel database queries using Promise.all
  • Correct pagination logic with hasMore calculation
  • Safe query construction preventing SQL injection
  • Case-insensitive search implementation

77-79: Clean router export structure.

The router object export follows a clear naming convention that will integrate well with the overall application router.

orpc/client/query.ts (1)

39-51: LGTM! Solid singleton pattern implementation.

The singleton pattern is properly implemented with server-side fresh instances and client-side reuse. The typeof window === "undefined" check correctly identifies the server environment.

schemas/credential/dto.ts (2)

18-24: LGTM! Well-structured pagination schema.

The pagination schema correctly enforces constraints with sensible defaults:

  • Page starts at 1 with minimum validation
  • Limit is capped at 100 to prevent abuse
  • Optional filtering parameters for search, container, and platform

29-35: LGTM! Comprehensive output schema for paginated results.

The output schema includes all necessary pagination metadata (total, hasMore, page, limit) which enables proper client-side pagination handling.

components/app/dashboard-add-card-dialog.tsx (3)

32-32: LGTM! Proper migration to mutation hook.

The migration from direct server action calls to the useCreateCard mutation hook follows the correct oRPC pattern.


116-160: LGTM! Well-structured mutation with proper callbacks.

The mutation implementation correctly:

  • Uses the mutate method with proper data structure
  • Handles success with toast notifications and conditional dialog closure
  • Resets form state appropriately for "create more" functionality
  • Provides detailed error handling with the handleErrors utility

191-191: LGTM! Proper loading state integration.

The isPending property from the mutation hook correctly replaces the previous manual isSubmitting state management.

schemas/utils/container-with-secrets.ts (2)

8-17: LGTM! Well-structured input schema for atomic operations.

The schema correctly combines container and secrets creation:

  • Reuses existing createContainerInputSchema for consistency
  • Properly validates encrypted secret data using encryptedDataDtoSchema
  • Enforces required fields with appropriate error messages

19-24: LGTM! Comprehensive output schema for transaction results.

The output schema provides:

  • Success boolean for operation status
  • Optional container and secrets data for successful operations
  • Error message for failure cases
  • Proper use of optional fields for different response scenarios
components/app/dashboard-add-secret-dialog.tsx (4)

29-29: LGTM! Proper migration to container with secrets hook.

The component correctly uses the useCreateContainerWithSecrets mutation hook, which aligns with the new atomic operation pattern for creating containers with associated secrets.


65-70: LGTM! Proper validation for key-value pairs.

The validation correctly ensures that parsed key-value pairs are not empty before proceeding with encryption and submission.


92-156: LGTM! Well-structured batch secret creation with proper error handling.

The mutation implementation correctly:

  • Creates container and secrets atomically using the createContainerWithSecrets operation
  • Handles success with dynamic toast messages based on created secrets count
  • Provides comprehensive error handling for both operation success/failure and exceptions
  • Maintains proper form state management for "create more" functionality

189-189: LGTM! Proper loading state integration.

The isPending property from the mutation hook correctly replaces manual loading state management.

orpc/hooks/use-credentials.ts (1)

4-10: Remove unused import.

The ListCardsOutput type is imported but never used in this file.

 import type {
   CreateCredentialInput,
   CredentialOutput,
   DeleteCredentialInput,
   ListCredentialsInput,
   UpdateCredentialInput,
 } from "@/schemas/credential/dto"

Likely an incorrect or invalid review comment.

orpc/routers/card.ts (1)

201-204: Fix incorrect property assignment for container update.

The code incorrectly assigns to updatePayload.container instead of updatePayload.containerId.

 if (updateData.containerId !== undefined)
-  updatePayload.container = updateData.containerId
+  updatePayload.containerId = updateData.containerId
     ? { connect: { id: updateData.containerId } }
     : { disconnect: true }

However, based on Prisma's relation handling, the entire approach should use the relation field:

 if (updateData.containerId !== undefined)
-  updatePayload.container = updateData.containerId
+  updatePayload.container = updateData.containerId
     ? { connect: { id: updateData.containerId } }
     : { disconnect: true }

Likely an incorrect or invalid review comment.

orpc/hooks/use-secrets.ts (1)

1-151: LGTM! Consistent implementation with other resource hooks.

The implementation follows the established patterns for CRUD operations with React Query, including proper cache management and optimistic updates.

schemas/utils/dto.ts (1)

1-119: Well-structured DTO schema organization.

The centralized DTO module provides consistent schema definitions and TypeScript types for containers, platforms, and tags with proper pagination support.

orpc/hooks/use-cards.ts (1)

86-93: Good handling of date conversion in optimistic update.

The special handling of expiryDate conversion from string to Date object ensures type consistency in the cache.

orpc/routers/credential.ts (1)

30-46: Well-structured authentication middleware.

The authentication setup correctly validates session and user presence before allowing access to protected procedures.

orpc/routers/container.ts (1)

108-112: To confirm how tags are scoped when containerId is undefined, let’s inspect the helper’s logic around that parameter:

#!/bin/bash
# Show the full createTagsAndGetConnections implementation
sed -n '1,200p' lib/utils/tag-helpers.ts

This will clarify whether passing undefined intentionally omits the container scope (making them user-scoped) or if it’s an oversight.

coderabbitai bot added a commit that referenced this pull request Jun 20, 2025
Docstrings generation was requested by @FindMalek.

* #6 (comment)

The following files were modified:

* `app/(dashboard)/dashboard/page.tsx`
* `app/(marketing)/page.tsx`
* `app/api/orpc/[[...rest]]/route.ts`
* `components/app/dashboard-add-card-dialog.tsx`
* `components/app/dashboard-add-credential-dialog.tsx`
* `components/app/dashboard-add-secret-dialog.tsx`
* `components/app/dashboard-overview-stats.tsx`
* `components/app/marketing-waitlist-form.tsx`
* `components/layout/layout-wrapper.tsx`
* `lib/utils/encryption-helpers.ts`
* `lib/utils/index.ts`
* `lib/utils/tag-helpers.ts`
* `orpc/client/server.ts`
* `orpc/context.ts`
* `orpc/hooks/use-cards.ts`
* `orpc/hooks/use-containers.ts`
* `orpc/hooks/use-credentials.ts`
* `orpc/hooks/use-platforms.ts`
* `orpc/hooks/use-secrets.ts`
* `orpc/hooks/use-tags.ts`
* `orpc/hooks/use-users.ts`
@coderabbitai
Copy link

coderabbitai bot commented Jun 20, 2025

Note

Generated docstrings for this pull request at #7

@FindMalek FindMalek merged commit f3a1a72 into main Jun 20, 2025
2 of 3 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.

2 participants