Back to all reviewers

Next.js directory structure

prowler-cloud/prowler
Based on 10 comments
TypeScript

Keep the Next.js `/app` directory strictly for routing purposes as per framework conventions. Non-routing related code like tools, utilities, and services should be moved to appropriate directories such as `/lib/`. This improves code organization, maintainability, and follows Next.js best practices.

Code Style TypeScript

Reviewer Prompt

Keep the Next.js /app directory strictly for routing purposes as per framework conventions. Non-routing related code like tools, utilities, and services should be moved to appropriate directories such as /lib/. This improves code organization, maintainability, and follows Next.js best practices.

For example, instead of:

// ui/app/(ai)/analyst/(tools)/checks.ts
import { tool } from "@langchain/core/tools";
import { aiGetProviderChecks } from "@/lib/lighthouse/helperChecks";
import { checkSchema } from "@/types/ai/checks";

export const getProviderChecksTool = tool(
  // tool implementation
);

Use:

// ui/lib/lighthouse/tools/checks.ts
import { tool } from "@langchain/core/tools";
import { aiGetProviderChecks } from "@/lib/lighthouse/helperChecks";
import { checkSchema } from "@/types/ai/checks";

export const getProviderChecksTool = tool(
  // tool implementation
);

This organization makes the codebase more maintainable and follows the intended use of the Next.js app directory structure.

10
Comments Analyzed
TypeScript
Primary Language
Code Style
Category

Source Discussions