Skip to content
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

fix: build errors and project structure #151

Merged

Conversation

evgongora
Copy link
Collaborator

@evgongora evgongora commented Feb 16, 2025

Summary by CodeRabbit

  • New Features
    • Introduced refreshed button styles with vibrant gradients and updated iconography for a modern look.
  • Improvements
    • Enhanced global typography and layout for better readability and scroll behavior across devices.
    • Refined user feedback during loading and interaction on sign-in, registration, and test pages.
  • Chores
    • Streamlined build scripts, CI workflows, and internal file organization to boost overall performance.

Copy link

vercel bot commented Feb 16, 2025

@evgongora is attempting to deploy a commit to the MindVault Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Feb 16, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request introduces multiple organizational and configuration improvements across the project. New environment template files for development and production are added, and CI/CD workflows have been streamlined with simplified commands and pre-commit hooks. Numerous API routes and utility imports have been refactored to use updated module paths. UI components and pages have been reorganized with updated import paths and revised styling defaults. Additionally, configuration files, export indexes, type definitions, and monorepo package management scripts have been enhanced to promote consistency and improved maintainability.

Changes

File(s) Change Summary
.env.example, .env.production, apps/web/.env.example, frontend/.env.example New environment variable templates introduced for development and production, with detailed API, database, security, and feature flag settings; removal of obsolete frontend env template.
.github/workflows/pr-check.yml, .husky/pre-commit CI/CD workflows streamlined: simplified install and linting commands; added a pre-commit hook that checks for unstaged changes, builds types, runs type checking, linting, and builds the application.
.gitignore, biome.json Reorganized ignore patterns and updated formatting/linter configuration rules for enhanced consistency across the project.
apps/web/next.config.js, apps/web/package.json, apps/web/tsconfig.json, root package.json Updated Next.js configuration and project-wide package scripts; dependency updates, refined linting/formatting commands, and new monorepo/workspaces settings introduced.
apps/web/src/app/api/**, apps/web/src/lib/**, apps/web/src/lib/auth/** Refactored import statements across multiple API routes and libraries to utilize @/lib/database/xata and new security modules, standardizing database client and cryptographic functionality.
apps/web/src/app/** (pages like awaken-pro, ideology-test, insights, register, sign-in, test-selection, welcome) and apps/web/src/components/** Component restructuring: updated import paths for buttons, cards, and feedback; changed default button variants from "default" to "primary"; removed redundant classes for a cleaner UI.
apps/web/src/config/**, apps/web/src/hooks/**, apps/web/src/providers/**, apps/web/src/lib/**, apps/web/src/types/** New consolidated exports and configuration modules added for environment validation, routes, utility functions, and enhanced type definitions; improved module re-exporting and routing type safety.
packages/types/** New @mindvault/types package added with comprehensive type definitions and configuration files to aid consistent type-checking across the monorepo.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Git as Git CLI
    participant Hook as Pre-commit Hook
    participant Check as Validation Steps

    Dev->>Git: Execute commit
    Git->>Hook: Run pre-commit hook
    Hook->>Check: Check for unstaged changes
    alt Unstaged changes found
      Check-->>Hook: Exit with error (ask to stage or stash)
    else No unstaged changes
      Hook->>Check: Execute "build:types"
      Check-->>Hook: Return success or error
      Hook->>Check: Run "pnpm type-check"
      Check-->>Hook: Return result
      Hook->>Check: Run lint check ("pnpm pre-commit")
      Check-->>Hook: Return result
      Hook->>Check: Execute "pnpm build"
      Check-->>Hook: Build outcome
      Hook-->>Git: Success message and proceed with commit
    end
Loading

Possibly related PRs

Suggested reviewers

  • bitfalt

Poem

I’m a rabbit with hops so spry,
Code carrots lined up, oh my!
Env files and hooks all aligned,
A streamlined workflow, simply divine!
With changes so neat, let’s give a cheer 🐇✨
Hop on, dear devs, the future is here!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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. (Beta)
  • @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.

Copy link

vercel bot commented Feb 16, 2025

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

Name Status Preview Comments Updated (UTC)
miniapp-monorepo ❌ Failed (Inspect) Feb 16, 2025 11:27pm

Copy link
Contributor

coderabbitai bot commented Feb 16, 2025

@evgongora: I'll review the changes in this PR that addresses build errors and project structure.

(_/)/
(•.•)
/>📝

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@evgongora evgongora requested a review from bitfalt February 16, 2025 23:33
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

🧹 Nitpick comments (25)
apps/web/src/components/ui/cards/SettingsCard.tsx (1)

32-32: LGTM! Consider adding aria-label for better accessibility.

The font simplification aligns with the broader typography changes. However, consider adding an aria-label to improve accessibility, especially since the icon is hidden from screen readers.

-        <span className="text-base font-bold text-white">
+        <span className="text-base font-bold text-white" aria-label={label}>
apps/web/src/components/ui/cards/ProfileCard.tsx (1)

58-58: LGTM! Consider documenting typography guidelines.

The font simplification across text elements maintains a clear visual hierarchy while reducing complexity. Consider documenting these typography choices in a design system guide for consistency.

Would you like me to help create a template for typography documentation in your design system?

Also applies to: 114-114, 117-117, 125-125, 128-128

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

1-6: Add JSDoc documentation to improve maintainability.

The cn utility function is well-implemented, but would benefit from JSDoc documentation explaining its purpose and usage.

Consider adding JSDoc documentation:

+/**
+ * Combines multiple class values into a single className string.
+ * Uses clsx for conditional classes and twMerge for Tailwind class deduplication.
+ * @param inputs - Array of class values (strings, objects, arrays, etc.)
+ * @returns Merged className string
+ */
 export function cn(...inputs: ClassValue[]) {
   return twMerge(clsx(inputs));
 }
apps/web/src/components/ui/buttons/styles/buttonStyles.ts (2)

4-8: Consider using CSS variables for better maintainability.

While the current implementation is functional, using CSS variables would make it easier to maintain and update button sizes consistently across the application.

 export const buttonSizes = {
-  sm: "h-8 px-4 text-sm",
-  md: "h-10 px-6 text-base",
-  lg: "h-12 px-8 text-lg",
+  sm: "h-[var(--btn-h-sm)] px-[var(--btn-px-sm)] text-[var(--btn-text-sm)]",
+  md: "h-[var(--btn-h-md)] px-[var(--btn-px-md)] text-[var(--btn-text-md)]",
+  lg: "h-[var(--btn-h-lg)] px-[var(--btn-px-lg)] text-[var(--btn-text-lg)]",
 };

10-15: Consider using CSS variables for better maintainability.

Similar to buttonSizes, using CSS variables would make it easier to maintain and update button variants consistently.

 export const buttonVariants = {
-  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
-  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90",
-  outline: "border border-input hover:bg-accent hover:text-accent-foreground",
-  ghost: "hover:bg-accent hover:text-accent-foreground",
+  primary: "bg-[var(--btn-bg-primary)] text-[var(--btn-text-primary)] hover:bg-[var(--btn-bg-primary-hover)]",
+  secondary: "bg-[var(--btn-bg-secondary)] text-[var(--btn-text-secondary)] hover:bg-[var(--btn-bg-secondary-hover)]",
+  outline: "border border-[var(--btn-border-outline)] hover:bg-[var(--btn-bg-outline-hover)] hover:text-[var(--btn-text-outline-hover)]",
+  ghost: "hover:bg-[var(--btn-bg-ghost-hover)] hover:text-[var(--btn-text-ghost-hover)]",
 };
apps/web/src/@types/next-auth.d.ts (2)

16-21: Consider creating a shared type for user properties.

The User interface shares properties with the Session's user object. Consider creating a shared type to avoid duplication.

+type UserProperties = {
+  id: string;
+  email: string;
+  name: string;
+  walletAddress?: string;
+};
+
 interface User {
-  id: string;
-  email: string;
-  name: string;
-  walletAddress?: string;
+  UserProperties
 }

25-28: Consider making userId required when customToken is present.

If customToken is present, userId should also be present. Consider using a conditional type to enforce this.

-interface JWT {
-  customToken?: string;
-  userId?: string;
-}
+type JWT = {
+  customToken: string;
+  userId: string;
+} | {
+  customToken?: undefined;
+  userId?: string;
+};
apps/web/src/providers/eruda-provider.tsx (1)

11-23: Add error logging in development mode.

The component silently fails Eruda initialization errors. Consider logging errors in development mode for better debugging.

 function Eruda({ children }: ErudaProps) {
   useEffect(() => {
     if (typeof window !== "undefined" && process.env.NEXT_PUBLIC_ENABLE_DEVTOOLS === "true") {
       try {
         eruda.init();
-      } catch {
+      } catch (error) {
+        if (process.env.NODE_ENV === "development") {
+          console.error("Failed to initialize Eruda:", error);
+        }
         // Silently fail if Eruda initialization fails
       }
     }
   }, []);

   return <>{children}</>;
 }
apps/web/src/components/ui/buttons/styles/outlinedButtonStyles.ts (1)

9-14: Consider using CSS variables for better maintainability.

Similar to buttonVariants, using CSS variables would make it easier to maintain and update outlined button variants consistently.

 export const outlinedButtonVariants: Record<ButtonVariant, string> = {
-  primary: "border-2 border-primary text-primary hover:bg-primary hover:text-primary-foreground",
-  secondary: "border-2 border-secondary text-secondary hover:bg-secondary hover:text-secondary-foreground",
-  outline: "border-2 border-input text-foreground hover:bg-accent hover:text-accent-foreground",
-  ghost: "border-2 border-transparent text-foreground hover:bg-accent hover:text-accent-foreground",
+  primary: "border-2 border-[var(--btn-border-primary)] text-[var(--btn-text-primary)] hover:bg-[var(--btn-bg-primary)] hover:text-[var(--btn-text-primary-hover)]",
+  secondary: "border-2 border-[var(--btn-border-secondary)] text-[var(--btn-text-secondary)] hover:bg-[var(--btn-bg-secondary)] hover:text-[var(--btn-text-secondary-hover)]",
+  outline: "border-2 border-[var(--btn-border-outline)] text-[var(--btn-text-outline)] hover:bg-[var(--btn-bg-outline-hover)] hover:text-[var(--btn-text-outline-hover)]",
+  ghost: "border-2 border-transparent text-[var(--btn-text-ghost)] hover:bg-[var(--btn-bg-ghost-hover)] hover:text-[var(--btn-text-ghost-hover)]",
 };
apps/web/src/components/ui/index.ts (1)

1-26: Consider using named exports consistently for better tree-shaking.

While the organization is clean and logical, using a mix of wildcard exports (export *) and named exports might affect tree-shaking. Consider using named exports consistently throughout the file to enable better dead code elimination.

 // Base components
-export * from './base';
+export { ComponentA, ComponentB, /* ... */ } from './base';

 // Navigation components
-export * from './navigation';
+export { NavBar, Breadcrumb, /* ... */ } from './navigation';

 // ... similar changes for other wildcard exports
.husky/pre-commit (1)

25-27: Consider making the full build optional in pre-commit.

Running a full build in pre-commit might be time-consuming and could discourage frequent small commits. Consider making this step optional or moving it to a pre-push hook instead.

 # Run full build to ensure everything compiles
 echo "🏗️  Running full build..."
-pnpm build || exit 1
+if [ "$SKIP_BUILD" != "true" ]; then
+  pnpm build || exit 1
+fi
apps/web/src/components/ui/navigation/BannerTop.tsx (1)

21-21: Move hardcoded colors to theme configuration.

Consider moving the hardcoded colors to a theme configuration for better maintainability and consistency.

-        className="w-full bg-[#e36c59] hover:bg-[#e36c59]/90 text-sm"
+        className="w-full bg-brand-primary hover:bg-brand-primary/90 text-sm"

Then define these colors in your theme configuration:

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        'brand-primary': '#e36c59',
      },
    },
  },
}
apps/web/src/config/env.ts (1)

13-25: Enhance environment variable validation with format checks.

Consider adding format validation for environment variables to catch configuration issues early.

 export function validateEnv(): void {
   const requiredEnvVars = [
     'NEXT_PUBLIC_API_URL',
     'NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID',
     'NEXT_PUBLIC_XATA_API_KEY',
   ] as const

+  const validators = {
+    NEXT_PUBLIC_API_URL: (value: string) => {
+      try {
+        new URL(value)
+        return true
+      } catch {
+        return false
+      }
+    },
+    // Add more validators as needed
+  }

   for (const envVar of requiredEnvVars) {
     if (!env[envVar]) {
       throw new Error(`Missing required environment variable: ${envVar}`)
     }
+    if (validators[envVar] && !validators[envVar](env[envVar])) {
+      throw new Error(`Invalid format for environment variable: ${envVar}`)
+    }
   }
 }
apps/web/src/types/routes.ts (2)

1-17: Consider grouping static routes by feature.

The static routes could be better organized by grouping them into categories (e.g., auth, tests, user) using TypeScript unions of feature-specific route types.

Example refactor:

-// Static routes
-export type StaticRoutes =
-  | "/"
-  | "/sign-in"
-  | "/register"
-  | "/welcome"
-  | "/settings"
-  | "/achievements"
-  | "/test-selection"
-  | "/tests/instructions"
-  | "/ideology-test"
-  | "/insights"
-  | "/results"
-  | "/awaken-pro"
-  | "/leaderboard"
-  | "/api-docs";
+// Static routes grouped by feature
+export type AuthRoutes = "/sign-in" | "/register" | "/welcome";
+export type TestRoutes = 
+  | "/test-selection"
+  | "/tests/instructions"
+  | "/ideology-test"
+  | "/insights"
+  | "/results";
+export type UserRoutes = 
+  | "/settings"
+  | "/achievements"
+  | "/leaderboard";
+export type MiscRoutes = "/" | "/awaken-pro" | "/api-docs";
+
+export type StaticRoutes = AuthRoutes | TestRoutes | UserRoutes | MiscRoutes;

18-25: Consider using template literal types for query parameters.

The dynamic routes could be more type-safe by using template literal types with specific parameter types.

Example refactor:

-export type DynamicRoutes = 
-  | `/register?userId=${string}`
-  | `/settings?upgrade=${string}`
-  | `/insights?testId=${string}`
-  | `/tests/instructions?testId=${string}`
-  | `/ideology-test?testId=${string}`;
+type UserId = string & { readonly __brand: unique symbol };
+type TestId = string & { readonly __brand: unique symbol };
+type UpgradeType = "pro" | "premium";
+
+export type DynamicRoutes = 
+  | `/register?userId=${UserId}`
+  | `/settings?upgrade=${UpgradeType}`
+  | `/insights?testId=${TestId}`
+  | `/tests/instructions?testId=${TestId}`
+  | `/ideology-test?testId=${TestId}`;
packages/types/src/index.ts (2)

52-59: Consider using enum for test types.

The test type could be more maintainable using an enum instead of string literals.

Example refactor:

+export enum TestType {
+  Ideology = 'ideology',
+  Personality = 'personality',
+  Intelligence = 'intelligence'
+}
+
 export interface TestResult {
   id: string
   userId: string
   score: number
   completedAt: Date
-  type: 'ideology' | 'personality' | 'intelligence'
+  type: TestType
 }

61-78: Consider using template literals for API endpoints.

The API endpoints could be more type-safe by using template literals to enforce URL structure.

Example refactor:

+type ApiVersion = 'v1' | 'v2';
+type BaseUrl = `/api/${ApiVersion}`;
+
 export interface ApiEndpoints {
   auth: {
-    login: string
-    register: string
-    verify: string
+    login: `${BaseUrl}/auth/login`
+    register: `${BaseUrl}/auth/register`
+    verify: `${BaseUrl}/auth/verify`
   }
   user: {
-    profile: string
-    update: string
+    profile: `${BaseUrl}/user/profile`
+    update: `${BaseUrl}/user/update`
   }
   tests: {
-    list: string
-    start: string
-    submit: string
-    results: string
+    list: `${BaseUrl}/tests`
+    start: `${BaseUrl}/tests/start`
+    submit: `${BaseUrl}/tests/submit`
+    results: `${BaseUrl}/tests/results`
   }
 }
apps/web/src/config/routes.ts (1)

26-31: Consider adding JSDoc comments for better documentation.

Adding JSDoc comments would improve code documentation and provide better IDE support.

Example:

+/**
+ * Returns the home route path
+ * @returns {string} The home route path
+ */
 export const getHomeRoute = () => routes.home
apps/web/src/components/ui/cards/QuizCard.tsx (1)

43-43: Consider using design tokens for colors.

Hardcoded color values make it difficult to maintain consistent theming. Consider using design tokens or CSS variables.

-className="h-10 w-full transform text-sm transition-all duration-300 cursor-not-allowed opacity-80 bg-gradient-to-r from-accent-red to-[#FF8066]"
+className="h-10 w-full transform text-sm transition-all duration-300 cursor-not-allowed opacity-80 bg-gradient-to-r from-accent-red to-accent-red-light"
apps/web/src/services/api/base.ts (1)

23-64: Consider enhancing error handling and response type checking.

While the implementation is solid, there are a few potential improvements:

  1. The response type checking could be more robust
  2. Network timeouts aren't explicitly handled
  3. Non-JSON responses aren't gracefully handled

Consider applying these improvements:

 export async function apiRequest<T>(
   endpoint: string,
   options: RequestInit = {}
 ): Promise<ApiResponse<T>> {
   const url = `${env.NEXT_PUBLIC_API_URL}${endpoint}`
   const headers = {
     ...defaultHeaders,
     ...options.headers,
   }

   try {
-    const response = await fetch(url, {
+    const response = await fetch(url, {
+      timeout: 10000, // 10 second timeout
       ...options,
       headers,
     })

-    const data = await response.json()
+    const contentType = response.headers.get('content-type')
+    const data = contentType?.includes('application/json') 
+      ? await response.json()
+      : await response.text()

     if (!response.ok) {
       throw new ApiError(
-        data.message || 'An error occurred',
+        typeof data === 'object' ? data.message || 'An error occurred' : 'An error occurred',
         response.status,
         data
       )
     }

+    // Type guard to ensure response matches expected structure
+    if (typeof data !== 'object' || data === null) {
+      throw new ApiError('Invalid response format', 500, data)
+    }

     return {
       data: data as T,
       status: response.status,
     }
   } catch (error) {
     if (error instanceof ApiError) {
       throw error
     }

+    if (error instanceof TypeError && error.message === 'Failed to fetch') {
+      throw new ApiError('Network error: Unable to reach the server', 503)
+    }

     throw new ApiError(
       'Network error',
       500,
       error instanceof Error ? error.message : 'Unknown error'
     )
   }
 }
apps/web/src/components/ui/overlays/VerifyModal.tsx (1)

22-23: Consider using event.preventDefault() for modal interactions.

The event handlers now directly call onClose without preventing default behavior, which might lead to unexpected interactions with parent elements.

-        onInteractOutside={() => onClose()}
-        onEscapeKeyDown={() => onClose()}
+        onInteractOutside={(e) => {
+          e.preventDefault()
+          onClose()
+        }}
+        onEscapeKeyDown={(e) => {
+          e.preventDefault()
+          onClose()
+        }}
apps/web/src/app/welcome/page.tsx (1)

33-38: Consider removing debug log in production.

The debug log should be removed or wrapped in a development-only condition.

-          console.log("User data:", userData); // Debug log
+          if (process.env.NODE_ENV === 'development') {
+            console.log("User data:", userData);
+          }
.github/workflows/pr-check.yml (3)

84-84: Remove Trailing Spaces.
Trailing whitespace detected on this line can be removed to maintain clean YAML formatting and prevent potential parsing issues.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 84-84: trailing spaces

(trailing-spaces)


111-111: Remove Trailing Spaces.
Trailing whitespace detected in the bundle analysis job; please remove these extra spaces to keep the file clean.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 111-111: trailing spaces

(trailing-spaces)


121-121: Remove Trailing Spaces.
Trailing whitespace detected on this line. Removing these ensures consistency and prevents subtle formatting issues.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 121-121: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4d89e8e and 3ae8986.

⛔ Files ignored due to path filters (12)
  • apps/web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • apps/web/public/MindVaultLogoTransparentHD.svg is excluded by !**/*.svg
  • apps/web/public/authority-icon.svg is excluded by !**/*.svg
  • apps/web/public/equality-icon.svg is excluded by !**/*.svg
  • apps/web/public/globe-icon.svg is excluded by !**/*.svg
  • apps/web/public/liberty-icon.svg is excluded by !**/*.svg
  • apps/web/public/market-icon.svg is excluded by !**/*.svg
  • apps/web/public/mindvault-logo.png is excluded by !**/*.png
  • apps/web/public/nation-icon.svg is excluded by !**/*.svg
  • apps/web/public/progress-icon.svg is excluded by !**/*.svg
  • apps/web/public/tradition-icon.svg is excluded by !**/*.svg
  • packages/types/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (101)
  • .env.example (1 hunks)
  • .env.production (1 hunks)
  • .github/workflows/pr-check.yml (3 hunks)
  • .gitignore (1 hunks)
  • .husky/pre-commit (1 hunks)
  • apps/web/.env.example (1 hunks)
  • apps/web/next.config.js (1 hunks)
  • apps/web/package.json (2 hunks)
  • apps/web/src/@types/next-auth.d.ts (1 hunks)
  • apps/web/src/app/(home)/page.tsx (1 hunks)
  • apps/web/src/app/achievements/page.tsx (1 hunks)
  • apps/web/src/app/api-docs/page.tsx (1 hunks)
  • apps/web/src/app/api/auth/[...nextauth]/route.ts (1 hunks)
  • apps/web/src/app/api/auth/session/route.ts (1 hunks)
  • apps/web/src/app/api/confirm-payment/route.ts (1 hunks)
  • apps/web/src/app/api/docs/route.ts (1 hunks)
  • apps/web/src/app/api/fetch-pay-amount/route.ts (1 hunks)
  • apps/web/src/app/api/home/route.ts (1 hunks)
  • apps/web/src/app/api/ideology/route.ts (1 hunks)
  • apps/web/src/app/api/initiate-payment/route.ts (1 hunks)
  • apps/web/src/app/api/insights/[testId]/route.ts (1 hunks)
  • apps/web/src/app/api/insights/route.ts (1 hunks)
  • apps/web/src/app/api/public-figures/route.ts (1 hunks)
  • apps/web/src/app/api/tests/[testId]/instructions/route.ts (1 hunks)
  • apps/web/src/app/api/tests/[testId]/progress/route.ts (1 hunks)
  • apps/web/src/app/api/tests/[testId]/questions/route.ts (1 hunks)
  • apps/web/src/app/api/tests/[testId]/results/route.ts (1 hunks)
  • apps/web/src/app/api/tests/route.ts (1 hunks)
  • apps/web/src/app/api/user/check/route.ts (1 hunks)
  • apps/web/src/app/api/user/me/route.ts (1 hunks)
  • apps/web/src/app/api/user/route.ts (1 hunks)
  • apps/web/src/app/api/user/subscription/route.ts (1 hunks)
  • apps/web/src/app/api/verify/route.ts (1 hunks)
  • apps/web/src/app/awaken-pro/page.tsx (4 hunks)
  • apps/web/src/app/globals.css (1 hunks)
  • apps/web/src/app/ideology-test/page.tsx (6 hunks)
  • apps/web/src/app/insights/page.tsx (6 hunks)
  • apps/web/src/app/layout.tsx (2 hunks)
  • apps/web/src/app/leaderboard/page.tsx (1 hunks)
  • apps/web/src/app/register/page.tsx (3 hunks)
  • apps/web/src/app/results/page.tsx (2 hunks)
  • apps/web/src/app/settings/page.tsx (6 hunks)
  • apps/web/src/app/sign-in/page.tsx (2 hunks)
  • apps/web/src/app/test-selection/page.tsx (1 hunks)
  • apps/web/src/app/tests/instructions/page.tsx (3 hunks)
  • apps/web/src/app/welcome/page.tsx (4 hunks)
  • apps/web/src/components/common/index.ts (1 hunks)
  • apps/web/src/components/features/Canvas.tsx (1 hunks)
  • apps/web/src/components/features/index.ts (1 hunks)
  • apps/web/src/components/index.ts (1 hunks)
  • apps/web/src/components/layout/LayoutContent.tsx (1 hunks)
  • apps/web/src/components/layout/index.ts (1 hunks)
  • apps/web/src/components/ui/base/index.ts (1 hunks)
  • apps/web/src/components/ui/buttons/FilledButton.tsx (1 hunks)
  • apps/web/src/components/ui/buttons/OutlinedButton.tsx (1 hunks)
  • apps/web/src/components/ui/buttons/WorldIDButton.tsx (1 hunks)
  • apps/web/src/components/ui/buttons/index.ts (1 hunks)
  • apps/web/src/components/ui/buttons/styles/buttonStyles.ts (1 hunks)
  • apps/web/src/components/ui/buttons/styles/outlinedButtonStyles.ts (1 hunks)
  • apps/web/src/components/ui/cards/MembershipCard.tsx (1 hunks)
  • apps/web/src/components/ui/cards/ProfileCard.tsx (3 hunks)
  • apps/web/src/components/ui/cards/QuizCard.tsx (2 hunks)
  • apps/web/src/components/ui/cards/ResultCard.tsx (1 hunks)
  • apps/web/src/components/ui/cards/SettingsCard.tsx (1 hunks)
  • apps/web/src/components/ui/cards/index.ts (1 hunks)
  • apps/web/src/components/ui/feedback/index.ts (1 hunks)
  • apps/web/src/components/ui/index.ts (1 hunks)
  • apps/web/src/components/ui/navigation/BannerTop.tsx (2 hunks)
  • apps/web/src/components/ui/navigation/index.ts (1 hunks)
  • apps/web/src/components/ui/overlays/VerifyModal.tsx (4 hunks)
  • apps/web/src/config/env.ts (1 hunks)
  • apps/web/src/config/index.ts (1 hunks)
  • apps/web/src/config/routes.ts (1 hunks)
  • apps/web/src/constants/index.ts (1 hunks)
  • apps/web/src/data/index.ts (1 hunks)
  • apps/web/src/hooks/index.ts (1 hunks)
  • apps/web/src/lib/api/index.ts (1 hunks)
  • apps/web/src/lib/auth/auth.ts (1 hunks)
  • apps/web/src/lib/auth/index.ts (1 hunks)
  • apps/web/src/lib/database/index.ts (1 hunks)
  • apps/web/src/lib/database/xata.ts (1 hunks)
  • apps/web/src/lib/index.ts (1 hunks)
  • apps/web/src/lib/security/index.ts (1 hunks)
  • apps/web/src/lib/utils/index.ts (1 hunks)
  • apps/web/src/lib/utils/utils.ts (1 hunks)
  • apps/web/src/providers/eruda-provider.tsx (2 hunks)
  • apps/web/src/providers/index.ts (1 hunks)
  • apps/web/src/services/api/auth.ts (1 hunks)
  • apps/web/src/services/api/base.ts (1 hunks)
  • apps/web/src/types/routes.ts (1 hunks)
  • apps/web/tsconfig.json (1 hunks)
  • biome.json (4 hunks)
  • frontend/.env.example (0 hunks)
  • frontend/src/lib/utils.ts (0 hunks)
  • frontend/src/providers/index.tsx (0 hunks)
  • frontend/tsconfig.json (0 hunks)
  • package.json (1 hunks)
  • packages/types/package.json (1 hunks)
  • packages/types/src/index.ts (1 hunks)
  • packages/types/tsconfig.json (1 hunks)
  • packages/types/tsup.config.ts (1 hunks)
💤 Files with no reviewable changes (4)
  • frontend/src/lib/utils.ts
  • frontend/tsconfig.json
  • frontend/.env.example
  • frontend/src/providers/index.tsx
✅ Files skipped from review due to trivial changes (51)
  • apps/web/src/components/layout/index.ts
  • apps/web/src/lib/api/index.ts
  • apps/web/src/components/ui/feedback/index.ts
  • apps/web/src/app/api/fetch-pay-amount/route.ts
  • apps/web/src/data/index.ts
  • apps/web/src/lib/security/index.ts
  • apps/web/src/components/ui/cards/ResultCard.tsx
  • apps/web/src/app/api/ideology/route.ts
  • apps/web/src/app/api/public-figures/route.ts
  • apps/web/src/app/test-selection/page.tsx
  • apps/web/src/app/api/confirm-payment/route.ts
  • apps/web/src/lib/database/index.ts
  • apps/web/src/components/ui/buttons/index.ts
  • apps/web/src/app/api/initiate-payment/route.ts
  • apps/web/src/app/api-docs/page.tsx
  • apps/web/src/app/api/tests/[testId]/questions/route.ts
  • apps/web/src/components/ui/buttons/WorldIDButton.tsx
  • apps/web/src/hooks/index.ts
  • apps/web/src/lib/auth/index.ts
  • apps/web/src/app/api/auth/session/route.ts
  • apps/web/src/app/api/home/route.ts
  • apps/web/src/app/api/user/subscription/route.ts
  • apps/web/src/components/ui/cards/MembershipCard.tsx
  • apps/web/src/app/api/docs/route.ts
  • apps/web/src/app/api/tests/[testId]/results/route.ts
  • apps/web/src/app/api/auth/[...nextauth]/route.ts
  • apps/web/src/app/api/insights/route.ts
  • apps/web/src/providers/index.ts
  • apps/web/src/app/api/tests/route.ts
  • apps/web/src/app/achievements/page.tsx
  • apps/web/src/components/index.ts
  • apps/web/src/app/api/user/check/route.ts
  • apps/web/src/components/features/Canvas.tsx
  • apps/web/src/app/api/user/route.ts
  • apps/web/src/config/index.ts
  • apps/web/src/lib/index.ts
  • apps/web/src/app/api/user/me/route.ts
  • apps/web/src/app/api/tests/[testId]/instructions/route.ts
  • apps/web/src/app/api/insights/[testId]/route.ts
  • apps/web/src/lib/utils/index.ts
  • apps/web/src/components/layout/LayoutContent.tsx
  • apps/web/src/app/api/verify/route.ts
  • apps/web/src/app/api/tests/[testId]/progress/route.ts
  • apps/web/src/app/leaderboard/page.tsx
  • apps/web/src/lib/auth/auth.ts
  • apps/web/src/components/ui/cards/index.ts
  • apps/web/src/app/(home)/page.tsx
  • apps/web/.env.example
  • apps/web/src/constants/index.ts
  • apps/web/src/components/ui/navigation/index.ts
  • apps/web/src/components/ui/base/index.ts
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/pr-check.yml

[error] 84-84: trailing spaces

(trailing-spaces)


[error] 111-111: trailing spaces

(trailing-spaces)


[error] 121-121: trailing spaces

(trailing-spaces)

🔇 Additional comments (113)
apps/web/src/app/layout.tsx (2)

8-8: LGTM! Improved component organization.

Moving LayoutContent to a dedicated 'layout' directory enhances code organization and makes the component's purpose more explicit.


22-22: LGTM! Simplified dynamic import.

The removal of the unnecessary wrapper component reduces complexity while maintaining the same functionality. This is a good application of the KISS principle.

apps/web/src/components/ui/cards/ProfileCard.tsx (1)

6-6: LGTM! Import path change aligns with project structure.

The updated import path follows the new component organization pattern, improving maintainability.

apps/web/src/app/results/page.tsx (2)

3-4: LGTM! Improved component organization.

The updated import paths reflect a better organization of UI components by their type/purpose, which improves code maintainability.


101-101:

❓ Verification inconclusive

Verify font styling changes.

The font-spaceGrotesk class has been removed from text elements. Please confirm if this is intentional and aligns with the project's typography guidelines.

Also applies to: 106-106


🏁 Script executed:

#!/bin/bash
# Search for other occurrences of font-spaceGrotesk to check consistency
rg "font-spaceGrotesk" --type tsx

# Check if there's a global font configuration
fd -e tsx -e ts -e css "font" | xargs rg "spaceGrotesk|nextFont|font-family"

Length of output: 1324


Verify font styling consistency.

The font-spaceGrotesk class was removed from the text elements in the results page. However, our search shows that the class is still actively used in several other components (e.g., in VerifyModal, QuizCard, AchievementButton, and settings pages) and is also referenced in the global configuration (see apps/web/src/app/layout.tsx and apps/web/src/app/globals.css). Please confirm whether the removal on the results page is an intentional shift to rely solely on the global font settings provided by next/font and the global CSS, or if it may lead to inconsistent typography across the project. Consider aligning the usage across all pages if a consistent font style is intended.

apps/web/src/components/common/index.ts (1)

1-1: LGTM! Clean barrel file export.

The export statement follows the barrel file pattern, which improves module organization and import readability.

apps/web/src/components/features/index.ts (1)

1-1: LGTM! Consistent export pattern.

The export statement maintains consistency with other barrel files, contributing to a well-organized project structure.

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

1-8:

✅ Verification successful

LGTM! Comprehensive tsup configuration.

The configuration is well-structured with essential options for TypeScript bundling. Supporting both ESM and CJS formats ensures broad compatibility.

Let's verify the tsup configuration is valid and up-to-date:


🌐 Web query:

What is the latest version of tsup and its recommended configuration options?

💡 Result:

The latest version of tsup is 8.3.6 (published January 25, 2025)[10]. Here are the recommended configuration options based on current best practices:

Core Configuration Options

// tsup.config.ts
import { defineConfig } from 'tsup'

export default defineConfig({
  entry: ['src/index.ts'],      // Entry file(s)[1][3][7]
  format: ['esm', 'cjs'],       // Dual module output[7][4]
  dts: true,                    // Generate type definitions[3][7]
  clean: true,                  // Clear dist directory before build[1][3]
  sourcemap: true,              // Generate source maps[1][3]
  target: 'esnext',             // Modern ECMAScript target[8]
  minify: true,                 // Minify output[1][7]
  external: ['react'],           // Exclude peer dependencies[2][7]
})

Key Recommended Options

Option Purpose Recommendation
entry Entry points Array of files (e.g., ['src/index.ts'])[1][3]
format Output formats Both esm and cjs for universal support[7][4]
dts Type definitions true for library consumers[3][7]
sourcemap Debugging Enable for development builds[1][3]
target JS compatibility esnext for modern environments[8]

Additional Best Practices

  1. Tree-shaking: Add "sideEffects": false to package.json[4]
  2. CLI usage: For monorepos, use shared config files via --config flag[9]
  3. Type safety: Prefer TypeScript config (tsup.config.ts) over JSON[3][7]
  4. Debugging: Keep sourcemaps enabled but exclude from production bundles[1]

For dual ESM/CJS publishing (recommended for libraries), ensure package.json contains:

{
  "exports": {
    ".": {
      "import": "./dist/index.js",
      "require": "./dist/index.cjs"
    }
  }
}
```[7][4]

The configuration above balances modern features with backward compatibility while maintaining optimal bundle size through minification and tree-shaking[4][7]. For framework-specific setups (e.g., React + Tailwind), additional loader configurations might be required[3].

Citations:

- 1: https://builtin.com/articles/tsup
- 2: https://www.jsdocs.io/package/tsup
- 3: https://www.skovy.dev/blog/build-component-libraries-with-tsup-tailwind
- 4: https://dev.to/orabazu/how-to-bundle-a-tree-shakable-typescript-library-with-tsup-and-publish-with-npm-3c46
- 5: https://plainenglish.io/blog/how-do-you-clean-the-subjects-in-rxjs
- 6: https://www.npmjs.com/package/tsup
- 7: https://johnnyreilly.com/dual-publishing-esm-cjs-modules-with-tsup-and-are-the-types-wrong
- 8: https://tsup.egoist.dev
- 9: https://github.com/egoist/tsup/issues/756
- 10: https://security.snyk.io/package/npm/tsup

---



</details>

**TSUP Configuration Approved with Optional Enhancements**

The configuration effectively addresses the build error fixes and includes essential options (entry, type declarations, and dual ESM/CJS outputs). It works as intended. As per the latest best practices for tsup v8.3.6, you might consider adding a few optional enhancements if they fit your project’s needs:

- **Sourcemaps:** Add `sourcemap: true` to improve debugging.
- **Target:** Consider setting `target: 'esnext'` to leverage modern ECMAScript features.
- **Minification:** Use `minify: true` to potentially reduce bundle size.
- **External Dependencies:** Optionally configure `external` (e.g., `external: ['react']`) if you’d like to exclude peer dependencies.

These suggestions are optional; the current configuration is valid and aligns with the PR’s objectives.

</details>
<details>
<summary>apps/web/src/components/ui/buttons/styles/buttonStyles.ts (1)</summary>

`1-2`: **LGTM! Well-defined type definitions.**

The type definitions use TypeScript's union types appropriately and follow semantic naming conventions.

</details>
<details>
<summary>apps/web/src/@types/next-auth.d.ts (1)</summary>

`6-14`: **LGTM! Well-structured Session interface.**

The Session interface correctly extends DefaultSession['user'] and includes all necessary properties.

</details>
<details>
<summary>apps/web/src/providers/eruda-provider.tsx (1)</summary>

`25-28`: **LGTM! Well-structured exports.**

The default export and type export are correctly defined, with a helpful comment explaining the purpose.

</details>
<details>
<summary>apps/web/src/components/ui/buttons/FilledButton.tsx (1)</summary>

`25-25`: <details>
<summary>✅ Verification successful</summary>

**LGTM! Standardizing the default variant.**

The change from `"default"` to `"primary"` as the default variant aligns with the component's usage across the application.


Let's verify the impact of this change:

---

🏁 Script executed:

```shell
#!/bin/bash
# Search for FilledButton usage without explicit variant prop
rg -A 2 '<FilledButton' apps/web/src

Length of output: 5000


LGTM! Default variant standardization verified.

The change from "default" to "primary" as the default variant in apps/web/src/components/ui/buttons/FilledButton.tsx has been verified against the codebase. A repository-wide search confirms that nearly all explicit usages of the component already set the variant to "primary", while instances without an explicit variant now correctly default to "primary". This update aligns with our standardization efforts across the application.

  • Verified Locations:
    apps/web/src/app/awaken-pro/page.tsx
    apps/web/src/app/insights/page.tsx
    apps/web/src/app/ideology-test/page.tsx
    apps/web/src/app/register/page.tsx (defaults now behave as intended)
    • Others consistently using "primary" or intentionally setting a different variant
apps/web/src/components/ui/buttons/OutlinedButton.tsx (1)

25-25: LGTM! Maintaining consistency with FilledButton.

The change to use "primary" as the default variant maintains consistency with the FilledButton component.

apps/web/src/config/routes.ts (1)

1-24: LGTM! Well-structured route definitions.

The routes are logically organized into groups with consistent naming patterns. The use of as const ensures type safety.

apps/web/src/services/api/auth.ts (1)

25-65: Consider adding error handling.

The service methods should include error handling to manage API failures gracefully.

Example implementation:

 login: async (credentials: LoginCredentials) => {
+  try {
     const response = await api.post<AuthResponse>(
       authRoutes.signIn(),
       credentials
     )
     return response.data
+  } catch (error) {
+    // Handle specific error cases
+    throw error
+  }
 },
apps/web/next.config.js (3)

20-26: Review the permissive image hostname configuration.

The current configuration allows images from any hostname (**), which might be too permissive from a security standpoint. Consider restricting to specific domains.

 remotePatterns: [
   {
     protocol: 'https',
-    hostname: '**'
+    hostname: 'your-trusted-domain.com'
   }
 ]

34-68: LGTM! Comprehensive security headers.

The security headers configuration is thorough and follows best practices.


3-8:

❓ Verification inconclusive

Verify the impact of experimental features.

The enabled experimental features (typedRoutes and serverActions) might have stability implications.


🌐 Web query:

What is the stability status of Next.js experimental features typedRoutes and serverActions?

💡 Result:

Next.js' serverActions and typedRoutes features have different stability statuses as of February 2025:

Server Actions (Stable)

  • Became stable in Next.js 14 (October 2023)[3][5]
  • Enabled by default without configuration[5]
  • Includes security protections like origin validation and CSRF prevention[2][5]
  • Supports advanced features like revalidation, redirects, and optimistic UI updates[3]

Typed Routes (Experimental)

  • Remains experimental despite being introduced in earlier versions[1][4][7]
  • Requires manual activation via experimental.typedRoutes in next.config.js[1][7]
  • Known limitations:
    • Incomplete dynamic route type generation in some scenarios[10]
    • Compatibility issues with TurboPack and parallel routes[10]
    • No official timeline for stabilization[9][10]

Developers report server actions work reliably in production[3][8], while typed routes still require workarounds like third-party libraries (e.g., nextjs-routes) for full type safety[1][4]. The Next.js team continues enhancing typed routes with recent Turbopack compatibility improvements mentioned in GitHub discussions[10].

Citations:


Review Comment Update: Verify Stability of Experimental Features

  • The configuration snippet in apps/web/next.config.js (lines 3–8) currently enables two experimental features.
    • serverActions: Now stable as of Next.js 14 (October 2023). It is production-ready with built-in security measures.
    • typedRoutes: Remains experimental. Known limitations include incomplete dynamic route type generation and potential compatibility issues with TurboPack. No official timeline for stabilization has been announced.

Please verify that the use of typedRoutes fits your production requirements and consider additional testing or fallback strategies if needed.

apps/web/src/components/ui/cards/QuizCard.tsx (1)

33-37: LGTM! Good accessibility implementation.

Proper use of aria-hidden attribute for decorative icons.

apps/web/src/services/api/base.ts (2)

3-17: LGTM! Well-structured error handling and response types.

The ApiError class and ApiResponse interface provide a robust foundation for standardized API interactions.


66-86: LGTM! Well-implemented HTTP method wrappers.

The API method wrappers provide a clean interface for making HTTP requests with proper typing and consistent error handling.

apps/web/src/components/ui/overlays/VerifyModal.tsx (2)

3-4: LGTM! Import paths have been reorganized.

The imports have been properly reorganized to reflect the new component structure.


52-53: LGTM! Button variants updated for consistency.

The button variants have been updated to "primary" for consistency with the application's design system.

Also applies to: 61-62

apps/web/src/app/welcome/page.tsx (2)

9-10: LGTM! Import paths have been reorganized.

The imports have been properly reorganized to reflect the new component structure.


15-16: LGTM! Loading state implementation improves user experience.

The addition of loading state and spinner provides better feedback during data fetching.

Also applies to: 86-92

apps/web/src/app/tests/instructions/page.tsx (2)

3-5: LGTM! Import paths have been reorganized.

The imports have been properly reorganized to reflect the new component structure.


79-82: LGTM! Button variants and styling updated for consistency.

The button variants and styling have been updated to maintain visual consistency across the application.

Also applies to: 158-160

apps/web/src/app/settings/page.tsx (6)

3-11: LGTM! Improved component organization.

The import paths have been updated to reflect a more organized directory structure, categorizing components into logical groups (buttons, feedback, cards).


53-53: LGTM! Added loading state for better UX.

The loading state variable improves user feedback during the logout process.


107-121: LGTM! Proper loading state management.

The loading state is correctly managed during the logout process, with proper error handling.


187-188: LGTM! Consistent button styling.

The button variant has been updated to maintain consistency with the application's design system.


258-261: LGTM! Enhanced button visibility.

The logout button styling has been updated with explicit background color for better visibility.


262-265: LGTM! Clear loading feedback.

The button provides clear visual feedback during the loading state through both text and disabled state.

apps/web/src/app/awaken-pro/page.tsx (3)

3-3: LGTM! Consistent import path.

The import path has been updated to match the new directory structure.


224-239: LGTM! Enhanced button styling.

The button styling has been updated to maintain consistency with the application's design system, with explicit height and text color settings.


251-252: LGTM! Improved icon visibility.

The icon color has been explicitly set to white for better visibility.

apps/web/src/app/register/page.tsx (3)

3-5: LGTM! Improved component organization.

The import paths have been updated to reflect the new directory structure, organizing components into logical categories.


331-331: LGTM! Consistent button styling.

The button styling has been updated with a gradient background that matches the application's design system.


335-335: LGTM! Improved loading spinner spacing.

The loading spinner's margin has been adjusted for better spacing with the text.

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

3-3: LGTM! Consistent import path.

The import path has been updated to match the new directory structure.


322-325: LGTM! Enhanced button styling.

The button styling has been updated with consistent variant, size, and background color properties.

apps/web/src/app/ideology-test/page.tsx (2)

4-5: LGTM! Import paths have been updated to reflect the new component organization.

The components have been logically grouped into their respective directories:

  • UI components under @/components/ui/buttons and @/components/ui/feedback

334-341: Consistent button styling applied across navigation controls.

The FilledButton components have been updated to use:

  • variant="primary" for consistent styling
  • Custom background colors with hover states
  • Proper disabled state handling for the Previous button

Also applies to: 395-406, 424-431

apps/web/src/app/insights/page.tsx (2)

3-6: LGTM! Import paths have been updated to reflect the new component organization.

Components have been logically grouped into their respective directories:

  • Canvas component moved to @/components/features
  • UI components organized under buttons, cards, and feedback directories

273-284: Consistent button styling applied across action buttons.

The FilledButton components have been updated to use:

  • variant="primary" for consistent styling
  • Gradient backgrounds and hover effects
  • Proper transition animations

Also applies to: 507-514, 521-544

apps/web/src/lib/database/xata.ts (2)

1991-1995: LGTM! Database configuration now uses environment variables.

Configuration has been improved to:

  • Use XATA_DATABASE_URL instead of hardcoded URL
  • Add XATA_API_KEY for authentication
  • Set default branch to 'main' if not specified

1998-2003: Improved error handling for missing environment variables.

The constructor now validates required environment variables before initialization.

packages/types/tsconfig.json (1)

1-19: LGTM! Well-configured TypeScript settings for type declarations package.

The configuration includes:

  • Strict type checking enabled
  • Declaration files and source maps generation
  • Proper module resolution and interop settings
  • Clear input/output directory structure
.gitignore (9)

1-3: Reorganized Dependencies Section

The updated Dependencies section clearly lists both node_modules and the new .pnpm-store/ entry, which will help manage pnpm caches effectively.


5-9: Streamlined Build Artifacts Ignoring

The Build section now targets common build directories (.next, dist, build, out). Ensure that these paths accurately reflect the output directories used in your build process.


11-13: Coverage Directory Exclusion

The Testing section now ignores the coverage folder, keeping test artifacts out of version control.


14-18: Updated Debug Log Entries

Including pnpm-debug.log* alongside other debug logs (npm/yarn) improves consistency in ignoring log files.


20-26: Local Environment Files Management

The addition of various .env files (including .env.local, .env.development.local, .env.test.local, and .env.production.local) helps developers manage different configurations while keeping sensitive data out of VCS.


27-28: Turbo Directory Exclusion

Ignoring the .turbo directory is a good step to prevent build cache files from leaking into the repository.


29-37: IDE and Editor Files Configuration

The expanded list for IDEs and editors now accommodates .idea, all files under .vscode (with specific exceptions), and common temporary file formats. This ensures a cleaner repository across different development environments.


39-41: OS-Specific Files Ignored

Files like .DS_Store and Thumbs.db are now explicitly ignored, which is standard practice across multi-platform projects.


43-46: Miscellaneous Files Exclusion

The update ensures that sensitive files (like those with .pem extension) and build metadata (*.tsbuildinfo) are not tracked.

packages/types/package.json (1)

1-31: New Package Configuration for @mindvault/types

This new package.json effectively sets up a private package for shared types. The configuration—with clear definitions for main, module, and types—along with scripts for build, linting, and formatting, promotes a consistent development experience. Be sure to update the package version as the API stabilizes.

.env.production (11)

1-3: Production Deployment Settings

The configuration correctly sets the deployment mode with NODE_ENV=production. This is crucial for activating production-specific behaviors throughout the app.


4-7: Production Build Configuration

Disabling telemetry (NEXT_TELEMETRY_DISABLED=1) and analysis (ANALYZE=false) for production is appropriate to improve performance and security.


8-11: Production API and Environment Settings

The production API URL and environment designation are now clearly defined. Verify that https://api.mindvault.yourdomain.com is the intended endpoint for your production environment.


12-15: Database Configuration

The Xata database keys are provided as placeholders. Ensure that these are replaced with secure, production-ready credentials during deployment.


16-18: Web3 Configuration

The wallet connect project ID is now set for production. Please confirm that your-production-project-id is replaced with the actual project identifier to avoid misconfigurations.


19-23: Authentication Settings

While NEXTAUTH_URL is correctly set to your production URL, note that NEXTAUTH_URL_INTERNAL remains http://localhost:3000. Double-check if this internal endpoint is intentional or should mirror the public URL.


24-27: Security Credentials

Both JWT_SECRET and ENCRYPTION_KEY are defined as placeholders. Replace these with secure, randomly generated strings before production deployment to ensure robust security.


28-31: Rate Limiting Parameters

Rate limiting settings are provided with reasonable defaults. Confirm that these thresholds align with expected production traffic patterns.


32-34: Performance Optimization

The CDN URL is configured properly for production. Verify that it corresponds to your actual CDN endpoint to ensure optimal asset delivery.


35-39: Feature Flags Configuration

The production feature flags are enabled or disabled as desired. Make sure that enabling NEXT_PUBLIC_ENABLE_WORLDID and NEXT_PUBLIC_ENABLE_ANALYTICS matches your current feature rollout strategy.


40-42: Cache Control Settings

The cache control settings (CACHE_MAX_AGE and STALE_WHILE_REVALIDATE) are set to standard values. These should support efficient content caching, but verify these values meet your application's caching strategy.

.env.example (10)

1-7: Development Environment Variables

The file outlines required environment variables for development, using local endpoints and placeholder secrets. This template helps ensure that developers set up their environments consistently.


8-11: Database Configuration Template

The Xata credentials are provided as placeholders. Developers should update these when setting up their local instances or moving to a staging environment.


12-14: Web3 Configuration for Development

The configuration for wallet features is included and uses a placeholder project ID, which can be updated as needed.


15-18: Security Settings for Development

JWT and encryption keys are documented as required and are represented by placeholders. It is important to use secure values during actual deployments.


19-23: Optional Feature Flags

The optional features are set to false by default, providing a safe fallback for local development until explicit activation is required.


24-27: Development Tools Configuration

Telemetry and analysis for development are correctly disabled, fostering an environment focused on debugging and iterative development.


28-31: Rate Limiting Defaults

The rate limiting defaults offer sensible starting thresholds for development. Adjust these as local workloads or tests indicate.


32-34: Cache Control Defaults

The cache control values provide a clear template for managing content caching. Developers should refer to these defaults when configuring production overrides.


36-37: Production Variable Note

The inclusion of a note reminding developers that additional variables are required for production (and pointing to .env.production) is a useful reference for maintaining consistency across environments.


38-40: Turbo Configuration

The Turbo-specific variables (TURBO_TEAM and TURBO_TOKEN) are now listed, which aids in integrating team-specific configurations. Ensure these placeholders are updated appropriately.

apps/web/tsconfig.json (6)

1-2: Base Configuration Extension

By extending ../../tsconfig.json, this configuration inherits the monorepo-wide TypeScript settings, ensuring consistency across projects.


3-8: Next.js Plugin Integration

Including the Next.js plugin simplifies integration with Next.js features and ensures that the TypeScript compiler respects Next-specific syntaxes and behaviors.


9-10: Base URL and Module Resolution

Setting the baseUrl to "." and defining a detailed mapping for module aliases streamlines imports and improves code maintainability.


11-28: Comprehensive Path Aliases

The extensive set of path aliases for directories like components, hooks, types, and services greatly enhances code readability and refactoring capabilities. Ensure that these aliases are in sync with your actual directory structure.


29-32: Strict Type-Checking

Enabling strict mode and setting noEmit to true, along with including necessary type definitions, enforces robust type-safety which will help catch errors early in development.


33-41: File Inclusion and Exclusion

The include and exclude settings are thoroughly defined to encompass all relevant TypeScript files while excluding node_modules, ensuring efficient compilation and type-checking.

package.json (8)

2-3: Naming and Privacy Settings Updated.
The new project name "@mindvault/monorepo" and the "private": true flag are appropriate for a monorepo setup.


4-29: Comprehensive Scripts Configuration.
The scripts now cover development, building (both apps and packages), linting, formatting, type checking, and even dependency management. This extensive set of commands improves developer efficiency and standardizes project tasks.


31-37: Expanded Development Dependencies.
The addition of dependencies such as "husky", "lint-staged", and "turbo" supports enhanced pre-commit checks and build tooling.


38-45: PNPM Configuration Enhanced.
The new "pnpm" field with peerDependencyRules allowing any version of "react" and "react-dom" adds flexibility, which is beneficial in a multi-package environment.


46-49: Workspaces Setup is on Point.
Defining workspaces for "apps/*" and "packages/*" aligns with best practices for monorepos, ensuring clear project structure and dependency isolation.


50-55: Lint-Staged Configuration Addition.
The configuration for lint-staged applied on TypeScript files enforces consistent code quality on commit, which is a vital improvement for maintaining a uniform codebase.


56-59: Engine Version Enforcement.
Specifying the required Node.js (>=18.17.0) and pnpm (>=8.0.0) versions helps standardize developer environments and builds.


60-62: Dependency Update.
The addition of "tailwind-merge": "^2.6.0" is a good enhancement for managing Tailwind CSS classes efficiently.

apps/web/package.json (4)

2-2: Project Name Updated.
Changing the package name to "@mindvault/web" clearly distinguishes the web frontend within the monorepo structure.


5-14: Updated Scripts Configuration.
The revised clean command now removes both .next and node_modules, and the switch to biome for linting and formatting (with dedicated fix commands) offers a more consistent developer experience.


17-31: Dependency Enhancements and Updates.

  • The addition of "@mindvault/types": "workspace:*" promotes shared types across the monorepo.
  • New dependencies like "@vercel/analytics", "@vercel/speed-insights", and "geist" indicate improved integrations and UI components.
  • Upgrading "@types/node" to "^20.17.18" is a prudent update for better type coverage.

42-47: DevDependency Revision Noted.
Minor updates in devDependencies—especially the update to "@types/node"—enhance consistency with the latest Node.js features and types.

biome.json (5)

4-7: VCS Configuration Update.
Enabling VCS support and updating "useIgnoreFile": true ensures that the biome tool respects the project's ignore settings, which is crucial for performance and accuracy.


10-21: Refined File Inclusion Patterns.
The updated include patterns target source files in both apps and packages directories accurately, contributing to improved linting and formatting performance.


22-37: Updated Ignore Patterns.
Broadening the ignore patterns (e.g., for API docs, icons, and public directories) will reduce unnecessary processing and tighten the configuration.


49-74: Enhanced Linter Rules.
Introducing additional rules for complexity (noForEach, useOptionalChain), performance (noDelete), and security (noDangerouslySetInnerHtml) is a proactive measure to maintain a secure and efficient codebase.


77-87: Improved JavaScript Formatter Settings.
Switching to single quotes and adding ES5 trailing commas enhances consistency and readability throughout the codebase.

.github/workflows/pr-check.yml (3)

39-62: Streamlined Quality Job Workflow.
The revised steps in the quality job—installing dependencies, running biome check, format, type-check, and building packages and apps—result in a cleaner and more efficient CI pipeline.


82-90: Security Job Steps are Clear and Concise.
Using pnpm install, pnpm check-deps for security auditing, and verifying dependencies for outdated packages improves the robustness of security checks.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 84-84: trailing spaces

(trailing-spaces)


95-132: Bundle Analysis Job Streamlined.
The process for bundle analysis, with proper environment variable configuration and the use of pnpm analyze, provides a focused approach to monitor bundle sizes and performance.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 97-97: trailing spaces

(trailing-spaces)


[error] 102-102: trailing spaces

(trailing-spaces)


[error] 108-108: trailing spaces

(trailing-spaces)


[error] 111-111: trailing spaces

(trailing-spaces)


[error] 121-121: trailing spaces

(trailing-spaces)


[error] 132-132: no new line character at the end of file

(new-line-at-end-of-file)


[error] 132-132: trailing spaces

(trailing-spaces)

apps/web/src/app/globals.css (8)

1-3: Tailwind Directives in Place.
The essential Tailwind CSS directives—@tailwind base;, @tailwind components;, and @tailwind utilities;—are correctly imported, ensuring proper style application.


5-11: Global HTML and Body Styles Configured.
The styles set for html and body (width, height, overscroll behavior, and overflow) lay a solid foundation for the app’s layout.


13-16: Updated min-h-screen for Dynamic Viewport Height.
Replacing 100vh with 100dvh for the .min-h-screen class addresses dynamic viewport issues on modern devices, resulting in a better user experience.


18-23: New Scroll-Container Class Added.
The introduction of the .scroll-container class, with its defined height and smooth scrolling properties, is a welcome addition for managing scrollable content effectively.


25-34: Global Typography Enhancements.
Applying a consistent font (var(--font-space-grotesk)) across various text elements under the @layer base improves visual uniformity and reinforces the design language.


35-97: Comprehensive CSS Variables and Theme Settings.
The detailed configuration of CSS variables for light and dark themes ensures an organized approach to color and spacing management across the application.


98-168: Maintained UI Component Styling.
The loader animations and custom scrollbar styles are well-defined and contribute to an improved end-user interface without interfering with the new global typography changes.


169-207: Animations and Transition Effects are Well-Configured.
The keyframe animations (fade-in, slide-up) and delay utilities provide smooth transitions that enhance the overall user experience.

@evgongora evgongora merged commit 80528a0 into MindVault-Inc:develop Feb 16, 2025
3 of 5 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