Skip to content

Repository for creating and managing entities in projects service

License

Notifications You must be signed in to change notification settings

ELEVATE-Project/entity-management

Repository files navigation

Entity Management

CircleCI Duplicated Lines (%) Coverage Vulnerabilities Prettier Docs Docs GitHub package.json version (subfolder of monorepo) License

CircleCI insights

CircleCI


This Service enables the creation and management of various entities and entityType .It provides functionalities for entities, ensuring seamless integration and maintenance of entity-related data across the platform.

System Requirements

  • Operating System: Ubuntu 22
  • Node.js: v20
  • mongoDb: v4

Setup Options

Elevate entity-management 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.

Local Dependencies Steps

  1. Download Docker Compose File: Retrieve the docker-compose.yml file from the entity-management service repository and save it to the entity-management directory.

  2. Run the docker container.

    • For Mac & Windows with docker v18.03+:

      $ docker run --name entity-management shikshalokamqa/elevate-entity-management:1.0.0
      
    • For Linux:

      $ docker run --name entity-management --add-host=host.docker.internal:host-gateway shikshalokamqa/elevate-entity-management:1.0.0`
      

      Refer this for more information.

Remote Dependencies Steps

  1. Run the docker container.

    $ docker run --name entity-management shikshalokamqa/elevate-entity-management:1.0.0
    
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 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 entity-management repository to /opt/backend directory

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

Install Npm packages from src directory

backend/entity-management/src$ sudo npm i

Create .env file in src directory

entity-management/src$ sudo nano .env

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

# entity-management Service Config

# Port on which service runs
APPLICATION_PORT=5001

# Application environment
APPLICATION_ENV=development

# Route after the base URL
APPLICATION_BASE_URL=/entity/

# Api doc URL
API_DOC_URL= "https://project-dev.elevate-apis.shikshalokam.org/entity-management/api-doc"

#User service URL
USER_SERVICE_URL = http://localhost:3001/user


INTERNAL_ACCESS_TOKEN="internal_access_token"

#DB URL
MONGODB_URL=mongodb://mongo:27017/elevate-entity-management

#service name
SERVICE_NAME = elevate-entity-service

version=8

Save and exit.

Setting up Databases

Start MongoDB Service

sudo systemctl start mongod

Verify MongoDB is running

sudo systemctl status mongod

Start the Service

Navigate to the src folder of entity-management service and run pm2 start command:

entity-management/src$ pm2 start app.js -i 2 --name elevate-entity-management

Run pm2 ls command

$ pm2 ls

Postman Collections

Used in

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

The frontend/mobile application repo.

You can learn more about the full implementation of project-service here .

Team


Open Source Dependencies

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

NodeJS MongoDB Git

About

Repository for creating and managing entities in projects service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages