Commit 12cb8610 authored by vaishali's avatar vaishali
Browse files

Issue #0 fix: update the readme file for installation guide

Showing with 55 additions and 31 deletions
+55 -31
# Sunbird Program Service # Installing Contribution/Program Service on Local Laptop or Desktop
### Prerequisites: Postgres, Node v12+ ## Pre-requisites
## Run Locally Before you install program service on your laptop, examine your environment and gather data to ensure an optimal installation experience. Review the [details](https://app.gitbook.com/o/-Mi9QwJlsfb7xuxTBc0J/s/SjljYc0PyD64vGgDlMl4/use/system-requirements) to ensure that the environment has the necessary resources and compliant target systems to successfully install and run Program Service.
Clone the project ## Project Setup
```bash
https://github.com/Sunbird-Ed/program-service.git
```
Go to the project directory 1. Clone the project
```bash - Fork the [main source code repository](https://github.com/Sunbird-Ed/program-service)
cd program-service - Clone the forked repository and add main source code repository as upstream
```
Install Git Submodules to make use of
https://github.com/project-sunbird/sunbird-js-utils.git
```bash
git submodule init
git submodule update
```
Install dependencies ```console
```bash git clone {SSH URL of FORKED REPOSITORY}
cd src/ cd {PROJECT-FOLDER}
npm install git remote add upstream git@github.com:Sunbird-Ed/program-service.git
``` git fetch upstream
git checkout -b {LOCAL-BRANCH-NAME} upstream/{LATEST BRANCH}
```
> ***Note***: Stable versions of the program service are available via tags for each release, and the master branch contains latest stable release. For latest stable release [refer](https://github.com/Sunbird-Ed/program-service/branches)
Set the env variable in `<project-folder>/src/envVariables.js` 2. Install Git Submodules to make use of https://github.com/project-sunbird/sunbird-js-utils.git
```bash
baseURL: process.env.dock_base_url || 'http://dock.sunbirded.org', ```console
SUNBIRD_URL: process.env.sunbird_base_url || 'https://dev.sunbirded.org', cd {PROJECT-FOLDER}
SUNBIRD_PORTAL_API_AUTH_TOKEN: process.env.sunbird_api_auth_token git submodule init
``` git submodule update
```
3. Install required dependencies
```console
cd {PROJECT-FOLDER}/src
npm install
```
Start the server 4. Configuring the Environment
```bash - 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
```console
const envVariables = {
baseURL: process.env.dock_base_url || <'https://<host for adopter's instance'>,
SUNBIRD_URL: process.env.sunbird_base_url || <'https://<host for adopter's 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 appropriate values, then you can proceed with running the application
### Running Application
1. Run the following command in the **{PROJECT-FOLDER}/src** folder
```console
node app.js node app.js
``` ```
the node app will run on `http://localhost:6000`
2. The local HTTP server is launched at `http://localhost:6000`
> Note: To create Postgres table in the local db use the `<project-folder>/programs.sql` > Note: To create Postgres table in the local db use the `<project-folder>/programs.sql`
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment