-
Notifications
You must be signed in to change notification settings - Fork 8
docker-setup-for-entity #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d5197d4
829aa11
e336ec7
ee4e5da
df34132
f8ba006
a2cd30e
b878b43
e31ec6b
5bacb6a
e2b60b0
8ff752c
58fff6d
51eac21
f15667d
8a966fe
0b1dfd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,6 @@ | ||
|
|
||
|
|
||
| # entity-management | ||
| <div align="center"> | ||
|
|
||
| # Entity Management | ||
| # Entity-Management Service | ||
|
|
||
| <a href="https://shikshalokam.org/elevate/"> | ||
| <img | ||
|
|
@@ -13,222 +10,110 @@ | |
| /> | ||
| </a> | ||
|
|
||
| [](https://dl.circleci.com/status-badge/redirect/gh/ELEVATE-Project/notification/tree/master) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_notification) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_notification) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_notification) | ||
| [](https://prettier.io) | ||
| [](https://elevate-docs.shikshalokam.org/mentorEd/intro) | ||
| [](https://dev.elevate-apis.shikshalokam.org/notification/api-doc) | ||
|  | ||
|  | ||
| [](https://opensource.org/licenses/MIT) | ||
|
|
||
| <details><summary>CircleCI insights</summary> | ||
|
|
||
| [](https://app.circleci.com/insights/github/ELEVATE-Project/notification/workflows/buil-and-test/overview?branch=master&reporting-window=last-30-days&insights-snapshot=true) | ||
|
|
||
| </details> | ||
| <!-- <details><summary>dev</summary> | ||
| [](https://dl.circleci.com/status-badge/redirect/gh/ELEVATE-Project/mentoring/tree/dev) | ||
|  | ||
| [](https://app.circleci.com/insights/github/ELEVATE-Project/mentoring/workflows/buil-and-test/overview?branch=integration-testing&reporting-window=last-30-days&insights-snapshot=true) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_mentoring) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_mentoring) | ||
| [](https://sonarcloud.io/summary/new_code?id=ELEVATE-Project_mentoring) | ||
| </details> --> | ||
|
|
||
| </br> | ||
| 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. | ||
| </div> | ||
|
|
||
| <br> | ||
|
|
||
| # System Requirements | ||
| ## </br> | ||
|
|
||
| - **Operating System:** Ubuntu 22 | ||
| - **Node.js:** v20 | ||
| - **mongoDb:** v4 | ||
| ## 💻 Supported Operating Systems | ||
|
|
||
| # Setup Options | ||
| - **Ubuntu** (Recommended: Version 20 and above) | ||
| - **Windows** (Recommended: Version 11 and above) | ||
| - **macOS** (Recommended: Version 12 and above) | ||
|
|
||
| Elevate entity-management services can be setup in local using two methods: | ||
| --- | ||
|
|
||
| <details><summary>Dockerized service with local dependencies(Intermediate)</summary> | ||
| ## ✨ Setup & Deployment Guide | ||
|
|
||
| ## A. Dockerized Service With Local Dependencies | ||
| This section outlines the different ways to set up the **Entity-Management Service**. Please select the deployment environment and setup method that best suits your needs. | ||
|
|
||
| **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](https://raw.githubusercontent.com/ELEVATE-Project/entity-management/refs/heads/main/docker-compose.yml)** file from the entity-management service repository and save it to the entity-management directory. | ||
|
|
||
| 2. Run the docker container. | ||
| <details> | ||
| <summary> 🚀 <b>Entity-Management Service</b> </summary> | ||
| <br> | ||
|
|
||
| - For Mac & Windows with docker v18.03+: | ||
| This setup is ideal for **local development and testing**, where only the core Entity-Management Service components are required. | ||
|
|
||
| ``` | ||
| $ docker run --name entity-management shikshalokamqa/elevate-entity-management:1.0.0 | ||
| ``` | ||
| #### I. Docker Setup (Recommended) | ||
MallanagoudaB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - For Linux: | ||
| ``` | ||
| $ docker run --name entity-management --add-host=host.docker.internal:host-gateway shikshalokamqa/elevate-entity-management:1.0.0` | ||
| ``` | ||
| Refer [this](https://stackoverflow.com/a/24326540) for more information. | ||
| - [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md) | ||
| - [Setup guide for macOS](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md) | ||
| - [Setup guide for Windows](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/windows/README.md) | ||
|
Comment on lines
+42
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setup links point to project-service, not entity-management. These URLs appear to reference the project-service repo even though this PR adds 3.4.0 docs under entity-management. If the docs are intended to be local to this repo, update the links accordingly. 🔧 Example fix (entity-management repo)-- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md)
-- [Setup guide for macOS](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md)
-- [Setup guide for Windows](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/windows/README.md)
+- [Setup guide for Linux](https://github.com/ELEVATE-Project/entity-management/blob/main/src/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md)
+- [Setup guide for macOS](https://github.com/ELEVATE-Project/entity-management/blob/main/src/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md)
+- [Setup guide for Windows](https://github.com/ELEVATE-Project/entity-management/blob/main/src/documentation/3.4.0/setup/docker/stand-alone/windows/README.md)
...
-- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md)
+- [Setup guide for Linux](https://github.com/ELEVATE-Project/entity-management/blob/main/src/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md)Also applies to: 50-51 🤖 Prompt for AI Agents |
||
|
|
||
| ### Remote Dependencies Steps | ||
| <br> | ||
|
|
||
| 1. Run the docker container. | ||
| #### II. Native Setup (PM2 Managed Services) | ||
|
|
||
| ``` | ||
| $ docker run --name entity-management shikshalokamqa/elevate-entity-management:1.0.0 | ||
| ``` | ||
| - [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md) | ||
| - [Setup guide for macOS](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md) | ||
MallanagoudaB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [Setup guide for Windows](link/to/standalone/native/windows/README) | ||
MallanagoudaB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| </details> | ||
|
|
||
| <details><summary>Local Service with local dependencies(Hardest)</summary> | ||
|
|
||
| ## 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](https://github.com/nodesource/distributions#installation-scripts) for Node.js installation. | ||
|
|
||
| ```bash | ||
| $ 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](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-22-04). | ||
|
|
||
| **Run the following command** | ||
|
|
||
| ```bash | ||
| $ sudo npm install pm2@latest -g | ||
| ``` | ||
|
|
||
| ## Setting up Repository | ||
|
|
||
| ### Clone the entity-management repository to /opt/backend directory | ||
|
|
||
| ```bash | ||
| opt/backend$ git clone -b develop-2.5 --single-branch "https://github.com/ELEVATE-Project/entity-management" | ||
| ``` | ||
|
|
||
| ### Install Npm packages from src directory | ||
|
|
||
| ```bash | ||
| backend/entity-management/src$ sudo npm i | ||
| ``` | ||
| --- | ||
|
|
||
| ### Create .env file in src directory | ||
|
|
||
| ```bash | ||
| entity-management/src$ sudo nano .env | ||
| ``` | ||
|
|
||
| Copy-paste the following env variables to the `.env` file: | ||
|
|
||
| ```env | ||
| # 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** | ||
|
|
||
| ```bash | ||
| sudo systemctl start mongod | ||
| ``` | ||
|
|
||
| **Verify MongoDB is running** | ||
| <br> | ||
|
|
||
| ```bash | ||
| sudo systemctl status mongod | ||
| ## 📖 Related Documentation & Tools | ||
|
|
||
| ``` | ||
| ### 🗂️ Database Architecture Diagrams | ||
|
|
||
| ## Start the Service | ||
| Explore the database schemas for the ELEVATE-Entity services below. | ||
| Click on a service name to expand and view the diagram. | ||
|
|
||
| Navigate to the src folder of entity-management service and run pm2 start command: | ||
| <br> | ||
|
|
||
| ```bash | ||
| entity-management/src$ pm2 start app.js -i 2 --name elevate-entity-management | ||
| ``` | ||
| <details> | ||
| <summary>📂 <b>Entity Management Service (EMS)</b></summary> | ||
| <br> | ||
| <p align="center"> | ||
| <img src="https://github.com/ELEVATE-Project/entity-management/blob/dockerSetup/src/documentation/3.4.0/database-diagram/EMS-Entity-Service.drawio.png" alt="Entity Management Diagram" width="100%"> | ||
| </p> | ||
| </details> | ||
|
|
||
| #### Run pm2 ls command | ||
| > **Tip:** If the diagrams appear too small, you can right-click the image and select | ||
| > **"Open image in new tab"** to view the full-resolution architectural details. | ||
|
|
||
| ```bash | ||
| $ pm2 ls | ||
| ``` | ||
| --- | ||
|
|
||
| </details> | ||
| ### 🧪 Postman Collections and API DOC | ||
|
|
||
| <br> | ||
| - <a href="https://github.com/ELEVATE-Project/entity-management/tree/main/src/api-doc" target="_blank"> | ||
| Entity-Management Service API Collection | ||
| </a> | ||
|
|
||
| # Postman Collections | ||
| --- | ||
|
|
||
| - [Entity-Management Service](https://github.com/ELEVATE-Project/entity-management/tree/main/src/api-doc) | ||
| ### 🔖 Versioning & Documentation Links | ||
|
|
||
| # Used in | ||
| This README is focused on the **3.4.0 Setup Guide** for the Entity-Management Service. | ||
|
|
||
| This project was built to be used with [Project Service](https://github.com/ELEVATE-Project/project-service) and [User Service](https://github.com/ELEVATE-Project/user.git). | ||
| - **Current Version (3.4.0) Documentation** | ||
| All setup links above point to the **3.4.0** guides. | ||
|
|
||
| The frontend/mobile application [repo](https://github.com/ELEVATE-Project/observation-survey-projects-pwa). | ||
| - **Legacy Version (1.0.0) Documentation** | ||
| <a href="https://github.com/ELEVATE-Project/entity-management/blob/dockerSetup/src/documentation/1.0.0/README.md" target="_blank"> | ||
| View 1.0.0 Documentation | ||
| </a> | ||
|
|
||
| You can learn more about the full implementation of project-service [here](https://elevate-docs.shikshalokam.org/.project/intro) . | ||
| --- | ||
|
|
||
| # Team | ||
| ## 👥 Team | ||
|
|
||
| <a href="https://github.com/ELEVATE-Project/entity-management/graphs/contributors"> | ||
| <img src="https://contrib.rocks/image?repo=ELEVATE-Project/entity-management" /> | ||
| </a> | ||
MallanagoudaB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <br> | ||
|
|
||
| # Open Source Dependencies | ||
| --- | ||
|
|
||
| Several open source dependencies that have aided Mentoring's development: | ||
| ### Open Source Dependencies | ||
|
|
||
|  | ||
|  | ||
|  | ||
| This Entity-Management Service uses several open-source tools and dependencies that supported its development | ||
|
|
||
|  | ||
|  | ||
|  | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Badge references wrong service (mentoring instead of entity-management).
Line 13 references the mentoring service in the package.json version badge URL, which is incorrect for this entity-management README.
🔧 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents