SunbirdED Portal
​
The Sunbird portal is the browser-based interface for the Sunbird application stack. It provides a web-app through which all functionality of Sunbird can be accessed.

Getting started

To get started with the Sunbird portal, please try out our cloud-based demo site at: https://staging.open-sunbird.org/​

Local Installation

You can also install the Sunbird portal locally on your laptop, please follow the instructions below: Have node version 10 and follow the next steps

Pre Installation Steps

Prerequisities
1
1. Node > 10x
2
2. Angular 8x
3
3. Yarn
Copied!
Sunbird dev has 2 parts
1
1. Angular client
2
2. Node server
Copied!
Go to src/app/helpers/ replace environmentVariablesHelper.js

Installing and running Angular client

Step 1: Go to src/app/client folder

1
npm i (OR) yarn install
2
npm run start
Copied!

Installing and running Node server

Step 2: Go to src/app folder

1
npm i (OR) yarn install
2
npm run server
Copied!

Reporting Issues

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

Installing Sunbird Portal

Installing Sunbird requires two primary software components:
  • Sunbird portal or web application
  • Sunbird services stack or the backend API interface

Installing Sunbird Portal

Installing Sunbird requires two primary software components:
  • Sunbird portal or web application
  • Sunbird services stack or the backend API interface

Table of contents

​

Prerequisites

System Requirements
​
Operating System
Windows 7 and above/4.2 Mac OS X 10.0 and above/Linux
RAM
> 1.5 Gb
CPU
2 cores, > 2 GHz
Software dependencies
Text
​Node​
> 12.x.x (Install the latest release of LTS version)
​Angular CLI​
> 12.x.x (Install the latest Angular CLI version)
​yarn​
Latest version of yarn: npm install --global yarn
​nodemon​
Latest version of nodemon: npm install -g nodemon

Project Setup

  1. 1.
    Clone project
    1
    git clone https://github.com/Sunbird-Ed/SunbirdEd-portal.git
    Copied!
    Note: Stable versions of the sunbird portal are available via tags for each release, and the master branch contains latest stable release. For latest stable release refer​
  2. 2.
    Install required dependencies
    1. 1.
      Sunbird portal or web application
      1. 1.
        $ cd {PROJECT-FOLDER}/src/app/client
      2. 2.
        $ yarn install
    2. 2.
      Sunbird services stack or the backend API interface
      1. 1.
        $ gulp download:editors
      2. 2.
        $ cd {PROJECT-FOLDER}/src/app
      3. 3.
        $ yarn install
  3. 3.
    Configuring the Environment and Services Stack
    Configure the following system environment variables in the terminal which you have opened
    1
    | Environment Variable | Value | Data Type |
    2
    | :------------------------ | ------- | --------- |
    3
    | sunbird_environment | local | string |
    4
    | sunbird_instance | sunbird | string |
    5
    | sunbird_default_channel | sunbird | string |
    6
    | sunbird_default_tenant | sunbird | string |
    Copied!
    The initialization of these environmental variables can take place in a common place like in your .bashrc or .bash_profile
  4. 4.
    Edit the Application Configuration
    Open <PROJECT-FOLDER>/src/app/helpers/environmentVariablesHelper.js in any available text editor and update the contents of the file so that it contains exactly the following values
    1
    module.exports = {
    2
    // 1. LEARNER_URL
    3
    LEARNER_URL: env.sunbird_learner_player_url || <'https://<host for adopter's instance>',
    4
    5
    // 2. CONTENT_URL
    6
    CONTENT_URL: env.sunbird_content_player_url || <'https://<host for adopter's instance>',
    7
    8
    // 3. CONTENT_PROXY
    9
    CONTENT_PROXY_URL: env.sunbird_content_proxy_url || <'https://<host for adopter's instance>',
    10
    PORTAL_REALM: env.sunbird_portal_realm || 'sunbird',
    11
    12
    // 4. PORTAL_AUTH_SERVER_URL
    13
    PORTAL_AUTH_SERVER_URL: env.sunbird_portal_auth_server_url || <'https://<host for adopter's instance>',
    14
    PORTAL_AUTH_SERVER_CLIENT: env.sunbird_portal_auth_server_client || "portal",
    15
    ...
    16
    PORTAL_PORT: env.sunbird_port || 3000,
    17
    18
    // 5. PORTAL_API_AUTH_TOKEN
    19
    PORTAL_API_AUTH_TOKEN: env.sunbird_api_auth_token || User generated API auth token
    20
    ...
    21
    22
    // 6. PORTAL_ECHO_API_URL
    23
    PORTAL_ECHO_API_URL: env.sunbird_echo_api_url || '',
    24
    ...
    25
    }
    Copied!
    Once the file is updated with appropriate values, then you can proceed with running the application

Running Application

  1. 1.
    Sunbird portal or web application
    1. 1.
      Run the following command in the {PROJECT-FOLDER}/src/app/client folder
    2. 2.
      $ ng build --watch=true
    3. 3.
      Wait for the build process to complete before proceeding to the next step
  2. 2.
    Sunbird services stack or the backend API interface
    1. 1.
      Run the following command in the {PROJECT-FOLDER}/src/app folder
    2. 2.
      $ npm run server
  3. 3.
    The local HTTP server is launched at http://localhost:3000

Project Structure

1
.
2
β”œβ”€β”€ Sunbirded-portal
3
| β”œβ”€β”€ /.circleci #
4
β”‚ | └── config.yml # Circleci Configuration file
5
| β”œβ”€β”€ /experiments # -|-
6
| β”œβ”€β”€ /src/app # Sunbird portal or web application
7
β”‚ | β”œβ”€β”€ /client # -|-
8
β”‚ | | └── src # -|-
9
β”‚ | β”œβ”€β”€ /helpers # Helpers and Service file
10
β”‚ | β”œβ”€β”€ /libs # Sunbird utilities
11
β”‚ | β”œβ”€β”€ /proxy # Redirection to respective services
12
β”‚ | β”œβ”€β”€ /resourcebundles # Language resources
13
β”‚ | β”œβ”€β”€ /routes # Sunbird Backend Routes
14
β”‚ | β”œβ”€β”€ /sunbird-plugins # Sunbird plugins for editors
15
β”‚ | β”œβ”€β”€ /tests # Test case scripts for helpers and routes
16
β”‚ | β”œβ”€β”€ framework.config.js # Default framework configuration
17
β”‚ | β”œβ”€β”€ gulp-tenant.js # -|-
18
β”‚ | β”œβ”€β”€ gulpfile.js # Gulp build configuration
19
β”‚ | β”œβ”€β”€ package.json # Contains Node packages as specified as dependencies in package.json
20
β”‚ | └── server.js # Main application program file / entry file for Sunbird services stack or the backend API interface
21
└───└── .gitignore # git configuration to ignore some files and folder
Copied!

Testing

  1. 1.
    Sunbird portal or web application
    1
    1. $ cd {PROJECT-FOLDER}/src/app/client
    2
    2. $ npm run test
    3
    3. With Coverage $ npm run test-coverage
    Copied!
  2. 2.
    Sunbird services stack or the backend API interface
    1
    1. $ cd {PROJECT-FOLDER}/src/app
    2
    2. $ npm run backend-test
    3
    3. With Coverage $ npm run backend-test-with-coverage
    Copied!