Skip to content

KB-iGOT/interface-service

 
 

Repository files navigation

Interface Service

CircleCI Duplicated Lines (%) Coverage VulnerabilitiesPrettier Docs Docs

GitHub package.json version (subfolder of monorepo) License

CircleCI insights

CircleCI


The Mentoring building block enables effective mentoring interactions between mentors and mentees. The capability aims to create a transparent eco-system to learn, connect, solve, and share within communities. MentorED is an open source mentoring application that facilitates peer learning and professional development by creating a community of mentors and mentees.

System Requirements

  • Operating System: Ubuntu 22
  • Node.js: v20
  • PostgreSQL: 16
  • Citus: 12.1

Setup Options

Elevate interface-service services can be setup in local using two methods:

Dockerized service with local dependencies(Intermediate)

A. Dockerized Service With Local Dependencies

Expectation: Run single docker containerized service with existing local (in host) or remote dependencies.

Coming soon...

Local Service with local dependencies(Hardest)

B. Local Service With Local Dependencies

Expectation: Run single service with existing local dependencies in host (Non-Docker Implementation).

Installations

Install Node.js LTS

Refer to the NodeSource distributions installation scripts for Node.js installation.

$ curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

Install Build Essential

$ sudo apt-get install build-essential

Install PM2

Refer to How To Set Up a Node.js Application for Production on Ubuntu 22.04.

Run the following command

$ sudo npm install pm2@latest -g

Setting up Repository

Clone the mentoring repository to /opt/backend directory

opt/backend$ git clone -b develop-2.5 --single-branch "https://github.com/ELEVATE-Project/interface-service.git"

Install Npm packages from src directory

backend/interface-service/src$ sudo npm i

Create .env file in src directory

interface-service/src$ sudo nano .env

Copy-paste the following env variables to the .env file:

APPLICATION_PORT=3569
API_DOC_URL= /interface/api-doc
APPLICATION_ENV= development
MENTORING_SERVICE_BASE_URL= http://localhost:3000
NOTIFICATION_SERVICE_BASE_URL= http://localhost:7201
REQUIRED_PACKAGES= "elevate-user@1.1.38 elevate-mentoring@1.1.47 elevate-scheduler@1.0.4"
SCHEDULER_SERVICE_BASE_URL= http://localhost:7401
SUPPORTED_HTTP_TYPES= "GET POST PUT PATCH DELETE"
USER_SERVICE_BASE_URL= http://localhost:3001
created_time= "2024-02-07T04:51:22.789813746Z"
custom_metadata= null
destroyed= false
version= 21

Start the Service

Navigate to the src folder of interface service and run pm2 start command:

interface-service/src$ pm2 start app.js -i 2 --name elevate-interface

Run pm2 ls command

$ pm2 ls

Output should look like this (Sample output, might slightly differ in your installation):

┌────┬─────────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name                    │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼─────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1  │ elevate-interface       │ default     │ 1.0.0   │ cluster │ 79252    │ 2D     │ 0    │ online    │ 0%       │ 79.2mb   │ jenkins  │ disabled │
│ 2  │ elevate-interface       │ default     │ 1.0.0   │ cluster │ 79262    │ 2D     │ 0    │ online    │ 0%       │ 78.7mb   │ jenkins  │ disabled │
└────┴─────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

This concludes the interface service and dependency setup.

Save and exit.


Run tests

Integration tests

npm run test:integration

To know more about integration tests and their implementation refer to the project Wiki.

Unit tests

npm test

Used in

This project was built to be used with Mentoring Service and User Service.

The frontend/mobile application repo.

You can learn more about the full implementation of MentorEd here .

Team


Open Source Dependencies

Several open source dependencies that have aided Mentoring's development:

NodeJS MongoDB Apache Kafka Jest Git

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 98.0%
  • JavaScript 2.0%