๐งญ 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 finderCtrl+Shift+F- Global searchCtrl+T- Go to symbolF12- Go to definitionShift+F12- Find referencesCtrl+Click- Navigate to definition
Zed¶
Cmd+P- File finderCmd+Shift+F- Project searchCmd+T- Symbol searchF12- Go to definitionShift+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
๐ฏ Navigation Patterns¶
๐ 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:
Type Definitions:
Test Files:
๐งฉ Component Architecture Navigation¶
Finding Related Files¶
For any React component:
- Component file:
src/components/*/component-name.tsx - Test file:
tests/unit/components/component-name.test.tsx - Storybook story:
src/components/*/component-name.stories.tsx - Type definitions:
src/lib/types/(if complex)
For API routes:
- Route handler:
src/app/api/*/route.ts - Service layer:
src/lib/services/*-service.ts - Validation:
src/lib/validation/*.ts - Types:
src/lib/types/*.ts - 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:
Find all hooks:
Find error handling:
File-Specific Patterns¶
TypeScript types:
interface.*\w+.*{ # Interface definitions
type.*\w+.*= # Type aliases
enum.*\w+.*{ # Enum definitions
React patterns:
๐ท๏ธ Naming Conventions for Search¶
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:
Find all service files:
๐ IDE-Specific Navigation Features¶
VS Code Advanced Navigation¶
Workspace Symbols¶
Ctrl+T- Search all symbols across workspaceCtrl+Shift+O- Search symbols in current fileCtrl+Shift+.- Navigate to symbol by category
Go to Definition & References¶
F12- Go to definitionAlt+F12- Peek definitionShift+F12- Find all referencesShift+Alt+F12- Peek references
Breadcrumb Navigation¶
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¶
Zed Navigation Features¶
Project-Wide Search¶
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¶
- Plan:
docs/- Check existing documentation - Types:
src/lib/types/- Define/update types - Services:
src/lib/services/- Business logic - API:
src/app/api/- Create/update endpoints - Components:
src/components/- UI implementation - Pages:
src/app/- Integration - Tests:
tests/- Validation - Documentation:
docs/- Update guides
Bug Investigation Path¶
- Logs: Check console/terminal for errors
- Network: Dev tools for API issues
- Components: React DevTools for UI issues
- Services: Debug business logic
- Types: Verify type definitions
- Tests: Add test cases
- 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 bookmarkCtrl+Alt+L- List bookmarksCtrl+Alt+J/Q- Navigate bookmarks
Commonly Bookmarked Files:
src/app/page.tsx- Main interfacesrc/lib/env.ts- Environment configsrc/lib/services/chat-service.ts- AI servicesrc/app/api/chat/route.ts- Chat APIdocs/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¶
- Multi-cursor editing -
Ctrl+Dto select next occurrence - Column selection -
Shift+Alt+Dragfor block selection - Quick replace -
Ctrl+Hfor find and replace - File switching -
Ctrl+Tabfor recent files - Split editors -
Ctrl+\for side-by-side editing
๐ Advanced Search Techniques¶
Regular Expressions in Search¶
# 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¶
- VS Code:
Ctrl+Shift+Pโ "TypeScript: Restart TS Server" - Zed: Restart LSP via command palette
- Check
tsconfig.jsonpaths configuration
File Search Not Finding Files¶
- Check
.gitignoreand search exclusions - Verify file indexing is complete
- Clear editor cache/restart
Go to Definition Broken¶
- Ensure TypeScript server is running
- Check import paths are correct
- Verify type definitions are available
๐ง Performance Optimization¶
Large Project Navigation¶
- Exclude unnecessary directories from search
- Use specific file patterns instead of global search
- Split workspace into smaller logical units
- Close unused tabs regularly
Memory Usage¶
- Limit concurrent files open in editor
- Use lightweight extensions only
- Configure file watching exclusions
- Restart editor periodically
๐ Navigation Metrics & Analytics¶
๐ 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.