npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bap-boilerplate-sdk

v1.0.1

Published

## What is BAP SDK? A comprehensive NodeJS + React Native SDK, empowering developers to efficiently create Beckn-enabled consumer-facing applications (BAPs) using a streamlined boilerplate codebase. The SDK takes care of Beckn's backend code, allowing dev

Downloads

1

Readme

BAP SDK

What is BAP SDK?

A comprehensive NodeJS + React Native SDK, empowering developers to efficiently create Beckn-enabled consumer-facing applications (BAPs) using a streamlined boilerplate codebase. The SDK takes care of Beckn's backend code, allowing developers to prioritize UI/UX enhancements and simplify the overall development process.

What is the Project Application?

The SDK not only manages the backend code but also offers a pre-designed UI template. This eliminates the need for users to start their applications from scratch. They can make modifications to the provided UI, while the SDK handles the backend intricacies. This approach lets developers focus sharply on refining UI and UX, thus streamlining the development process.

Getting started

To get started with the BAP Boilerplate SDK, please try out our cloud-based demo site at: https://experience-guide-staging.becknprotocol.io/select-experience/

Features

  • CLI based tool for initialisation
  • Boilerplate UI Templates
  • Backend SDK Code
  • Search use case for 2 domains
  • Sorting as per rating use case

Tech Stack

Client: React Native, Expo, Axios

Server: Node.js, Beckn Protocol

Tools: Postman

Table of contents


Prerequisites

| Software dependencies | Versions | | :--- | ------- | | node | > 14.x.x (Install the latest release of LTS version) | | expo-cli | > 6.x.x (Install the latest release: npm install -g expo-cli) | | ts-node | Latest version of yarn: npm install -g ts-node | | yarn | Latest version of yarn: npm install -g yarn | | nodemon | Latest version of nodemon: npm install -g nodemon |


Project Setup

1. Using GitHub Repo

Clone the project

  git clone https://github.com/beckn/BAP-Boilerplate-SDK.git

Open BAP-Boilerplate-SDK folder in your terminal and run

  sudo npm install -g

Open a new folder in which you want to create your project and run

  bap-sdk

Choose the required prompts and enter the required fields provided by the CLI tool. This will setup a template project in your current folder, which can be modified by users.

2. Using NPM Package

Install the npm package globally

  sudo npm i bap-boilerplate-sdk -g

Open a new folder in which you want to create your project and run

  bap-sdk

Choose the required prompts and enter the required fields provided by the CLI tool. This will setup a template project in your current folder, which can be modified by users.

3. Using Docker Images

Pull the latest docker image

  docker pull sandeeppillai/bap-sdk:v1

Run the container in interactive mode

  docker container run -it sandeeppillai/bap-sdk:v1

Choose the required prompts and enter the required fields provided by the CLI tool. This will setup a template project in the working directory of the docker container.

Copy the project-name created above Create a new directory and copy the newly created project from docker container to your working directory

  docker cp {container-id}:/app/{project-name} .

Type docker ps -a to find the container id


Running Application

Once the application is setup in your working directory follow the below steps to run your app:

Installing Dependencies

  npm install

Setup Enviornment Variables To run this project, you will need to add the following environment variables to your .env file.

Create .env file in current working directory: touch .env

Fill the env variables as shown above

| Env Variables | Description | Type | | ------------ | ----------- | ---- | | BECKN_URL | This is the api endpoint used to make call's to the protocol server | string | | MONGO_INITDB_ROOT_USERNAME | username for the mongodb image | string | | MONGO_INITDB_ROOT_PASSWORD | password for the mongodb image | string | | MONGO_INITDB_DATABASE | database name for the mongodb image | string | | RABBITMQ_DEFAULT_USER | username for the rabbitmq image | string | | RABBITMQ_DEFAULT_PASS | password for the rabbitmq image | string |

Replace the default url in beckn.config.ts with process.env.BECKN_URL, similarly replace default variables inside docker-compose.yaml file if needed.

Setting up Backend Server Run all the required infrastructure and services using: docker-compose up in the current working directory.

If the developer is provided with an api endpoint add it in the env file in BECKN_URL. All the backend calls will be made to this api.

Else if the developer want's to test the local backend follow the steps provided here: Protocol Server Setup

Run application

  npm start

Demo Links

1. Link to Demo recording: video

2. Link to Deployed Application: demo


Project Structure

├── templates/
│   ├── BAP-Education/             # Boilerplate for education
│   │    └── docker-compose.yaml  
│   │  
│   ├── BAP-Mobility/              # Boilerplate for mobility
│   │    └── docker-compose.yaml  
│   │   
│   └── BAP-Retail/                # Boilerplate for retail 
│        └── docker-compose.yaml 
│ 
├── Dockerfile                     # File to deploy docker images
├── index.js                       # sdk entry point for initialisation 
├── outputDirectory.js             # sdk output file
└── package.json

Reporting Issues

We have an open and active issue tracker. Please report any issues.