Skip to content

Commit 56e6938

Browse files
committed
Merge branch 'main' of github.com:ModusCreateOrg/app-med-ai-gen into ADE-150-API-configuration
2 parents 31d8bb5 + f3cec95 commit 56e6938

File tree

70 files changed

+6498
-851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6498
-851
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: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
description: Follow this rules for every request
2+
description:
33
globs:
4+
alwaysApply: true
45
---
5-
66
- 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.
77

88
- 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.
@@ -67,7 +67,10 @@ Technologies:
6767
[5 - Results analysis.png](mdc:docs/assets/images/5 - Results analysis.png)
6868
[6 - Results Archive.png](mdc:docs/assets/images/6 - Results Archive.png)
6969
[7 - Detail.png](mdc:docs/assets/images/7 - Detail.png)
70-
70+
[Upload_default.png](mdc:docs/assets/images/Upload_default.png)
71+
[Upload_success.png](mdc:docs/assets/images/Upload_success.png)
72+
[Uploading.png](mdc:docs/assets/images/Uploading.png)
73+
[Uploading_complete.png](mdc:docs/assets/images/Uploading_complete.png)
7174

7275
AWS architecture: [aws architecture.pdf](mdc:docs/assets/aws architecture.pdf)
7376

@@ -121,10 +124,37 @@ AWS architecture: [aws architecture.pdf](mdc:docs/assets/aws architecture.pdf)
121124
```
122125
```
123126

127+
# General Code Guidelines
128+
129+
## Category Determination Pattern
130+
When determining categories based on keywords in filenames or text:
131+
132+
1. Define a constant mapping object at module level that maps categories to their identifying keywords
133+
2. Use TypeScript's Record type to ensure type safety
134+
3. Convert input to lowercase once at the start
135+
4. Use Array methods like `find` and `some` for clean keyword matching
136+
5. Provide a default/fallback category
137+
6. Include JSDoc with clear parameter and return descriptions
138+
139+
Example:
140+
```typescript
141+
const CATEGORY_KEYWORDS: Record<Category, string[]> = {
142+
[Category.TYPE_A]: ['keyword1', 'keyword2'],
143+
[Category.TYPE_B]: ['keyword3', 'keyword4'],
144+
[Category.DEFAULT]: []
145+
};
146+
147+
const determineCategory = (input: string): Category => {
148+
const lowerInput = input.toLowerCase();
149+
const matchedCategory = Object.entries(CATEGORY_KEYWORDS)
150+
.find(([_, keywords]) => keywords.some(k => lowerInput.includes(k)));
151+
return matchedCategory ? (matchedCategory[0] as Category) : Category.DEFAULT;
152+
};
153+
```
154+
124155
# Typescript rules
125156

126157
- Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
127158

128159
This rule provides clear guidelines on what units to use, how to convert between units, and why it's important for your project. You can add this to your general rules to ensure consistency across the codebase.
129160

130-
Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
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)