/angular-market-template

The OpenChannel Angular market template is a sample app marketplace website that allows users to browse, search and install approved marketplace apps.

Primary LanguageTypeScriptMIT LicenseMIT

Template3-marketsite

Quality Gate Status Coverage

Table of Contents

About The Project

The goal of a marketplace template site is to allow users to browse and install actual applications. This app represents the market site.

Functional for User:

  • Native or SSO login.
  • Search approved applications.
  • Work with applications (install/uninstall, preview).
  • Updating profile and organization data.
  • Managing users from your organization. Invite new users.

Note: Unauthorized users can browse Applications.

Built With

Getting Started

Installation

sudo apt install nodejs
  • Install the Angular CLI using the npm package manager:
npm install -g @angular/cli
  • Install NPM packages
npm install
  1. Optional. Dependency with @openchannel/angular-common-services.
npm install file:<absolute path to common service project dist/angular-common-services>
  1. Optional. Dependency with @openchannel/angular-common-components.
npm install file:<absolute path to common component project dist/angular-common-components>

Configure dashboard

Step 1. Setup OAuth

Step 2. (Optional) (#type) Note: Dashboard already have default type.

  • Follow the link to the dashboard and sign in.
  • On the left sidebar menu, find 'Settings' and open.
  • Then open 'Field Settings'.
  • You must create a new types for tabs:
    *'USER'
    *'USER ACCOUNT'
    *'DEVELOPER'
    *'DEVELOPER ACCOUNT'

Step 3. (Optional) (#roles) Note: Dashboard already have default roles.

  • Follow the link to the dashboard and sign in.
  • On the left sidebar menu, find 'Users' and open.
  • Then open 'Roles' and click by 'ADD ROLE.
  • Fill name.
  • Then click by 'ADD PERMISSIONS'
  • Select all available permissions.
  • Save.

Step 4. Creating site template, it is portal or market.

  • Follow the link to the dashboard and sign in.
  • On the left sidebar menu, find 'Sites' and open.
  • Click by 'CREATE SITE'.
  • In the opened modal fill fields :
    1. Name* - just site name.
    2. Type* - now has two parameters ('Self Hosted' and 'Fully Hosted')
      Fully Hosted - the site will be created from scratch.
      Self Hosted - you already have your site and want to link it by site domain.
    1. Template* ('Fully Hosted') - select your template type: portal(for developers) or market(for users)

Step 5. Configure site authorization type SSO or Native login.

  • Follow the link to the dashboard and sign in.

  • On the left sidebar menu find 'Sites' and open.

  • Find your site and open. (This page configures your site)

  • Find and click by 'SSO'.

  • Find and click by 'ADD IDENTITY CONFIGURATION'.

    Google config
    *Name : Google
    *Validation Mode : Authorization Code
    *Client ID : 45823498-349823hfjnlfna98r722903470.apps.googleusercontent.com
    *Client Secret : AGSdaskjqASJFnsdfal
    *Issuer : https://accounts.google.com
    *Grant Type : authorization_code
    *Scope : openid profile email
    *Classification : USER | DEVELOPER
    *Developer Organization Type (#type): admin
    *Developer Account Type (#type): admin
    *Developer Account Roles (#roles):dev-admin

    Google claims mappings :
    *accountId : {{sub}}
    *organizationName : {{use your custom JWT claim or for test '{{aud}}'
    *email : {{email}}
    *name : {{given_name}} {{family_name}}
    *username : {{name}}
    *organizationId :{{aud}}

    Okta config
    *Name : Okta
    *Validation Mode : Authorization Code Note: ('Authorization Code' - signup used special endpoints, but 'Introspect' and 'Public key' use all CAP endpoints)
    *Client ID : OAuth clientId
    *Client Secret : OAuth client secret
    *Issuer : https://dev-2468217.okta.com (use your ID into domain)
    *Grant Type : authorization_code
    *Scope : openid profile email
    *Classification : USER | DEVELOPER
    *Developer Organization Type (#type): default
    *Developer Account Type (#type): default
    *Developer Account Roles (#roles): dev-admin

    Okta claims mappings :
    *accountId : {{sub}}
    *organizationId : {{idp}}
    *organizationName : {{name}}-company
    *email : {{email}}
    *name : {{name}}

Usage

Run project with the remote site configs:

  • Open file:
/etc/hosts
  • Add to file your custom domain. (Note: this domain can be invalid, because used only in 'Origin' headers.)
127.0.0.1 my-custom-domain.com
  • Run project with the production environment:
sudo npm run start-with-host my-custom-domain.com

Run project with the Moesif plugin for Chrome:

  • Install Moesif CORS plugin for Chrome
  • Submit your work email address there
  • Open advanced settings
  • Fill in the 'Access-Control-Allow-Credentials'
    true
  • Fill in the 'Response headers' field:
    http://localhost:4200
  • Fill in the 'Request Headers' field:
    (Note: this domain can be invalid, because used only in 'Origin' headers.) https://my-custom-domain.com
  • Then start project with command:
    npm run start

Search engine discoverability

Project contains the robots.txt file. This file tells search engine crawlers which URLs the crawler can access on your site. This is used mainly to avoid overloading your site with requests. Access is disallowed to the whole site by default. If you want to allow access, change property:

Disallow: /

to

Allow: /

Documentation: https://developers.google.com/search/docs/advanced/robots/create-robots-txt?hl=en

Documentation Compodoc

Compodoc shows project structure. (modules, components, routes etc.)

  • Install NPM packages:
npm install
  • Generate Documentation:
npm run create-compodoc
  • Run Compodoc:
npm run start-compodoc

Contact

Website: https://openchannel.io

Designs

App Store Designs: https://support.openchannel.io/guides/app-store-designs/