Skip to content

๐Ÿงญ Project Navigation Guide

Smart navigation patterns and file organization for efficient development in VS Code and Zed.

๐Ÿ“‹ Quick Reference

๐ŸŽฏ Essential Locations

Purpose Location Description
Main App src/app/page.tsx Home page (chat interface)
API Routes src/app/api/ REST endpoints
Components src/components/ Reusable React components
Services src/lib/services/ Business logic layer
Types src/lib/types/ TypeScript definitions
Utilities src/lib/utils/ Helper functions
Tests tests/ All test files
Documentation docs/ Project documentation
Configuration Root directory Config files

โšก Quick Navigation Shortcuts

VS Code

  • Ctrl+P - Quick file finder
  • Ctrl+Shift+F - Global search
  • Ctrl+T - Go to symbol
  • F12 - Go to definition
  • Shift+F12 - Find references
  • Ctrl+Click - Navigate to definition

Zed

  • Cmd+P - File finder
  • Cmd+Shift+F - Project search
  • Cmd+T - Symbol search
  • F12 - Go to definition
  • Shift+F12 - Find references

๐Ÿ—‚๏ธ Directory Structure Deep Dive

chat/
โ”œโ”€โ”€ ๐Ÿ“ .github/              # GitHub workflows & templates
โ”‚   โ”œโ”€โ”€ copilot-instructions.md    # AI pair programming context
โ”‚   โ”œโ”€โ”€ workflows/                 # CI/CD automation
โ”‚   โ””โ”€โ”€ ISSUE_TEMPLATE/           # Issue templates
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ .vscode/              # VS Code workspace configuration
โ”‚   โ”œโ”€โ”€ settings.json             # Editor settings
โ”‚   โ”œโ”€โ”€ extensions.json           # Recommended extensions
โ”‚   โ”œโ”€โ”€ tasks.json               # Automated tasks
โ”‚   โ””โ”€โ”€ launch.json              # Debug configurations
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ .zed/                 # Zed editor configuration
โ”‚   โ””โ”€โ”€ settings.json             # Project-specific settings
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ docs/                 # ๐Ÿ“š Documentation Hub
โ”‚   โ”œโ”€โ”€ README.md                 # Documentation index
โ”‚   โ”œโ”€โ”€ DEVELOPMENT.md            # Setup & workflows
โ”‚   โ”œโ”€โ”€ EDITOR-SETUP.md          # VS Code/Zed optimization
โ”‚   โ”œโ”€โ”€ API.md                   # API documentation
โ”‚   โ”œโ”€โ”€ PROJECT-STATUS.md        # Current project state
โ”‚   โ”œโ”€โ”€ PROJECT-NAVIGATION.md    # This file
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ deployment/           # Deployment guides
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ testing/              # Testing documentation
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ features/             # Feature documentation
โ”‚   โ””โ”€โ”€ ๐Ÿ“ migration/            # Upgrade guides
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ scripts/              # ๐Ÿ”ง Utility Scripts
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ deployment/           # Deployment automation
โ”‚   โ”‚   โ”œโ”€โ”€ deploy-staging.sh    # Cloud Run deployment
โ”‚   โ”‚   โ””โ”€โ”€ setup-secrets.sh     # GCP secrets management
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/                # Development utilities
โ”‚   โ”‚   โ””โ”€โ”€ hash-password.js     # Password hashing tool
โ”‚   โ””โ”€โ”€ ๐Ÿ“ mcp/                  # MCP integration scripts
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ src/                  # ๐Ÿ’ป Source Code
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ app/                  # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ api/              # ๐Ÿš€ API Routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ auth/         # Authentication endpoints
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [...nextauth]/route.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ chat/         # Chat endpoints
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ route.ts     # Main chat API
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ models/       # AI model endpoints
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ route.ts     # Model selection API
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ login/            # Authentication pages
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ page.tsx         # Login interface
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx           # Root layout component
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx            # ๐Ÿ  Main chat interface
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css         # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ loading.tsx         # Loading UI
โ”‚   โ”‚   โ””โ”€โ”€ error.tsx           # Error boundary
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/           # ๐Ÿงฉ React Components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ ui/               # Base UI components (shadcn/ui)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ button.tsx       # Button component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ input.tsx        # Input component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ select.tsx       # Select component
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...              # Other base components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ chat/             # Chat-specific components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat-interface.tsx    # Main chat UI
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ message-list.tsx      # Message display
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ message-input.tsx     # Message input
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ model-selector.tsx    # AI model selection
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ auth/             # Authentication components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ login-form.tsx        # Login form
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth-provider.tsx     # Auth context
โ”‚   โ”‚   โ””โ”€โ”€ performance-monitor.tsx   # Web Vitals tracking
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ lib/                  # ๐Ÿ› ๏ธ Core Libraries
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ auth/             # Authentication logic
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ config.ts        # NextAuth configuration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ password.ts      # Password utilities
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ services/         # Business logic layer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat-service.ts  # ๐Ÿค– Vertex AI integration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth-service.ts  # Authentication service
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ hooks/            # Custom React hooks
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ use-chat.ts      # Chat functionality
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ use-auth.ts      # Authentication state
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/            # Utility functions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cn.ts           # Class name utility
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ format.ts       # Data formatting
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ types/            # TypeScript definitions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.ts         # Auth types
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat.ts         # Chat types
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.ts          # API types
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ validation/       # Zod schemas
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth.ts         # Auth validation
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ chat.ts         # Chat validation
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ streaming/        # Streaming utilities
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ features/         # Feature flags
โ”‚   โ”‚   โ”œโ”€โ”€ env.ts              # ๐Ÿ” Environment validation
โ”‚   โ”‚   โ”œโ”€โ”€ logger.ts           # Centralized logging
โ”‚   โ”‚   โ”œโ”€โ”€ errors.ts           # Custom error classes
โ”‚   โ”‚   โ””โ”€โ”€ performance.ts      # Performance monitoring
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ middleware.ts            # ๐Ÿ›ก๏ธ Next.js middleware (auth, security, rate limiting)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ tests/                # ๐Ÿงช Test Suite
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ unit/                 # Unit tests
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/       # Component tests
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ lib/              # Library tests
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ utils/            # Utility tests
โ”‚   โ””โ”€โ”€ ๐Ÿ“ integration/          # Integration tests
โ”‚       โ””โ”€โ”€ ๐Ÿ“ api/              # API integration tests
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ .storybook/           # ๐Ÿ“– Component Documentation
โ”œโ”€โ”€ ๐Ÿ“ .husky/               # Git hooks
โ”œโ”€โ”€ ๐Ÿ“ .next/                # Next.js build output (auto-generated)
โ”œโ”€โ”€ ๐Ÿ“ node_modules/         # Dependencies (auto-generated)
โ”‚
โ””โ”€โ”€ ๐Ÿ—‚๏ธ Configuration Files
    โ”œโ”€โ”€ package.json             # Dependencies & scripts
    โ”œโ”€โ”€ next.config.ts          # Next.js configuration
    โ”œโ”€โ”€ tailwind.config.js      # Tailwind CSS setup
    โ”œโ”€โ”€ tsconfig.json          # TypeScript configuration
    โ”œโ”€โ”€ eslint.config.mjs      # ESLint rules
    โ”œโ”€โ”€ prettier.config.js     # Code formatting
    โ”œโ”€โ”€ vitest.config.ts       # Unit test configuration
    โ””โ”€โ”€ Dockerfile             # Container configuration

๐Ÿ” Finding Files Efficiently

By Feature/Functionality

Authentication:

src/app/api/auth/[...nextauth]/route.ts  # NextAuth API route
src/app/login/page.tsx                   # Login page
src/components/auth/                     # Auth components
src/lib/auth/                           # Auth utilities

Chat System:

src/app/page.tsx                        # Main chat interface
src/app/api/chat/route.ts               # Chat API endpoint
src/components/chat/                    # Chat components
src/lib/services/chat-service.ts        # AI integration
src/lib/hooks/use-chat.ts              # Chat hooks

API Layer:

src/app/api/                           # All API routes
src/lib/services/                      # Business logic
src/lib/validation/                    # Request/response schemas
src/lib/types/                         # Type definitions

By File Type

React Components:

# Quick find pattern: "*.tsx" in src/components/
# VS Code: Ctrl+P โ†’ "@*.tsx"
# Zed: Cmd+P โ†’ "*.tsx"

API Routes:

# Pattern: "**/api/**/route.ts"
# Quick navigation to specific API

Type Definitions:

# Pattern: "**/types/*.ts"
# Find all type files

Test Files:

# Pattern: "**/*.{test,spec}.{ts,tsx}"
# Find all test files

๐Ÿงฉ Component Architecture Navigation

For any React component:

  1. Component file: src/components/*/component-name.tsx
  2. Test file: tests/unit/components/component-name.test.tsx
  3. Storybook story: src/components/*/component-name.stories.tsx
  4. Type definitions: src/lib/types/ (if complex)

For API routes:

  1. Route handler: src/app/api/*/route.ts
  2. Service layer: src/lib/services/*-service.ts
  3. Validation: src/lib/validation/*.ts
  4. Types: src/lib/types/*.ts
  5. Test: tests/integration/api/*.test.ts

๐Ÿ”Ž Search Patterns & Tips

๐ŸŽฏ Effective Search Strategies

Global Search Patterns

Find all components:

# VS Code/Zed: Search for
export.*function.*\w+\(.*\).*{    # Function components
export.*const.*=.*\(.*\).*=>      # Arrow function components

Find API endpoints:

# Search in: src/app/api/
export.*async.*function.*(GET|POST|PUT|DELETE)

Find all hooks:

# Search in: src/lib/hooks/
export.*function.*use\w+
export.*const.*use\w+.*=

Find error handling:

# Search for error patterns
throw.*new.*Error
catch.*\(.*error.*\)

File-Specific Patterns

TypeScript types:

interface.*\w+.*{        # Interface definitions
type.*\w+.*=            # Type aliases
enum.*\w+.*{            # Enum definitions

React patterns:

useState.*\(            # State hooks
useEffect.*\(           # Effect hooks
props\.\w+              # Props usage

File Naming Patterns

  • Pages: page.tsx, layout.tsx, loading.tsx, error.tsx
  • Components: kebab-case.tsx (e.g., chat-interface.tsx)
  • Hooks: use-feature-name.ts (e.g., use-chat.ts)
  • Services: feature-service.ts (e.g., chat-service.ts)
  • Types: feature.ts (e.g., chat.ts, auth.ts)
  • Utils: feature.ts (e.g., format.ts, validation.ts)

Search by Convention

Find all custom hooks:

# File pattern: "**/use-*.ts"
# Content pattern: "export.*function.*use\w+"

Find all service files:

# File pattern: "**/*-service.ts"
# Content pattern: "class.*Service"

๐Ÿš€ IDE-Specific Navigation Features

VS Code Advanced Navigation

Workspace Symbols

  • Ctrl+T - Search all symbols across workspace
  • Ctrl+Shift+O - Search symbols in current file
  • Ctrl+Shift+. - Navigate to symbol by category

Go to Definition & References

  • F12 - Go to definition
  • Alt+F12 - Peek definition
  • Shift+F12 - Find all references
  • Shift+Alt+F12 - Peek references
  • Ctrl+Shift+; - Navigate breadcrumbs
  • Click breadcrumb items - Quick navigation to parent directories

Explorer Integration

  • Ctrl+Shift+E - Focus file explorer
  • Right-click โ†’ "Reveal in File Explorer" - Open in system file manager
  • File nesting - Grouped related files (configured in workspace)

Multi-root Workspace

{
  "folders": [{ "path": "./src" }, { "path": "./docs" }, { "path": "./tests" }]
}

Zed Navigation Features

  • Cmd+Shift+F - Global search with context
  • Search filters - By file type, directory, etc.

Symbol Navigation

  • Cmd+T - Fuzzy symbol search
  • Go to definition - Built-in LSP support
  • Hover documentation - Inline type information

File Tree

  • Optimized exclusions - Faster navigation
  • Git status integration - Visual diff indicators
  • Folder collapsing - Clean project view

๐Ÿ“š Context-Aware Navigation

๐Ÿง  Understanding File Relationships

Data Flow Navigation

User Request โ†’ Response:

1. src/app/page.tsx                    # User interface
2. src/components/chat/chat-interface.tsx  # Chat component
3. src/lib/hooks/use-chat.ts          # Chat logic
4. src/app/api/chat/route.ts          # API endpoint
5. src/lib/services/chat-service.ts   # Vertex AI integration
6. src/lib/validation/chat.ts         # Request validation
7. src/lib/types/chat.ts              # Type definitions

Configuration Chain

1. package.json                       # Dependencies
2. next.config.ts                     # Next.js setup
3. src/lib/env.ts                     # Environment validation
4. src/middleware.ts                  # Request processing
5. src/app/layout.tsx                 # App structure
6. src/app/page.tsx                   # Main interface

๐Ÿ”„ Development Workflow Navigation

Feature Development Path

  1. Plan: docs/ - Check existing documentation
  2. Types: src/lib/types/ - Define/update types
  3. Services: src/lib/services/ - Business logic
  4. API: src/app/api/ - Create/update endpoints
  5. Components: src/components/ - UI implementation
  6. Pages: src/app/ - Integration
  7. Tests: tests/ - Validation
  8. Documentation: docs/ - Update guides

Bug Investigation Path

  1. Logs: Check console/terminal for errors
  2. Network: Dev tools for API issues
  3. Components: React DevTools for UI issues
  4. Services: Debug business logic
  5. Types: Verify type definitions
  6. Tests: Add test cases
  7. Configuration: Check setup files

๐ŸŽจ Visual Navigation Aids

๐Ÿ“ File Icons & Visual Cues

VS Code File Icons (Material Icon Theme)

  • ๐Ÿ“„ TypeScript: Blue TS icon
  • โš›๏ธ React/TSX: Blue React icon
  • ๐ŸŽจ CSS: Green CSS icon
  • ๐Ÿ“ Markdown: Blue MD icon
  • โš™๏ธ JSON: Yellow gear icon
  • ๐Ÿ”ง Config files: Orange/gray icons

File Explorer Organization

๐Ÿ“ src/
โ”œโ”€โ”€ ๐Ÿ“ app/           # Pages and API routes
โ”œโ”€โ”€ ๐Ÿ“ components/    # React components
โ”œโ”€โ”€ ๐Ÿ“ lib/          # Utilities and services
โ””โ”€โ”€ middleware.ts     # Request processing

๐Ÿ“ docs/              # Documentation
๐Ÿ“ tests/             # Test files
๐Ÿ“ scripts/           # Utility scripts
๐Ÿ“ .vscode/          # Editor configuration

๐ŸŽฏ Quick Access Patterns

Bookmarks & Shortcuts

VS Code Bookmarks Extension:

  • Ctrl+Alt+K - Toggle bookmark
  • Ctrl+Alt+L - List bookmarks
  • Ctrl+Alt+J/Q - Navigate bookmarks

Commonly Bookmarked Files:

  • src/app/page.tsx - Main interface
  • src/lib/env.ts - Environment config
  • src/lib/services/chat-service.ts - AI service
  • src/app/api/chat/route.ts - Chat API
  • docs/README.md - Documentation hub

๐Ÿ”ง Customization Tips

โš™๏ธ Personal Navigation Setup

VS Code User Settings

{
  "workbench.editor.enablePreview": false,
  "explorer.sortOrder": "type",
  "explorer.compactFolders": false,
  "search.exclude": {
    "**/node_modules": true,
    "**/.next": true,
    "**/coverage": true
  },
  "files.associations": {
    "*.css": "tailwindcss"
  }
}

Zed User Settings

{
  "base_keymap": "VSCode",
  "theme": "One Dark",
  "project_panel": {
    "git_status": true,
    "auto_fold_dirs": true
  },
  "outline_panel": {
    "button": true
  }
}

๐Ÿ“‹ Custom Tasks for Navigation

VS Code Tasks for File Generation

{
  "label": "Create New Component",
  "type": "shell",
  "command": "mkdir -p src/components/${input:componentName} && touch src/components/${input:componentName}/${input:componentName}.tsx",
  "group": "build"
}

๐Ÿš€ Pro Tips

โšก Speed Navigation Techniques

  1. Multi-cursor editing - Ctrl+D to select next occurrence
  2. Column selection - Shift+Alt+Drag for block selection
  3. Quick replace - Ctrl+H for find and replace
  4. File switching - Ctrl+Tab for recent files
  5. Split editors - Ctrl+\ for side-by-side editing

๐Ÿ” Advanced Search Techniques

# Find all React components
export.*function.*[A-Z]\w+.*\(

# Find all API route handlers
export.*async.*function.*(GET|POST|PUT|DELETE)

# Find all TypeScript interfaces
interface\s+[A-Z]\w+.*\{

Search Scopes

  • Current file: Ctrl+F
  • Current folder: Right-click folder โ†’ "Find in Folder"
  • Specific file types: Use file patterns like *.tsx,*.ts

๐Ÿ“Š Productivity Metrics

Measure your navigation efficiency:

  • Time to find specific file: < 5 seconds
  • Time to locate function/component: < 10 seconds
  • Context switching between related files: < 3 seconds

๐Ÿ› ๏ธ Troubleshooting Navigation Issues

๐Ÿšจ Common Problems

IntelliSense Not Working

  1. VS Code: Ctrl+Shift+P โ†’ "TypeScript: Restart TS Server"
  2. Zed: Restart LSP via command palette
  3. Check tsconfig.json paths configuration

File Search Not Finding Files

  1. Check .gitignore and search exclusions
  2. Verify file indexing is complete
  3. Clear editor cache/restart

Go to Definition Broken

  1. Ensure TypeScript server is running
  2. Check import paths are correct
  3. Verify type definitions are available

๐Ÿ”ง Performance Optimization

Large Project Navigation

  1. Exclude unnecessary directories from search
  2. Use specific file patterns instead of global search
  3. Split workspace into smaller logical units
  4. Close unused tabs regularly

Memory Usage

  1. Limit concurrent files open in editor
  2. Use lightweight extensions only
  3. Configure file watching exclusions
  4. Restart editor periodically

๐Ÿ“Š Track Your Efficiency

Key Metrics:

  • Files opened per session - Monitor tab management
  • Search queries - Track most common searches
  • Navigation patterns - Identify frequently accessed paths
  • Time in directories - Optimize workspace layout

Optimization Goals:

  • Reduce time to find any file to < 5 seconds
  • Minimize context switching between related files
  • Maintain clean workspace with < 10 open tabs
  • Use keyboard shortcuts for 80% of navigation

๐ŸŽฏ Happy navigating! This guide will help you move through the codebase like a pro.

Keep this guide bookmarked and refer to it when exploring new areas of the project.