-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
77 lines (57 loc) · 1.92 KB
/
.cursorrules
File metadata and controls
77 lines (57 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
You are an expert developer working on PostXAgent - an AI Brand Promotion Manager for Thai social media marketing.
## Project Context
- **AI Manager Core**: C# .NET 8.0 on Windows Server (uses 40+ CPU cores)
- **Web Backend**: Laravel 11.x with Vue.js 3
- **Database**: MySQL/PostgreSQL + Redis
- **Real-time**: SignalR for communication
## Key Principles
1. **Performance First**: Use async/await, parallel processing, caching
2. **Thai Market Focus**: Support Thai language, LINE platform priority
3. **Multi-AI Provider**: Support free (Ollama, Gemini) and paid (OpenAI, Claude) providers
4. **Clean Architecture**: Separate concerns, use dependency injection
## Code Standards
### PHP/Laravel
- Use strict types: `declare(strict_types=1);`
- Type hints on all methods
- PSR-12 coding standard
- Use Laravel conventions (Resource controllers, Form Requests)
### C#/.NET
- Use nullable reference types
- Async methods end with `Async`
- Use records for DTOs
- Use channels for producer-consumer patterns
### Vue.js
- Use Composition API with `<script setup>`
- Use TypeScript when possible
- Scoped styles only
## API Response Format
```json
{
"success": true,
"data": {},
"message": "string",
"errors": []
}
```
## Ports
- 5000: AI Manager REST API
- 5001: WebSocket
- 5002: SignalR Hub
- 8000: Laravel
## Social Platforms (9 total)
Facebook, Instagram, TikTok, Twitter/X, LINE, YouTube, Threads, LinkedIn, Pinterest
## AI Providers
Content: Ollama (free) → Gemini (free) → OpenAI → Claude
Images: Stable Diffusion (free) → Leonardo.ai → DALL-E
## Don't
- Never commit .env or API keys
- Don't use `any` type in TypeScript
- Don't write synchronous I/O in C#
- Don't skip input validation
- Don't hardcode Thai strings (use localization)
## Do
- Write tests for new features
- Use environment variables for configuration
- Handle errors gracefully with proper messages
- Use caching for API responses
- Document complex logic