Skip to content

MujtabaAzizKhan/comercio-p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Comercio

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.


Table of Contents


Overview

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.


Features

  • πŸ” 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

Tech Stack

Mobile (Frontend)

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

Backend

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

Project Structure

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

Prerequisites

  • 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)

Getting Started

Backend Setup

cd backend
npm install

Create a .env file inside the backend/ directory (see Environment Variables), then start the server:

npm start
# Server runs on http://localhost:8000 by default

Mobile App Setup

From the project root, install dependencies:

# using npm
npm install

# OR using Yarn
yarn install

iOS β€” install CocoaPods

cd ios && pod install && cd ..

Start Metro bundler

yarn start
# OR
npm start

Run on Android

yarn android
# OR
npm run android

Run on iOS

yarn ios
# OR
npm run ios

Environment Variables

Create 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 .env file or any credentials to version control.


Available Scripts

Mobile App (root directory)

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

Backend (backend/ directory)

Script Description
npm start Start the server with nodemon (auto-restart on changes)

API Reference

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

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m "feat: add your feature"
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Please follow the existing code style enforced by ESLint and Prettier (.eslintrc.js / .prettierrc.js).


License

This project is private and not licensed for public distribution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages