|
| 1 | +# Coolify AI Documentation |
| 2 | + |
| 3 | +Welcome to the Coolify AI documentation hub. This directory contains all AI assistant instructions organized by topic for easy navigation and maintenance. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +- **For Claude Code**: Start with [CLAUDE.md in root directory](../CLAUDE.md) |
| 8 | +- **For Cursor IDE**: Check `.cursor/rules/coolify-ai-docs.mdc` which references this directory |
| 9 | +- **For Other AI Tools**: Continue reading below |
| 10 | + |
| 11 | +## Documentation Structure |
| 12 | + |
| 13 | +### 📚 Core Documentation |
| 14 | +Essential project information and architecture: |
| 15 | + |
| 16 | +- **[Technology Stack](core/technology-stack.md)** - All versions, packages, and dependencies (Laravel 12.4.1, PHP 8.4.7, etc.) |
| 17 | +- **[Project Overview](core/project-overview.md)** - What Coolify is and how it works |
| 18 | +- **[Application Architecture](core/application-architecture.md)** - System design and component relationships |
| 19 | +- **[Deployment Architecture](core/deployment-architecture.md)** - How deployments work end-to-end, including Coolify Docker Compose extensions (custom fields) |
| 20 | + |
| 21 | +### 💻 Development |
| 22 | +Day-to-day development practices: |
| 23 | + |
| 24 | +- **[Workflow](development/development-workflow.md)** - Development setup, commands, and daily workflows |
| 25 | +- **[Testing Patterns](development/testing-patterns.md)** - How to write and run tests (Unit vs Feature, Docker requirements) |
| 26 | +- **[Laravel Boost](development/laravel-boost.md)** - Laravel-specific guidelines and best practices |
| 27 | + |
| 28 | +### 🎨 Patterns |
| 29 | +Code patterns and best practices by domain: |
| 30 | + |
| 31 | +- **[Database Patterns](patterns/database-patterns.md)** - Eloquent, migrations, relationships |
| 32 | +- **[Frontend Patterns](patterns/frontend-patterns.md)** - Livewire, Alpine.js, Tailwind CSS |
| 33 | +- **[Security Patterns](patterns/security-patterns.md)** - Authentication, authorization, security best practices |
| 34 | +- **[Form Components](patterns/form-components.md)** - Enhanced form components with authorization |
| 35 | +- **[API & Routing](patterns/api-and-routing.md)** - API design, routing conventions, REST patterns |
| 36 | + |
| 37 | +### 📖 Meta |
| 38 | +Documentation about documentation: |
| 39 | + |
| 40 | +- **[Maintaining Docs](meta/maintaining-docs.md)** - How to update and improve this documentation |
| 41 | +- **[Sync Guide](meta/sync-guide.md)** - Keeping documentation synchronized across tools |
| 42 | + |
| 43 | +## Quick Decision Tree |
| 44 | + |
| 45 | +**What do you need help with?** |
| 46 | + |
| 47 | +### Running Commands |
| 48 | +→ [development/development-workflow.md](development/development-workflow.md) |
| 49 | +- Frontend: `npm run dev`, `npm run build` |
| 50 | +- Backend: `php artisan serve`, `php artisan migrate` |
| 51 | +- Tests: Docker for Feature tests, mocking for Unit tests |
| 52 | +- Code quality: `./vendor/bin/pint`, `./vendor/bin/phpstan` |
| 53 | + |
| 54 | +### Writing Tests |
| 55 | +→ [development/testing-patterns.md](development/testing-patterns.md) |
| 56 | +- **Unit tests**: No database, use mocking, run outside Docker |
| 57 | +- **Feature tests**: Can use database, must run inside Docker |
| 58 | +- Command: `docker exec coolify php artisan test` |
| 59 | + |
| 60 | +### Building UI |
| 61 | +→ [patterns/frontend-patterns.md](patterns/frontend-patterns.md) or [patterns/form-components.md](patterns/form-components.md) |
| 62 | +- Livewire components with server-side state |
| 63 | +- Alpine.js for client-side interactivity |
| 64 | +- Tailwind CSS 4.1.4 for styling |
| 65 | +- Form components with built-in authorization |
| 66 | + |
| 67 | +### Database Work |
| 68 | +→ [patterns/database-patterns.md](patterns/database-patterns.md) |
| 69 | +- Eloquent ORM patterns |
| 70 | +- Migration best practices |
| 71 | +- Relationship definitions |
| 72 | +- Query optimization |
| 73 | + |
| 74 | +### Security & Auth |
| 75 | +→ [patterns/security-patterns.md](patterns/security-patterns.md) |
| 76 | +- Team-based access control |
| 77 | +- Policy and gate patterns |
| 78 | +- Form authorization (canGate, canResource) |
| 79 | +- API security |
| 80 | + |
| 81 | +### Laravel-Specific Questions |
| 82 | +→ [development/laravel-boost.md](development/laravel-boost.md) |
| 83 | +- Laravel 12 patterns |
| 84 | +- Livewire 3 best practices |
| 85 | +- Pest testing patterns |
| 86 | +- Laravel conventions |
| 87 | + |
| 88 | +### Docker Compose Extensions |
| 89 | +→ [core/deployment-architecture.md](core/deployment-architecture.md#coolify-docker-compose-extensions) |
| 90 | +- Custom fields: `exclude_from_hc`, `content`, `isDirectory` |
| 91 | +- How to use inline file content |
| 92 | +- Health check exclusion patterns |
| 93 | +- Volume creation control |
| 94 | + |
| 95 | +### Version Numbers |
| 96 | +→ [core/technology-stack.md](core/technology-stack.md) |
| 97 | +- **Single source of truth** for all version numbers |
| 98 | +- Don't duplicate versions elsewhere, reference this file |
| 99 | + |
| 100 | +## Navigation Tips |
| 101 | + |
| 102 | +1. **Start broad**: Begin with project-overview or ../CLAUDE.md |
| 103 | +2. **Get specific**: Navigate to topic-specific files for details |
| 104 | +3. **Cross-reference**: Files link to related topics |
| 105 | +4. **Single source**: Version numbers and critical data exist in ONE place only |
| 106 | + |
| 107 | +## For AI Assistants |
| 108 | + |
| 109 | +### Important Patterns to Follow |
| 110 | + |
| 111 | +**Testing Commands:** |
| 112 | +- Unit tests: `./vendor/bin/pest tests/Unit` (no database, outside Docker) |
| 113 | +- Feature tests: `docker exec coolify php artisan test` (requires database, inside Docker) |
| 114 | +- NEVER run Feature tests outside Docker - they will fail with database connection errors |
| 115 | + |
| 116 | +**Version Numbers:** |
| 117 | +- Always use exact versions from [technology-stack.md](core/technology-stack.md) |
| 118 | +- Laravel 12.4.1, PHP 8.4.7, Tailwind 4.1.4 |
| 119 | +- Don't use "v12" or "8.4" - be precise |
| 120 | + |
| 121 | +**Form Authorization:** |
| 122 | +- ALWAYS include `canGate` and `:canResource` on form components |
| 123 | +- See [form-components.md](patterns/form-components.md) for examples |
| 124 | + |
| 125 | +**Livewire Components:** |
| 126 | +- MUST have exactly ONE root element |
| 127 | +- See [frontend-patterns.md](patterns/frontend-patterns.md) for details |
| 128 | + |
| 129 | +**Code Style:** |
| 130 | +- Run `./vendor/bin/pint` before finalizing changes |
| 131 | +- Follow PSR-12 standards |
| 132 | +- Use PHP 8.4 features (constructor promotion, typed properties, etc.) |
| 133 | + |
| 134 | +## Contributing |
| 135 | + |
| 136 | +When updating documentation: |
| 137 | +1. Read [meta/maintaining-docs.md](meta/maintaining-docs.md) |
| 138 | +2. Follow the single source of truth principle |
| 139 | +3. Update cross-references when moving content |
| 140 | +4. Test all links work |
| 141 | +5. Run Pint on markdown files if applicable |
| 142 | + |
| 143 | +## Questions? |
| 144 | + |
| 145 | +- **Claude Code users**: Check [../CLAUDE.md](../CLAUDE.md) first |
| 146 | +- **Cursor IDE users**: Check `.cursor/rules/coolify-ai-docs.mdc` |
| 147 | +- **Documentation issues**: See [meta/maintaining-docs.md](meta/maintaining-docs.md) |
| 148 | +- **Sync issues**: See [meta/sync-guide.md](meta/sync-guide.md) |
0 commit comments