Add project structure and rules documentation: Introduce guidelines for organizing backend, frontend, and shared components, including rules for services, API routes, clients, and components to ensure a consistent and maintainable codebase.

This commit is contained in:
Julien Froidefond
2025-12-12 16:18:55 +01:00
parent ce0697a908
commit fd095246a3
9 changed files with 664 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
---
globs: src/components/**/*.tsx
---
# Components Rules
1. UI components MUST be in src/components/ui/
2. Feature components MUST be in their feature folder
3. Components MUST use clients for data fetching
4. Components MUST be properly typed
Example of correct component:
```typescript
import { useMyClient } from '@/hooks/use-my-client';
export const MyComponent = () => {
const { data } = useMyClient();
return <div>{data.map(item => <Item key={item.id} {...item} />)}</div>;
};
```
❌ FORBIDDEN:
- Direct service usage
- Direct database queries
- Direct fetch calls
- Untyped props