A cross-platform React Native application for managing inventory using QR codes. Create containers, add items, generate QR codes, and track transfers seamlessly across iOS and Android.
- 📱 Cross-platform: Works on both iOS and Android
- 📦 Container Management: Create and organize containers
- 📋 Item Tracking: Add, edit, and remove items with quantities
- 📱 QR Code Generation: Generate printable QR codes for each container
- 📷 QR Code Scanning: Instantly access containers by scanning QR codes
- 📤 Transfer Tracking: Track when items are given to others
- 📊 Transaction History: Complete audit trail of all changes
- 💾 Offline Storage: All data stored locally using AsyncStorage
qr-inventory-app/
├── App.tsx # Main app component with navigation
├── package.json # Dependencies and scripts
├── app.json # Expo configuration
├── tsconfig.json # TypeScript configuration
├── babel.config.js # Babel configuration
├── metro.config.js # Metro bundler configuration
├── types/
│ └── index.ts # TypeScript type definitions
├── services/
│ ├── StorageService.ts # Data persistence and management
│ └── QRService.ts # QR code generation and parsing
└── screens/
├── ContainersScreen.tsx # Main containers list
├── ContainerDetailScreen.tsx # Individual container view
├── CreateContainerScreen.tsx # Create new container
├── EditContainerScreen.tsx # Edit existing container
├── AddItemScreen.tsx # Add item to container
├── EditItemScreen.tsx # Edit existing item
├── QRScannerScreen.tsx # QR code scanner
├── PrintQRScreen.tsx # QR code display and printing
├── TransactionHistoryScreen.tsx # Container transaction history
├── HistoryScreen.tsx # Global activity history
└── SettingsScreen.tsx # App settings
-
Prerequisites:
- Node.js (v16 or later)
- npm or yarn
- Expo CLI (
npm install -g @expo/cli) - For iOS development: Xcode
- For Android development: Android Studio
-
Clone and setup:
git clone https://github.com/Mr615-TN/QR_CODE_APP.git cd QR_CODE_APP # Install dependencies npm install
-
Install additional required packages:
npx expo install expo-camera expo-barcode-scanner npx expo install react-native-qrcode-svg react-native-svg npx expo install expo-print expo-sharing expo-file-system npx expo install @react-native-async-storage/async-storage
npx expo start# iOS Simulator
npx expo start --ios
# Android Emulator
npx expo start --android
# Web browser
npx expo start --web# iOS
npx expo build:ios
# Android
npx expo build:android-
Create Your First Container:
- Tap "New Container" on the home screen
- Enter a descriptive name (e.g., "Kitchen Pantry", "Tool Shed")
- Add an optional description
- Tap "Create Container"
-
Add Items:
- Open a container
- Tap "+ Add Item"
- Enter item name, description, and quantity
- Tap "Add Item"
-
Generate QR Code:
- In container view, tap "QR Code"
- Print or share the QR code
- Attach the printed QR code to your physical container
- Generate: Each container gets a unique QR code
- Print: Print QR codes and attach to physical containers
- Scan: Use the Scanner tab to quickly access any container
- Manage: Instantly view and edit container contents
- Add Items: Track name, description, and quantity
- Edit Items: Update any item details or quantities
- Transfer Items: Record when giving items to others
- Remove Items: Delete items completely
- Automatic Tracking: Every change is automatically logged
- Detailed Records: See who received transferred items
- Complete Audit: Full history of all container activities
- Local Storage: All data stored on your device
- No Internet Required: Works completely offline
- Export Options: Share QR codes as PDFs
- Data Safety: Clear all data option in settings
-
StorageService: Handles all data persistence using AsyncStorage
- Container CRUD operations
- Item management within containers
- Transaction logging
- Data validation and error handling
-
QRService: Manages QR code functionality
- QR data generation and parsing
- Printable HTML generation
- PDF creation for sharing
- Data validation
-
Navigation: Stack and tab-based navigation
- Bottom tabs for main sections
- Stack navigation for detailed views
- Deep linking support for QR scanning
// Container: Main organizational unit
Container {
id: string;
name: string;
description?: string;
items: Item[];
createdDate: string;
lastModified: string;
qrCodeData?: string;
}
// Item: Individual inventory items
Item {
id: string;
name: string;
quantity: number;
description?: string;
addedDate: string;
lastModified: string;
}
// Transaction: Activity tracking
Transaction {
id: string;
containerId: string;
itemId: string;
type: 'add' | 'remove' | 'update' | 'transfer';
quantity: number;
recipientName?: string;
recipientContact?: string;
notes?: string;
timestamp: string;
}- React Native: Cross-platform mobile development
- TypeScript: Type safety and better development experience
- Expo: Simplified React Native development and deployment
- React Navigation: Navigation library for React Native
- AsyncStorage: Local data persistence
- Expo Camera/Barcode Scanner: QR code scanning
- React Native QRCode SVG: QR code generation
- Modular Architecture: Separate concerns with services and screens
- Type Safety: Full TypeScript implementation
- Offline First: No internet dependency
- User Experience: Intuitive interface with clear feedback
- Data Integrity: Comprehensive validation and error handling
- Lazy Loading: Screens load data only when needed
- Efficient Rendering: FlatList for large item collections
- Memory Management: Proper cleanup and state management
- Storage Optimization: JSON-based local storage with compression
- New Screen: Create in
screens/directory - Update Navigation: Add routes in
App.tsx - Update Types: Add interfaces in
types/index.ts - Service Methods: Add to appropriate service class
- All styles use StyleSheet for performance
- Consistent color scheme with CSS variables
- Responsive design for different screen sizes
- Platform-specific adaptations where needed
- app.json: Expo and build configuration
- tsconfig.json: TypeScript compiler settings
- babel.config.js: JavaScript transpilation
- metro.config.js: Metro bundler configuration
-
Camera Permission Denied:
- Check device settings
- Restart the app
- Reinstall if necessary
-
QR Code Not Scanning:
- Ensure good lighting
- Hold camera steady
- Check QR code isn't damaged
-
Data Not Persisting:
- Check AsyncStorage permissions
- Verify device storage space
- Try clearing app data and starting fresh
-
Build Errors:
- Clear node_modules and reinstall
- Check Expo CLI version
- Verify all dependencies are installed
Enable debug logging by setting __DEV__ flag:
if (__DEV__) {
console.log('Debug info:', data);
}- Use TypeScript for all new code
- Follow React Native best practices
- Add proper error handling
- Include JSDoc comments for public methods
- Write tests for critical functionality
- Fork the repository
- Create a feature branch
- Make changes with proper testing
- Update documentation
- Submit pull request with detailed description
MIT License - Feel free to use this code for personal or commercial projects.
For issues, questions, or contributions:
- Check existing documentation
- Search closed issues
- Create new issue with detailed description
- Include device info and error logs