Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 3.24 KB

README.md

File metadata and controls

90 lines (59 loc) · 3.24 KB

CESMII - Marketplace

Prerequisites

Directories

  • \api - This contains a .NET web API back end for marketplace. Within this solution, the DB database connections to Mongo DB will occur.
  • \frontend - This contains the REACT front end for the marketplace app.
  • \images - These are starter images loaded into the system to be used in content areas.
  • \sample-data - This contains JSON data that mimics the data in the stage Azure Cosmos Mongo DB.

How to Build

  1. Clone the repo from GIT.

  2. Build/Run the front end (Using a node.js prompt):

    cd \front-end
    npm install
    npm run start

    Verify the site is running in a browser: http://localhost:3000

  3. Build/Run the back end API - CESMII.Marketplace.sln (.NET Solution):

    This contains the .NET web API project and supporting projects to interact with marketplace data storage.

  4. Database - Mongo DB:

    • We use Mongo DB Compasss to directly inspect, view or edit data as needed.
    • The DB is deployed to an Azure location but could be installed locally or to another hosting provider.
    • Sample collections of data are stored in the sample-data folder.

Provision Azure AD tenant

  1. In the Azure Portal for AAD, create a new Application Registration "CESMII MarketPlace", configure it for SPA using MSAL 2.0 as per https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-app-registration:

    • Choose all account types: any organization and personal Microsoft accounts, don't specify a redirect URI at this point
  2. Under Authentication, add platform choose Single-Page Application.

  3. Under Expose an API, create

    • Add a scope "cesmii.marketplace", consent admin and users.
    • Add an Authorized client application using the appid of the SPA registration from step 1 and grant it access to the cesmii.marketplace scope.
  4. Under App roles, create the following roles (all for users/groups):

cesmii.marketplace.user
cesmii.marketplace.marketplaceadmin
cesmii.marketplace.useradmin
cesmii.marketplace.jobadmin
  1. Configure the application itself (local config files or in the Azure Portal Settings/Configuration) with the AAD tenant information.

Local development environment

Clone a mongo database to a local instance

  1. Download all documents to a .\dump folder:
mongodump /uri:mongodb:... /db:marketplace_db

If using a cloud database/ssl, make sue the uri ends in ?ssl=true.

  1. Restore into a local database
mongorestore /nsFrom:marketplace_db.* /nsTo:marketplace_db_dev.*