Skip to content

NCR-Corporation/ncr-retail-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


MART

A sample retail demo application built on top of NCR's APIs.

Demo Dependencies Github Issues Contributions Welcome License

Demo // Features // Overview // How to Use // Support // Contributing // License

Features

  • Catalog API Integration
  • User registration/authentication
  • Adding to/viewing Cart
  • Management of Sites
  • Management of Categories & Catalog
  • Singule store management
  • Catalog Search

Overview

MART integrates with multiple NCR APIs including Order, Catalog, Sites, Security, & Provisioning. The demo application showcases one possible way to utilize one or many of the available APIs.

This repository showcases an imaginary retail company with multiple stores in different location. The company can be managed globally as well as at the individual store level.

How to Use

🚧 Important 🚧

If this is the first time using a project with the generated keys, you will most likely not see any data.

Why? When using the Test Drive feature, each application is a fresh installation with no data. See Seed the Database to populate the database with test data and get started quickly.

Getting Started

  1. First, clone the repository for local development.

    git clone https://github.com/NCR-Corporation/ncr-retail-demo.git
  2. Secondly, open the repository in an editor and rename .env copy.local to .env.local.

  3. After renaming, open .env.local and update the variables REACT_APP_BSP_SECRET_KEY, REACT_APP_BSP_ORGANIZATION, REACT_APP_BSP_SHARED_KEY with data found in the NCR Developer Portal. To learn more about receiving access, create an account on the NCR Developer Portal and visit the Test Drive Documentation. Use openssl rand -base64 32 to generate a random value to be used for the field NEXTAUTH_SECRET.

  4. Next, install all npm packages in the project directory:

    yarn install
  5. Finally, run the development server:

    next dev
  6. Open http://localhost:3000 with your browser to see the sample demo application generated with your keys.

This is a Next.js project bootstrapped with create-next-app. To learn more about Next.js, visit the Next.js Documentation.

Seeding the Database (Experimental)

Every new application built with NCR is a blank installation with no data. If you are looking to become familiar with the APIs and see the application in action locally, you will need to either:

  1. Create your own Sites, Categories, Groups, and Catalog
  2. Seed the database.

To seed the database, visit the Admin Dashboard by clicking "⚙ Manage" in the top of the homepage or visiting /admin/dashboard. From there, near the top is a blue button "⬇ Build Sample Database". You will still have to have a valid Organization, Secret, and Shared key in your .env.local.

Seeding the database is Experimental at this time. To learn more about how it works visit /pages/api/export.js. You may run into issues and this is the best place to start debugging. To view the data being generated, visit the /data/ folder.

Note: The Retail Demo currently uses NCR's Staging environment while certain APIs are not in production yet. If you are looking for more help, please reach out to the #developer-advocate-team in Slack.

Support

Feel free to open an issue! If there are any bugs you find or any features you would like to see implemented, create the appropriate issue on the repository.

License

This sample app project is released under the Apache 2.0 license. The license's full text can be found here.