Skip to content

Latest commit

 

History

History
306 lines (245 loc) · 7.89 KB

File metadata and controls

306 lines (245 loc) · 7.89 KB

Niche Marketplace Builder - Mobile App

A comprehensive React Native mobile application for the Niche Marketplace Builder platform. This app allows customers to shop, vendors to manage their stores, and admins to manage the platform.

🚀 Project Structure

nichexismarket/
├── src/
│   ├── types/
│   │   └── index.ts                 # TypeScript type definitions
│   ├── services/
│   │   └── api.ts                   # API client with axios
│   ├── store/
│   │   ├── slices/
│   │   │   ├── authSlice.ts         # Authentication state
│   │   │   ├── productSlice.ts      # Products state
│   │   │   └── cartSlice.ts         # Shopping cart state
│   │   └── index.ts                 # Redux store configuration
│   ├── screens/
│   │   ├── auth/
│   │   │   ├── LoginScreen.tsx
│   │   │   └── SignupScreen.tsx
│   │   ├── customer/
│   │   │   ├── HomeScreen.tsx
│   │   │   └── ProfileScreen.tsx
│   │   ├── vendor/
│   │   │   └── DashboardScreen.tsx
│   │   └── admin/
│   │       └── DashboardScreen.tsx
│   ├── components/
│   │   └── common/
│   │       └── Button.tsx            # Reusable UI components
│   ├── navigation/
│   │   └── RootNavigator.tsx         # Navigation configuration
│   └── utils/
│       └── helpers.ts                # Utility functions
├── App.tsx                           # Main app component
└── package.json

📦 Installed Dependencies

Core

  • react-native@0.83.0 - React Native framework
  • react@19.2.0 - React library

Navigation

  • @react-navigation/native - Navigation library
  • @react-navigation/stack - Stack navigation
  • @react-navigation/bottom-tabs - Tab navigation
  • react-native-screens - Native screen management
  • react-native-safe-area-context - Safe area handling

State Management & API

  • @reduxjs/toolkit - Redux state management
  • react-redux - React bindings for Redux
  • axios - HTTP client

Storage

  • @react-native-async-storage/async-storage - Local storage

Forms & UI

  • formik - Form state management
  • yup - Form validation
  • react-native-vector-icons - Icon library
  • react-native-toast-message - Toast notifications

🔧 Setup Instructions

1. Install Dependencies

npm install

2. Configure API Base URL

Edit src/services/api.ts and update API_BASE_URL:

const API_BASE_URL = 'https://your-api-endpoint.com/v1';

3. Run the App

Android:

npm run android

iOS:

npm run ios

📱 Features Implemented

Authentication

  • ✅ User login with email/password
  • ✅ User signup with role selection (Customer/Vendor/Admin)
  • ✅ Session persistence using AsyncStorage
  • ✅ Automatic token refresh handling
  • ✅ Role-based navigation

Customer App

  • ✅ Home screen with product browsing
  • ✅ Product listing with pagination
  • ✅ User profile screen
  • ✅ Tab-based navigation (Home, Cart, Profile)
  • ✅ Logout functionality

Vendor Dashboard

  • ✅ Dashboard with sales statistics
  • ✅ Quick action menu for store management
  • ✅ Tab-based navigation for vendors
  • ✅ Store metrics display

Admin Dashboard

  • ✅ Platform overview with key metrics
  • ✅ Admin management tools
  • ✅ Vendor and user management access
  • ✅ Tab-based admin navigation

State Management

  • ✅ Redux store with authentication slice
  • ✅ Product management slice
  • ✅ Cart management slice
  • ✅ Async thunks for API calls

📋 Features to Implement

Customer Features

  • Product detail page with images and variations
  • Shopping cart management
  • Checkout flow with payment integration
  • Order history and tracking
  • Wishlist functionality
  • Product reviews and ratings
  • Address management
  • Search and filtering
  • Store browsing

Vendor Features

  • Store setup wizard
  • Product management (CRUD)
  • Bulk product upload via CSV
  • Inventory management
  • Order management and fulfillment
  • Sales analytics and reports
  • Subscription management
  • Store customization
  • Customer communication

Admin Features

  • Vendor approval workflow
  • Vendor suspension/management
  • Platform analytics
  • Subscription management
  • Category management
  • Theme management
  • Payment settlement
  • Support ticket management

Payment Integration

  • Stripe integration
  • PayPal integration
  • Paystack integration
  • Flutterwave integration
  • Apple Pay
  • Google Pay

Advanced Features

  • AI-powered product descriptions
  • SEO optimization tools
  • Notifications (email, SMS, push)
  • Real-time order updates
  • Advanced analytics
  • Fraud detection
  • Multi-language support

🔐 Authentication Flow

  1. User opens app
  2. App checks AsyncStorage for existing token
  3. If token exists, user is logged in and navigated to appropriate dashboard
  4. If no token, user sees Auth screens (Login/Signup)
  5. On login/signup, token is stored and user is navigated based on role

🌐 API Integration

The API client in src/services/api.ts provides methods for:

Auth Endpoints

  • login(email, password)
  • signup(data)
  • logout()

Products

  • getProducts(storeId, page, limit, filters)
  • getProductById(productId)
  • createProduct(data)
  • updateProduct(productId, data)
  • deleteProduct(productId)

Orders

  • getOrders(page, limit)
  • getOrderById(orderId)
  • createOrder(data)
  • updateOrderStatus(orderId, status)

Cart

  • getCart()
  • addToCart(productId, quantity)
  • updateCartItem(productId, quantity)
  • removeFromCart(productId)

Stores

  • getStore(storeId)
  • createStore(data)
  • updateStore(storeId, data)

Reviews

  • getProductReviews(productId, page)
  • createReview(productId, data)

Analytics

  • getVendorAnalytics(storeId, period)
  • getAdminDashboard()

📝 Type Definitions

All types are defined in src/types/index.ts:

  • User - User account information
  • Product - Product details
  • Order - Order information
  • Cart - Shopping cart
  • VendorStore - Vendor store details
  • Review - Product review
  • Subscription - Vendor subscription
  • Notification - In-app notification

🎨 UI Components

Common Components (src/components/common/Button.tsx)

  • PrimaryButton - Main call-to-action button
  • SecondaryButton - Secondary action button
  • TextInput - Custom input field
  • ErrorMessage - Error display component

🧪 Testing

npm run test

🔍 Linting

npm run lint

📤 Building

Android:

cd android && ./gradlew assembleRelease

iOS:

cd ios && xcodebuild -workspace nichexismarket.xcworkspace -scheme nichexismarket -configuration Release

🚀 Deployment

Follow React Native official documentation for:

📚 Next Steps

  1. Setup Backend API - Create/configure your backend server
  2. Implement Missing Screens - Add remaining screens for each user role
  3. Add Payment Integration - Integrate payment gateways
  4. Setup Notifications - Configure push/email/SMS
  5. Deploy - Build and submit to app stores

🤝 Contributing

  1. Create feature branches from main
  2. Follow the existing code structure
  3. Write tests for new features
  4. Submit pull requests with descriptions

📞 Support

For issues or questions, please refer to:

📄 License

This project is part of the Niche Marketplace Builder platform.


Happy Coding! 🎉