Giter VIP home page Giter VIP logo

seller-app-sdk's Introduction

User Manual

A detailed user manual for the seller reference app is available here.

Introduction

This repo is ONDC Seller App with micro-service architecture which contains

For whom

  • Who wants to refer the seller app.
  • Who wants the same setup to be available in their infra.
  • You can pick any component of it and use separately.

Usage

  1. Make sure you've pulled all sub-directories .
   git submodule init
   git submodule update
  1. Firebase Authentication.
    • Create the application under firebase console.
    • Once the application is created, visit the application and click on authentication tab.
    • Enable the following sign methods in the authentication sign-in method tab.
    • In project settings create different projects supported for various platforms like Android, iOS and web, (this will help in downloading the config files, required for authentication)
    REACT_APP_FIREBASE_API_KEY=”API_KEY”
    REACT_APP_FIREBASE_AUTH_DOMAIN=”www.example.com”
  1. SMTP Requirement

Our seller application requires SMTP configuration to send notification emails either for login one time password, or to recieve welcome emails.

  SMTP_HOST=<SMTP_HOST>
  SMTP_PORT=<SMTP_PORT>
  SMTP_AUTH_USERNAME=<SMTP_AUTH_USERNAME>
  SMTP_AUTH_PASSWORD=<SMTP_AUTH_PASSWORD>
  SMTP_EMAIL_SENDER=<SMTP_EMAIL_SENDER>
  1. S3 Requirement

Our seller application requires S3 configuration as per our implementation to store the assets which we need for application logics.

  AWS_ACCESS_KEY_ID=<AWS_S3_ACCESS_KEY>
  AWS_SECRET_ACCESS_KEY=<AWS_S3_ACCESS_KEY>
  S3_VERSION=<S3_VERSION>
  S3_REGION=<S3_REGION>
  S3_BUCKET=<S3_BUCKET>
  1. Map My India (MMI)

For location based information, integration with MMI has been used. MMI has been used as follows - Get detailed address information by typing in search query Get list of addresses for a given PIN code Get state and city by PIN code Get Latitude and longitude of the provided address

MMI API that have been used are as follows - https://outpost.mapmyindia.com/api https://atlas.mapmyindia.com/api/places/search/json https://explore.mappls.com https://apis.mapmyindia.com/advancedmaps/v1 https://atlas.mappls.com/api/places/geocode

  MMI Configuration in the white labeled buyer app
  MMI_CLIENT_SECRET=”MMI_SERVICE”
  MMI_CLIENT_ID=”MMI_CLIENT_ID”
  MMI_ADVANCE_API_KEY=”MMI_ADVANCE_API_KEY”
  1. Pick the .env file and ask the admin for keys that need to replaced.
  Signing_private_key: some-key
  Signing_public_key: some-key
  Crypto_Privatekey: some-key
  Crypto_Publickey: some-key
  • For accessing the ONDC gateway one must be registered in the staging registry, and fill out this Form and get in touch with ONDC officials or contact Slack Channel.
  • One must submit the payload in the form, Refer to the Document, or here is the example JSON.
  • The date format is OpenAPI date-time notation.
{
    "country": "IND",
    "city": "std:0801",
    "type": "BPP4",
    "subscriber_id": "https://integration-qa.gofrugalretail.com/ecommerce/ondc6",
    "subscriber_url": "https://integration-qa.gofrugalretail.com/ecommerce/ondc8",
    "domain": "nic2004:521109",
    "signing_public_key": "SIGNING_PRIVATE_KEY",
    "encr_public_key": "CRYPTO_PUBLICKEY",
    "created": "2021-11-09T05:56:52.470Z2",
    "valid_from": "2021-11-10T05:56:52.470Z3",
    "valid_until": "2023-11-09T05:56:52.470Z7",
    "updated": "2021-11-09T13:15:58.349Z11"
}
  1. A ngrok instance is required to be running locally to publish to the internet
   brew install --cask ngrok
   ngrok http 5555
  1. Copy the url to the clipboard and paste in BAP_URL and PROTOCOL_BASE_URL in .env-local.

  2. Run docker-compose -f docker-compose-for-local.yaml --env-file .env-local up -d

  3. Open http://localhost.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Deployment

Prerequisites

  • For the white label app, ONDC has used ansible to deploy and generate ssl certificates.
  • The public key of the node to generate ssl and make it available for the seller apps to identify the buyer app.
  • Docker and docker compose needs to be installed.
  • Access to github repository to clone.
  • Create a copy of .env-local with valid credentials and name it .env-. E.g. .env-prod.

How to use ansible

First ansible is to install the apps and generate ssl certificate

  CMDs (commands)
     ansible-playbook -i ansible_hosts buyer-app-install-for-ssl.yaml

  it will ask for
	 Hostname - which needs to be mentioned in hostname file

  it will ask for domain to host
     E.g. buyer-app.ondc.org

  it will ask for stage name, which is used to copy the .env file, to copy
     If a env file of .env-prod is already created, then prod

  • Try to run to generate lets encrypt ssl certificates
ansible-playbook -i seller-app-install-for-ssl.yaml
  • Once above ansible playbook is successfully installed we can run
ansible-playbook -i seller-app-run.yaml

License

This project is licensed under the ONDC - see the LICENSE.md file for details.

seller-app-sdk's People

Contributors

navdeep710 avatar adityapatil123 avatar sahilsharma9 avatar wemakshaychavan avatar sahil-ondc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.