Install Locally

System Requirements

OS

Ubuntu, linux and Mac

RAM

4GB (8GB recommended)

SSD/HDD

256 GB

System Installations

Softwares / FrameworksVersion

Node

10 / 12

Postgres

9.6

Redis

4.x or above

Kafka

2.4.1

Installation

The steps to install contribution/program service, are given in here.

Pre-requisites

  1. Make sure you have all the system requirements and system installations to successfully install and run Program Service.

  2. Program service uses Postgres database to store and manage data. Refer programs.sql for the database and table structure.

  3. Refer here to use psql using command line and pgAdmin client.

Project Setup

  1. Clone project

git clone https://github.com/Sunbird-coKreat/program-service.git

Note: Stable versions of the sunbird portal are available via tags for each release, and the master branch contains latest stable release.

  1. Install Git Submodules to make use of https://github.com/project-sunbird/sunbird-js-utils.git

cd {PROJECT-FOLDER}
git submodule init
git submodule update
  1. Install required dependencies

cd {PROJECT-FOLDER}/src
npm install
  1. Edit the Application Configuration

Open the file {PROJECT-FOLDER}/src/envVariables.js in any available text editor and update the contents of the file so that it contains exactly the following values

const envVariables = {
baseURL: process.env.dock_base_url || <'https://<host for adopter's coKreat instance'>,
SUNBIRD_URL: process.env.sunbird_base_url || <'https://<host for adopter's sunbird instance'>,
....
config: {
    user: process.env.sunbird_program_db_user || "<postgress user>",
    host: process.env.sunbird_program_db_host || "localhost",
    database: process.env.sunbird_program_db_name || 'sunbird_programs',
    password: process.env.sunbird_program_db_password || '<postgress password>',
   ....
},
}

Once the file is updated with the correct values, you can proceed with running the application

Running Application

cd {PROJECT-FOLDER}/src
node app.js

The local HTTP server is launched at http://localhost:6000

Debugging Application

cd {PROJECT-FOLDER}/src
node --inspect app.js

The application can now be debugged using chrome devTools.

Last updated