Softwares / Frameworks | |
---|---|
OS | Ubuntu, linux and Mac |
RAM | 4GB (8GB recommended) |
SSD/HDD | 256 GB |
Softwares / Frameworks | Version |
---|---|
Node | 10 / 12 |
Postgres | 9.6 |
Redis | 4.x or above |
Kafka | 2.4.1 |
The steps to install contribution/program service, are given in here.
- Make sure you have all the system requirements and system installations to successfully install and run Program Service.
- Program service uses Postgres database to store and manage data. Refer programs.sql for the database and table structure.
- Refer here to use psql using command line and pgAdmin client.
- 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.
- 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
- Install required dependencies
cd {PROJECT-FOLDER}/src
npm install
- 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
cd {PROJECT-FOLDER}/src
node app.js
The local HTTP server is launched at http://localhost:6000
cd {PROJECT-FOLDER}/src
node --inspect app.js
The application can now be debugged using chrome devTools.