Skip to content

Commit 05aa8c0

Browse files
authored
Merge pull request #36 from ModusCreateOrg/cursor-improvements
[NO-TICKET] - Cursor improvements
2 parents a877e9c + 9b958aa commit 05aa8c0

27 files changed

+1105
-97
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use Amplify CLI for easy setup and configuration
7+
- Implement proper authentication flows with Amplify Auth
8+
- Utilize Amplify DataStore for offline capabilities
9+
- Optimize API calls with Amplify's GraphQL client
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use interceptors for global request/response handling
7+
- Implement proper error handling and status code checks
8+
- Utilize Axios' cancel token for aborting requests
9+
- Set up default configurations for common headers and base URL
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use Capacitor plugins for native functionality
7+
- Implement proper lifecycle management for mobile apps
8+
- Optimize app size by selectively including plugins
9+
- Use Capacitor's storage API for local data persistence
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use Formik's built-in validation for form handling
7+
- Implement custom validation with Yup for complex schemas
8+
- Utilize the useFormik hook for more control over form state
9+
- Leverage Formik's error handling for user feedback

.cursor/rules/general.mdc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: Follow this rules for every request
2+
description:
33
globs:
4-
alwaysApply: false
4+
alwaysApply: true
55
---
6-
76
- Project Proposal Overview: This project proposes an AI-powered medical report translator that simplifies complex medical documents for patients and caregivers. By leveraging AI-driven text extraction and natural language processing (NLP), the system translates medical jargon into plain language, helping users understand their health conditions, diagnoses, and test results without relying on unreliable online searches.
87

98
- Why are we doing this? Patients often receive medical reports full of complex terminology, abbreviations, and technical language that they don’t understand, causing confusion, stress, and potential misinterpretation of their health conditions. Many resort to Google searches or unreliable forums to decipher their reports, leading to misinformation and anxiety. By automating medical report simplification, we help patients take control of their healthcare, make informed decisions, and reduce the dependency on doctors for basic explanations.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx,*.scss
4+
alwaysApply: false
5+
---
6+
- Use Ionic components for a consistent UI across platforms
7+
- Leverage Ionic's navigation system for routing
8+
- Optimize performance with lazy loading of pages
9+
- Use Ionic's theming system for easy customization
10+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use functional components with hooks instead of class components
7+
- Implement proper state management (e.g., Context API, Redux)
8+
- Utilize memoization techniques (useMemo, useCallback) for performance
9+
- Follow React's one-way data flow principle
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use declarative routing with Route components
7+
- Implement nested routes for better organization
8+
- Utilize the useParams hook for dynamic routing
9+
- Use the useHistory hook for programmatic navigation
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description:
3+
globs: *.ts,*.tsx
4+
alwaysApply: false
5+
---
6+
- Use strict null checks
7+
- Prefer interface over type when possible
8+
- Utilize type guards and assertions for runtime type checking
9+
- Implement proper type inference to reduce explicit type annotations
10+
- Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.

.cursorrules

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Cursor Rules
2+
3+
## Always Use i18n for Text in React Files
4+
5+
Always use the internationalization (i18n) system for any text displayed to users in React components.
6+
7+
```typescript
8+
// ❌ AVOID hardcoded text
9+
<label>Email</label>
10+
<span>Don't have an account?</span>
11+
<button>Log in</button>
12+
13+
// ✅ PREFERRED - Use t() function from react-i18next
14+
<label>{t('label.email', { ns: 'auth' })}</label>
15+
<span>{t('no-account', { ns: 'auth' })}</span>
16+
<button>{t('signin', { ns: 'auth' })}</button>
17+
```
18+
19+
### Translation Key Guidelines:
20+
- Use namespaces to organize translations (e.g., { ns: 'auth' })
21+
- Use hierarchical keys with dots for organization (e.g., 'label.email')
22+
- Ensure all keys are defined in the appropriate translation files
23+
24+
### Common Namespaces:
25+
- 'common' - app-wide common labels and messages
26+
- 'auth' - authentication related texts
27+
- 'errors' - error messages
28+
- 'validation' - form validation messages
29+
30+
This rule ensures our application supports multiple languages and facilitates future translations.

0 commit comments

Comments
 (0)