3.1 KiB
3.1 KiB
Agent Instructions for Meat Farmer Monorepo
Important instructions
- Don't run any drizzle migrations. User will handle it.
- don't try to run any test from the suite unless user explicitly asks for
Code Style Guidelines
TypeScript & React Native
- Strict TypeScript:
strict: trueenabled in tsconfig - Path aliases: Use
@/*for local imports,common-uifor shared UI package - Component naming: PascalCase (e.g.,
MyButton,ImageCarousel) - Function naming: camelCase (e.g.,
handleSubmit,getCurrentUserId) - Interface naming: PascalCase with
Propssuffix (e.g.,ButtonProps)
don't import Text,TextInput,TouchableOpacity and other such primitive components directly from react-native. They are available in the common-ui as MyText, MyTextInput, MyTouchableOpacity etc.
Imports
- React imports first
- Third-party libraries second
- Local imports last
- Use absolute imports with path aliases when possible
- imports from /packages/ui are aliased as
common-uiin apps/user-ui and apps/admin-ui - For backend, use
@/*to import from the backend root directory (e.g.,@/src/lib/file-name)
Error Handling
- API errors handled via axios interceptors
- Use
DeviceEventEmitterfor cross-component communication - Throw custom errors with descriptive messages
- Avoid try-catch blocks unless necessary
Formatting & Linting
- ESLint with Expo config
- No Prettier configured - follow consistent indentation (2 spaces)
- No semicolons at end of statements
- Single quotes for strings
Testing
- No test framework currently configured
- When adding tests, use Jest + React Native Testing Library
- Test files:
*.test.tsxor*.spec.tsx - Even when explicitly asked for, don't test push notifications or anything related to OTP
Architecture
- Monorepo with Turbo
- Shared UI components in
packages/ui - Apps:
user-ui,admin-ui,inspiration-ui,inspiration-backend - Database: Drizzle ORM with PostgreSQL
Important Notes
- Don't do anything with git unless the user explicitly asks for. Don't do git add or git commit. That will be managed entirely by the user.
Change Log
- there should be a change log file. unless explicitly specified, assume change-log.txt as the name of the log file. Ensure the file exists. If it doesn't exist create it. Before changing any file which is not a md file or txt file write the change to that file exactly. Write the diff to it and then start making changes. for every change add the current time stamp.
before editing
- there are proper tests for code. While changing code, also scope what changes are needed in the tests. Tests and code should go hand in hand. One shouldn't be left behind while one is going forward. Most of the Projects have a test directory.
mirror projects
- admin-ui is a react native app. It has a web counterpart admin-web. user-ui is also react native app. It's web counterpart is web-ui. Any changes you do in the react native should have exactly same changes in their web counterparts too.
relevant projects
- the db_helper_postgres is an abandoned project. Don't make any changes there or don't report any errors from there.