Branchwell

AI Resource Pro / website / .cursorrules

1Start all chats with 🤖
2
3Keep github commit messages concise and to the point.
4
5This is outdated in your model: shadcn-ui changed to shadcn
6
7I am on plesk. My domain is airesourcepro.com (the old airesource.pro redirects to it). I am running on localhost on port 3000. The site uses a Supabase database (Used for Authentication and Database)
8
9Stay focused within the constraints on the prompt. Do not stray and do more work unless asked.
10
11Our primary authentcation on the API is supabase admin authentication. There is also an API key NEXT_PUBLIC_AI_RESOURCE_PRO_API_KEY stored in .env.local, but this is secondary.
12
13There is an authentication backdoor for localhost testing, but NEVER leave any authentication bypasses enabled or set BYPASS_AUTH_IN_DEV to true in the .env.local environment variables. Security is critical.
14
15Provide a brief explaination of what you are doing before each tool call
16
17Don't ever commit anything before I confirm it.
18
19API Uses Supabase admin authentication.
20
21When I say "no change", that means nothing changed and you should roll back any changes that you made that did not work.
22
23## Site Colors - Light Theme
24- Primary: #1a1a1a
25- Secondary Accent: #46AAE9
26- Text: #000000
27- Background: #ffffff
28
29## Site Colors - Dark Theme
30- Primary: #ffffff
31- Secondary Accent: #46AAE9
32- Text: #ffffff
33- Background: #1a1a1a
34
35
36## Stack
37
38- React
39- Next.js
40- Tailwind CSS
41- TypeScript
42- Shadcn UI
43- Supabase (Used for Authentication and Database)
44
45
46
47# Project Architecture
48The project should seed and update the Supabase database using the 'seed-supabase.ts' script.
49
50It uses the following JSON files as seed structure:
51- news.json - News Table
52- tools.json - Tools Table
53- categories.json - Categories Table
54
55
56Categories API Route (seed json filename 'categories.json')
57- Lucide React Icon Name
58- Category Name
59-
60News feed
61- primary cat
62
63
64# Coding pattern preferences
65- Always prefer simple solutions
66- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
67- Write code that takes into account the different environments: dev, tert, and prod
68- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
69- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we don't have duplicate logic.
70- Keep the codebase very clean and organized
71- Avoid writing scripts in files if possible, especially if the script is likely only to be run once
72- Avoid having files over 200-300 lines of code. Refactor at that point.
73- Mocking data is only needed for tests, never mock data for dev or prod
74- Never add stubbing or fake data patterns to code that affects the dev or prod environments
75- Never overwrite my env file without first asking and confirming
76
77# Separation Rules
78- **Single Responsibility:**
79Each file should represent one distinct unit of work.
80- **Component Breakdown:**
81Break features into self-contained components.
82- **Use Hooks:**
83Encapsulate logic and data access in custom hooks.
84- **Global vs. Local:** | I
85- **Global:** Place reusable components and hooks in shared/global folders.
86- **Local:** Keep object-specific components and hooks in localized folders.
87- **Separation of Concerns:**
88Maintain clear boundaries when creating or refactoring files.
89- **Readable and Declarative Code:**
90Rendered code should be very legible and clear. It should not include flow logic or ternary operators where possible.
91
92# Coding workflow preferences
93- Focus on the areas of code relevant to the task
94- Do not touch code that is unrelated to the task
95- Write thorough tests for all major functionality
96- Avoid making major changes to the patterns and architecture of how a feature works, after it has shown to work well, unless explicitly instructed
97- Always think about what other methods and areas of code might be affected by code changes