A full-stack mobile commerce platform built with React Native and Node.js/Express, enabling producers and retailers to connect, manage inventory, process orders, and transact seamlessly β all from a single mobile app.
- Overview
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Getting Started
- Environment Variables
- Available Scripts
- API Reference
- Contributing
- License
Comercio is a B2B/B2C mobile commerce application that bridges producers and retailers. It provides tools for inventory management, product listings with barcode support, AI-powered chatbot assistance, Stripe-integrated payments, order tracking, returns and refunds, and much more.
- π Authentication β Secure sign-up / sign-in with email OTP verification and encrypted local storage
- π€ Dual User Roles β Separate flows for Producers and Retailers/Distributors
- π¦ Inventory Management β Add, update, and categorize products manually, via image, or by scanning barcodes (camera-powered)
- π Cart & Checkout β Full shopping cart with Stripe payment integration and pay-on-pickup option
- π Sales & Purchase History β Detailed buying and selling records with receipt tracking
- π€ Partner Network β Send/accept connection requests, browse partner profiles, and manage distributor relationships
- π Barcode Generation β Generate and share product barcodes natively on-device
- π€ AI Chatbot β DialogFlow-powered virtual assistant for customer support
- β Reviews β Leave and manage product and producer reviews
- π Returns & Refunds β Initiate and track return requests
- π Notifications β In-app connection and order notifications
- π· Image Uploads β Product photos via camera or gallery, stored on Cloudinary
- π§ Email Support β Contact support directly from the app via nodemailer
| Technology | Purpose |
|---|---|
| React Native 0.71 | Cross-platform mobile framework |
| React Navigation 6 | Stack, bottom tabs, and drawer navigation |
| Stripe React Native | Payment processing |
| Axios | HTTP client |
| Formik + Yup | Form management and validation |
| React Native Vision Camera | Barcode scanning |
| Cloudinary React Native | Image upload and management |
| React Native Encrypted Storage | Secure token storage |
| React Native Paper / RNEUI | UI component libraries |
| DialogFlow | AI chatbot integration |
| Technology | Purpose |
|---|---|
| Node.js + Express | REST API server |
| MongoDB + Mongoose | Database and ODM |
| JSON Web Tokens (JWT) | Authentication |
| Bcrypt | Password hashing |
| Stripe | Payment processing |
| Nodemailer | Transactional email |
| Multer | File upload handling |
| Mindee | Receipt / document OCR |
| Google Dialogflow | Chatbot integration |
| express-validator | Request validation |
comercio-p/
βββ App.js # Root app component & navigation stack
βββ app/
β βββ api/ # Axios client configuration
β βββ components/ # Reusable UI components
β βββ pages/ # Screen components
β βββ utils/ # Helpers (auth, notifications, etc.)
βββ assets/ # Static assets (fonts, images)
βββ backend/
β βββ app.js # Express server entry point
β βββ controllers/ # Route handler logic
β βββ db/ # MongoDB connection
β βββ middleware/ # Auth and validation middleware
β βββ model/ # Mongoose data models
β βββ routes/ # API route definitions
β βββ utils/ # Server-side helpers
βββ android/ # Android native project
βββ ios/ # iOS native project
βββ __tests__/ # Jest test suites
- Node.js β₯ 16
- Yarn or npm
- React Native CLI environment configured β see the official setup guide
- Android Studio (for Android) or Xcode (for iOS)
- MongoDB instance (local or Atlas)
- Stripe account (for payments)
- Cloudinary account (for image uploads)
- Google Cloud project with Dialogflow enabled (for chatbot)
cd backend
npm installCreate a .env file inside the backend/ directory (see Environment Variables), then start the server:
npm start
# Server runs on http://localhost:8000 by defaultFrom the project root, install dependencies:
# using npm
npm install
# OR using Yarn
yarn installcd ios && pod install && cd ..yarn start
# OR
npm startyarn android
# OR
npm run androidyarn ios
# OR
npm run iosCreate a .env file in the backend/ directory with the following keys:
PORT=8000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
EMAIL_USER=your_email_address
EMAIL_PASS=your_email_password
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
GOOGLE_APPLICATION_CREDENTIALS=path_to_dialogflow_credentials.json
β οΈ Never commit your.envfile or any credentials to version control.
| Script | Description |
|---|---|
yarn start |
Start the Metro bundler |
yarn android |
Build and run on Android |
yarn ios |
Build and run on iOS |
yarn test |
Run Jest tests |
yarn lint |
Run ESLint |
| Script | Description |
|---|---|
npm start |
Start the server with nodemon (auto-restart on changes) |
All API routes are prefixed with /api. The following resource endpoints are available:
| Route | Description |
|---|---|
/api/user |
Registration, login, OTP verification, profile management |
/api/product |
Create, read, update, delete products |
/api/category |
Product category management |
/api/cart |
Shopping cart operations |
/api/payment |
Stripe payment intent creation |
/api/partner |
Partner connection requests and management |
/api/history |
Buying history and receipts |
/api/sellingHistory |
Selling history and receipts |
/api/productReview |
Product reviews |
/api/producerReview |
Producer reviews |
/api/dialogFlow |
Chatbot query handling |
/api/refund |
Return and refund requests |
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m "feat: add your feature" - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
Please follow the existing code style enforced by ESLint and Prettier (.eslintrc.js / .prettierrc.js).
This project is private and not licensed for public distribution.