A complete e-commerce mobile application built with React Native, featuring user authentication, product management, shopping cart, and order management.
- Authentication: Login/Register with role-based access (User/Admin)
- Product Browsing: View products with search and category filtering
- Product Details: Detailed product information with image gallery
- Shopping Cart: Add/remove items, quantity management
- Checkout: Order placement with shipping information
- Order History: Track order status and view past orders
- Profile Management: View and manage user profile
- Dashboard: Overview of orders, revenue, and product statistics
- Product Management: Add, edit, delete products with stock management
- Order Management: View and update order status
- Analytics: Revenue tracking and order insights
- Data Persistence: All data stored locally using AsyncStorage
- Offline Support: App works without internet connection
- Role-based Navigation: Different interfaces for users and admins
- Modern UI: Clean, responsive design with React Native Paper
- TypeScript: Full type safety throughout the application
- Node.js (>= 16)
- React Native CLI
- Android Studio (for Android development)
- Xcode (for iOS development, macOS only)
-
Clone the repository
git clone <repository-url> cd react-native-e-commerce
-
Install dependencies
npm install
-
Install iOS dependencies (macOS only)
cd ios && pod install && cd ..
-
Start Metro bundler
npm start
-
Run the app
# For Android npm run android # For iOS npm run ios
The app comes with pre-configured demo accounts:
- Email: admin@example.com
- Password: admin123
- Role: Administrator
- Email: user@example.com
- Password: user123
- Role: Customer
src/
├── contexts/ # React Context providers
│ ├── AuthContext.tsx
│ └── CartContext.tsx
├── navigation/ # Navigation configuration
│ ├── AuthNavigator.tsx
│ └── AppNavigator.tsx
├── screens/ # Screen components
│ ├── auth/ # Authentication screens
│ ├── user/ # User screens
│ └── admin/ # Admin screens
├── services/ # Business logic and data services
│ ├── storage.ts
│ ├── productService.ts
│ └── orderService.ts
└── types/ # TypeScript type definitions
└── index.ts
- React Native: Mobile app framework
- TypeScript: Type safety and better development experience
- React Navigation: Navigation library
- React Native Paper: Material Design components
- AsyncStorage: Local data persistence
- React Context: State management
All data is stored locally using AsyncStorage:
- Users: User accounts and authentication data
- Products: Product catalog with images, prices, and stock
- Orders: Order history and status tracking
- Cart: Shopping cart items (per session)
- Update the
Product
type insrc/types/index.ts
- Add categories in the product management screens
- Update filtering logic in product screens
- Update the theme in
App.tsx
- Customize colors in individual screen styles
- Modify React Native Paper theme configuration
- Update the
Order
type insrc/types/index.ts
- Add new status options in order management screens
- Update status color mapping functions
- The app initializes with default data on first launch
- All CRUD operations are performed locally
- Data persists between app restarts
- No backend server required for basic functionality
-
Metro bundler issues
npx react-native start --reset-cache
-
iOS build issues
cd ios && pod install && cd ..
-
Android build issues
cd android && ./gradlew clean && cd ..
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.