Installing Sunbird Portal
The Sunbird portal application is powered by a set of Service APIs. These Service API(s) run in a distributed environment. This section explains the procedure to install and configure Sunbird portal web application that uses the cloud-hosted Sunbird backend services stack the Sunbird Service API(s).These APIs are hosted by project Sunbird and are used for testing and demonstration purposes.
The cloud instance of the API(s) hosted by Project Sunbird are not for production usage. The Sunbird developer installation can be best viewed via the Google Chrome browser. Although, other browsers may be used, but some pages might not render correctly.
The intended audience of this document is a person who is familiar with installing, configuring, and deploying nodejs based open-source software.
- Software: Install the following software:
node - Install the release version 8.11.2 LTS
nodemon - Latest version
git - Latest version - On WINDOWSR, perform the installation via the Git Bash shell. Performing the installation via native commandline terminal (cmd.exe) or PowerShell is not recommended.
gulp - Install gulp via npm, which gets installed when nodejs is installed
WINDOWS(R) users install @angular/cli thru npm
- API Keys The Sunbird developer instance is powered by cloud hosted Sunbird APIs, which require an API key. To get an API key, submit an API Key Request. In the form, provide information about your team and what brings you to Sunbird.
It may take up to a couple of business days (IST) to send you the API key. We regret the inconvenience caused due to such delays.
Set up the Application
These instructions install Sunbird version 1.10.1. The code examples provided here are Linux based. However, they should not differ when executed on Windows(R).
Launch a command-line terminal
Ensure that the system PATH variable contains the paths where git, node, nodemon and gulp are located
If you are unable to find an executable with the name node, check for nodejs
Change the directory into the folder that you have designated as the top level folder of the Sunbird application
Clone the Sunbird portal github repository using the following command:
git clone https://github.com/project-sunbird/sunbird-portal.git
Checkout the files tagged with version 1.10.1 using the following commands:
cd sunbird-portal git checkout tags/v1.10.1 -b 1.10.1
Build the nodejs packages that are required by the Sunbird application using the following commands:
cd src/app npm install gulp download:editors cd client npm install
Configuring the Environment and Services Stack
- Configure the following system environment variables in the terminal which you have opened
|Environment Variable||Value||Data Type|
The initialization of these environmental variables can take place in a common place like in your .bashrc or .bash_profile
- Edit the file sunbird-portal/src/app/helpers/environmentVariablesHelper.js and ensure that the following tokens are set to the values indicated. Enclose all string values within double quotation marks. Add any token, that is mentioned in the table, but which is not present in the environmentVariablesHelper.js file.
|PORTAL_API_AUTH_TOKEN||(The API key you received from your API key request)||string|
Run the Application
Update the Sunbird application with the modified configuration file values. Run the following command in the sunbird-portal/src/app/client folder:
Wait for the following message before proceeding to the next step
[nodemon] clean exit - waiting for changes before restart
Open a new commmand-line window and run the application server and populate the following system environment variables once again
|Environment Variable Name||Value||Data Type|
Run the following commands to change to the application directory and start the server
cd sunbird-portal/src/app node server.js
Launch the Google Chrome browser and navigate to
Login into the Sunbird portal
After successfully installing Sunbird use any of the following user IDs, the password to which you should have recieved along with the API key, to explore Sunbird’s workflows. Each user ID corresponds to a specific role.
- For information on user roles, refer to Types of Users