Welcome to the Upcheck project! This document will help you understand the structure, conventions, and workflows of the codebase so you can quickly become a productive contributor.
Upcheck is a React Native (Expo) app for Indian shrimp farmers, providing real-time monitoring, analytics, and community features. It uses a freemium model and supports multiple languages.
- React Native (Expo)
- React Navigation (via
expo-router) - AsyncStorage for local persistence
- REST API backend (
upcheck-server.onrender.com) - i18n for localization
- CryptoJS for hashing
- react-native-vector-icons for icons
- react-native-magnus, react-native-paper for UI components
app/
├── addpond/ # Add pond form
├── email_verif/ # Email verification flow
├── farm/ # Farm details (dynamic route)
├── forgotpassword/ # Password reset
├── home/ # Dashboard/home screen
├── login/ # Login screen
├── pondform/ # Pond details form
├── ponds/ # Pond listing and grouping
├── profile/ # User profile
├── profileform/ # Profile setup form
├── signup/ # Signup screen
├── (tabs)/ # Tabbed navigation (profile, settings, inventory, social)
└── TestScreen/ # Test screens
assets/
└── images/ # App images and icons
components/ # Shared React components
src/
├── i18n.js # i18n initialization
└── locales/ # Translation files
scripts/ # Utility scripts (e.g., reset-project.js)
- Signup:
/signup→/email_verif→/profileform→/pondform - Login:
/login→/home(dashboard) - Profile:
/profile(view/edit),/profileform(edit details) - Pond Management:
/pondform(add),/ponds(list/group),/farm/[farmId](farm details) - Inventory:
/inventory(manage feed) - Settings:
/settings(language, storage, logout) - Social:
/social(community features)
-
Clone the repo:
git clone <repo-url> && cd upcheck -
Install dependencies:
npm install -
Start Expo:
npx expo start -
Run on device/emulator:
Use Expo Go app or Android/iOS emulator.
- Functional Components with React Hooks
- Async/Await for async logic
- Consistent Naming:
- Components:
PascalCase - Variables/Functions:
camelCase
- Components:
- Styles:
- Use
StyleSheet.createin each file - Keep styles at the bottom of the file
- Use
-
API Calls:
Usefetchwith async/await. Handle errors and show user feedback viaAlert. -
AsyncStorage:
Used for persisting user/session data. Always check for null/undefined before using. -
Navigation:
UseuseRouterfromexpo-routerfor navigation.
Example:router.replace('/profile') -
Modals:
UseModalfromreact-nativefor popups (e.g., language selection, profile picture). -
Forms:
Validate inputs before submitting. UseAlertfor error messages.
- Manual Testing:
Use Expo Go or emulator for UI/UX and flow testing. - Automated Testing:
(Add instructions here if you have Jest or Detox tests.)
- i18n:
- Configured in
src/i18n.js - Translation files in
src/locales/ - Language can be changed in the Settings tab.
- Configured in
- Base URL:
https://upcheck-server.onrender.com/api/ - Endpoints:
- Auth:
/v2/auth/register,/v1/auth/verify-email,/v1/auth/verify-code - User:
/users/email/:email,/users/:userId - Ponds:
/ponds - Mailing:
/v1/mailing/welcome
- Auth:
- Token Generation:
Uses SHA-256 hash of user info for registration.
-
Keys:
userDetails: User profile/session infouserId: User's unique IDponds: Pond data (object keyed by pond ID)farms: Farm data (array)language: Selected language
-
Best Practices:
- Always check for existence before reading.
- Update after any profile/pond/farm change.
- expo-router is used for navigation.
- Dynamic routes:
/farm/[farmId].jsfor farm details
- Tabs:
- Defined in
/app/(tabs)/_layout.tsx
- Defined in
-
New Screen:
- Create a new folder/file in
app/ - Add to navigation if needed (tabs or stack)
- Follow code style and patterns
- Create a new folder/file in
-
New API Call:
- Use
fetchwith async/await - Handle errors and loading state
- Update AsyncStorage if needed
- Use
-
New Language:
- Add a JSON file in
src/locales/ - Update language selection in Settings
- Add a JSON file in
- Metro Bundler issues:
npx expo start -cto clear cache - Android/iOS build issues:
Check for missing dependencies or runnpm install - API errors:
Check server logs and endpoint URLs
- Branching:
- Create a new branch from
mainfor each feature, bugfix, or improvement. - Use descriptive branch names, e.g.,
feature/add-language-support,bugfix/login-crash.
- Create a new branch from
- Pull Requests:
- Ensure your branch is up to date with
mainbefore opening a PR. - Submit a pull request to the
mainbranch. - Provide a clear, concise description of your changes and reference related issues if applicable.
- Include screenshots or screen recordings for UI changes.
- Ensure your code passes all tests and lint checks.
- Ensure your branch is up to date with
- Code Reviews:
- Address all review comments and suggestions.
- Add comments for complex logic or decisions.
- Issues:
- Use GitHub Issues for bugs, feature requests, or questions.
- Reference issues in your PRs using
Fixes #issue_numberorCloses #issue_number.
- Email: care@upcheck.in
- Website: www.upcheck.in
- Instagram: @UpCheckIndia
- LinkedIn: UpCheck India
Happy coding! 🚀