Sunbird Lern
AskDot
  • LEARN
    • Overview
    • Functional Capabilities
    • Technical Architecture
      • Technical Architecture Diagram
      • Tech Stack
    • Dependencies
    • Product Roadmap
  • USE
    • Overview
    • Release Notes
      • Release V 8.0.0 (Ongoing)
      • Release V 7.0.0
      • Release V 5.4.0
      • Release V 5.3.0
      • Release V 5.2.0
      • Release V 5.1.0
      • Release V 5.0.1
      • Release V 5.0.0
      • Release V 4.10.0
      • Release V 4.9.0
      • Release V 4.8.0
      • Release V 4.7.0
    • Developer Guide
      • USER & ORG SERVICE
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Keycloak Local setup
          • Additional Installation Dependencies:
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
              • User
              • Organisation
              • System Settings
              • Role
              • Bulk Upload Process
              • Tenant Preference
              • Cassandra Migration Version
              • User Consent
              • Email Template
              • OTP
              • Page Management (LMS Service)
              • Location
              • User Notes
              • Deprecated
          • Elastic Search
          • Redis
        • APIs
          • User Management
            • User Deletion API
            • Ownership Transfer API
          • Organisation Management
          • Location Management
          • Consent Management
          • OTP Services
          • Tenant Configurations
          • Bulk Upload
          • System Settings
          • API Management Service
          • Data Sync
          • Notification APIs
        • Flink Jobs
          • User Cache Updater
          • User Deletion Cleanup Flink Job
          • Ownership Transfer Flink Job
        • Reports
          • Standard Exhaust
            • State Admin Geo report
            • State Admin Report
          • Other Jobs
            • User Cache Indexer Job
            • Delete Users Assets Report
          • Data Products Developer Installation
            • System Requirements
            • Tech Stack
            • Installation Dependencies
            • Local installation of data-products
            • Server setup Guide
            • Installation Configuration
            • Data-product creation guide
            • Troubleshooting a data-product
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
          • System Settings
          • Email Configuration
          • SMS Configuration
          • OTP based SMS Configuration
        • Roles
          • System Roles
          • User Roles
          • RBAC
        • Dependencies
        • Keycloak on Sunbird
        • How to Guide
          • Create Organization
          • Create User
          • Add new user type & location
        • Single Sign-on with Sunbird
        • Caching and Denormalising User Metadata
          • ETLUserCacheUpdaterJob
          • UserCacheUpdaterFlinkJob
        • Unit Tests and Code Coverage
        • FAQs
      • LMS(BATCH) SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
        • Data Models
          • Cassandra
            • Data Dictionary
          • ElasticSearch
          • Redis
        • APIs
        • Flink Jobs
          • Merge User Courses
          • Relation Cache Updater
          • Activity Aggregate Updater
          • Assessment Aggregator
          • Enrolment Reconciliation
          • Collection Certificate Pre-Processor
          • Collection Certificate Generator
        • Reports
          • On-Demand Exhaust
            • Response Exhaust
            • User Info Exhaust
            • Progress Exhaust
          • Other Jobs
            • Collection Summary Job
            • Course Batch Status Updater Job
            • Cassandra Migrator Job
            • Score Metric Migration Job
            • Assessment Score Correction Job
            • Collection Reconciliation Job
            • Course Enrollment Job
            • Course Consumption Job
        • Logs, Telemetry Events
        • Configuration
          • System Configuration
          • Functional Configuration
        • Dependencies
        • Certificate Registry and Credentialing using Sunbird-RC
          • Configuring PublicKey in Sunbird-RC
          • Server Setup guide for Sunbird-RC
          • API Guide For Sunbird-RC
        • Certificate Flow
          • Certificates Creation and Configuration
        • FAQs
      • GROUPS
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
          • Redis
        • APIs
          • Create Group
        • Logs, Telemetry Events
          • UI Telemetry Events
          • Service Telemetry Events
        • Configuration
          • Functional Configurations
        • Design References
        • Dependencies
        • Unit Tests and Code Coverage
      • NOTIFICATION SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Data Dictionary
        • APIs
        • Flink Jobs
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
        • Dependencies
        • Unit Tests and Code Coverage
      • DISCUSSION FORUM
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
            • Nodebb setup
            • Discussion Middleware Setup
            • Discussion Middleware
            • Discussion forum integration with any application
            • Discussion-UI setup along with demo application.
            • Sunbird-lern portal for DF
          • Source Code
        • APIs
          • Category APIs
          • User APIs
          • Post APIs
          • Topic APIs
          • Forum APIs
        • Context Schema
        • Configurations
          • Nodebb Admin panel settings
          • Discussion MW & Nodebb System Config
        • Telemetry Events
        • Dependencies
      • ML SERVICE
        • DATA PIPELINE (Flink Jobs)
          • Program User Info
            • Component Diagram
            • Data Model
            • Folder Structure
          • Ml User Delete
            • Component Diagram
            • Data Model
            • Folder Structure
        • DATA PRODUCTS
          • Program Exhaust
            • Component Diagram
            • Folder Structure
    • Server Installation
    • Dependency Setup
    • Deprecation
      • Release-5.4.0
    • Jenkins Jobs
    • Release Calendar
    • Learn More
      • Tech References
      • Telemetry Processing
      • Data Dictionary
        • Sample Data
      • Delete User Functionality
      • Asset Ownership Transfer
    • FAQs
  • Engage
    • Discuss
    • Contribute to Sunbird Lern
    • Raise an Issue
    • Contribution Guidelines
Powered by GitBook
On this page
  • Nodebb:
  • How to setup nodebb in local environment
  • Mandatory Plugins

Was this helpful?

Edit on GitHub
  1. USE
  2. Developer Guide
  3. DISCUSSION FORUM
  4. Developer Installation
  5. Installation Guide

Nodebb setup

PreviousInstallation GuideNextDiscussion Middleware Setup

Last updated 2 years ago

Was this helpful?

Before using the discussion forum we have to do below configurations.

Nodebb:

NodeBB is an open source project which can be forked on GitHub (). It have plugin support. We can create new plugins for our requirement and link to nodebb.

How to setup nodebb in local environment

Note: Before staring nodebb setup in local. check redis is up and running. If not start redis first and do the setup.

Step:1

Clone the nodebb repo

git clone -b v1.18.x https://github.com/NodeBB/NodeBB.git nodebb

Step:2

Navigate to nodebb folder and do setup of nodebb using below command

./nodebb setup

While running the setup, nodebb will ask below question for initial setup.

>> URL used to access this NodeBB (http://localhost:4567) : Press Enter 
>> Please enter a NodeBB secret (44abfc50-3d6a-4e6c-a258-9f551f9faa5a) : Press Enter 
>> Would you like to submit anonymous plugin usage to nbbpm? (yes) : Press Enter 
>> Which database to use (mongo) : redis

Now configuring redis database:
>> Host IP or address of your Redis instance (127.0.0.1) : Press Enter 
>> Host port of your Redis instance (6379) : Press Enter 
>> Password of your Redis database : Press Enter 
>> Which database to use (0..n) (0) : 3 (redis db number)

Admin User details
>> Administrator username : admin 
>> Administrator email address : admin@test.com
>> Password : Your password
>> Confirm Password : Your password

Step:3

Now start the nodebb, Using below command.

./nodebb start

Step:4

Build the nodebb using the below command.

If there is any code change, any admin pannel change or activating/deactivating of plugins then run the below command then your changes will apply.

./nodebb build

Step:5

Use full commands

./nodebb log -> To see the logs
./nodebb status -> To check is nodebb running or not
./nodebb activate plugin-name -> To activate the plugin
./nodebb reset -p plugin-name -> To reset/disable the plugin
./nodebb stop -> To stop nodebb

Mandatory Plugins

We have built our own plugins based on our need. We need to enable those plugins.

nodebb-plugin-create-forum

Contains all custom api

nodebb-plugin-sunbird-oidc

User login api

Activating Plugins

In this plugins, We added our own apis. Like User login, Enable discussion, read discussion context, disable discussion, user read based on sunbird id …. etc.

To activate plugin. Use below command.

Note: If you want to add any new api or modifing existing api go for plugin setup for local.

a. Using repo as a npm module.

npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git
./nodebb activate nodebb-plugin-create-forum

b. Using from local

  • clone the repo https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git`

  • Execute command npm install

  • Execute command npm link

  • Go to nodebb terminal and execute command npm link nodebb-plugin-create-forum

  • Execute command ./nodebb activate nodebb-plugin-create-forum

  • And execute command ./nodebb build

Note: When you enable or disable any plugin, You have to rebuild and restart your nodebb. Then only the changes will reflects.

Do the same thing for other plugin.

Write api plugin

This in an important plugin, By using this we can do all write operation in nodebb. Like create category/topic/post, updating topic/post, delete topic/post…..etc.

Install nodebb-plugin-write-api

  1. Login to nodebb as a admin user.

  2. Go to admin pannel.

  3. Go to EXTEND => PLUGINS => FIND PLUGINS

  4. Search for nodebb-plugin-write-api

  5. Click on Install

  6. Rebuild and restart nodebb.

  7. Reload the admin panel.

  8. Go to EXTEND => PLUGINS => INSTALLED

  9. Search for nodebb-plugin-write-api

  10. Click on Activate

  11. Rebuild and restart nodebb.

What is Master token

To perform any write operations in nodebb we need write api plugin. And this plugin provides apis to do those write operations but If you want to use this apis we have to pass a master token (in request headers as Authorization token) and nodebb user id(add _uid as query param or with in request body ).

How to create master

  1. Login to nodebb as a admin user.

  2. Go to admin pannel.

  3. Go to PLUGINS => WRITE API

  4. Left side panel you can see MASTER TOKENS Section.

  5. Click on CREATE TOKEN

Open the browser with fallowing link

Refer this link also: .

Link
http://localhost:4567
Nodebb Plugins
https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git
https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-oidc.git