---
description: "File organization and architectural patterns for the AI setup repository"
globs: ["src/**/*", "app/**/*", "public/**/*", "docs/**/*"]
alwaysApply: false
---

# Project Structure & Architecture

Guidelines for organizing files and structuring the AI setup repository.

## Expected Project Structure

```
.
├── README.md                 # Project documentation
├── LICENSE                   # MIT license
├── .gitignore               # Node.js/Next.js patterns
├── .cursor/rules/           # Cursor project rules
├── .env.example             # Environment variable template
├── package.json             # Dependencies and scripts
├── next.config.js           # Next.js configuration
├── tsconfig.json            # TypeScript configuration
├── src/
│   ├── app/                 # Next.js app directory
│   ├── components/          # React components
│   ├── lib/                 # Utility functions and AI clients
│   ├── types/               # TypeScript type definitions
│   └── utils/               # Helper functions
├── public/                  # Static assets
└── docs/                    # Additional documentation
```

## Key Directory Guidelines

### Source Code Organization
- `src/lib/` - Place AI client configurations and utilities here
- `src/components/` - Reusable UI components, including AI-powered components
- `src/app/api/` - API routes for AI services and integrations
- `src/types/` - TypeScript definitions for AI responses and data models

### Component Organization
- Group related components in feature-specific subdirectories
- Keep component styles and tests near the component
- Use index files for clean imports

### Utility Organization
- Group related utilities in feature-specific directories
- Separate AI-specific utilities from general utilities
- Implement consistent naming patterns

## Architectural Principles

### 1. Node.js/Next.js Development
- Follow Next.js 13+ App Router patterns when applicable
- Use modern ES6+ JavaScript/TypeScript features
- Implement proper async/await patterns for AI API calls
- Use React Server Components where appropriate
- Optimize for both development and production environments

### 2. File Naming Conventions
- Use camelCase for JavaScript/TypeScript files
- Use PascalCase for React component files
- Use kebab-case for API routes and static files
- Use descriptive names that indicate purpose

### 3. Import Organization
- Group imports by type (external, internal, relative)
- Use absolute imports with path aliases when configured
- Keep imports organized and clean

### 4. Configuration Management
- Keep all configuration files in the project root
- Use TypeScript for configuration files when possible
- Document configuration options and their purposes