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. 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.