diff --git a/README.md b/README.md index b4c9ad68..d8453790 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ The Project building block facilitates the creation and engagement with micro-im ## 💻 Supported Operating Systems -- **Ubuntu** (Recommended: Version 20 and above) -- **Windows** (Recommended: Version 11 and above) -- **macOS** (Recommended: Version 12 and above) +- **Ubuntu** (Recommended: Version 20 and above) +- **Windows** (Recommended: Version 11 and above) +- **macOS** (Recommended: Version 12 and above) --- @@ -40,24 +40,23 @@ This section outlines the different ways to set up the **Projects Service**. Ple This setup is ideal for **local development and testing**, where only the core Projects Service components are required. -In the **Stand-Alone Setup**, the **Samiksha service is not included**. This mode supports the complete lifecycle of **program creation and program consumption**, along with **project creation and project consumption**. Users can also **view and generate reports** based on the configured programs and projects. +In the **Stand-Alone Setup**, the **Samiksha service is not included**. This mode supports the complete lifecycle of **program creation and program consumption**, along with **project creation and project consumption**. Users can also **view and generate reports** based on the configured programs and projects. This setup is recommended when survey and observation features powered by Samiksha are not required, and the focus is limited to core program and project management workflows. - #### I. Docker Setup (Recommended) -- [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/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)
#### II. Native Setup (PM2 Managed Services) -- [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) -- [Setup guide for Windows](link/to/standalone/native/windows/README) +- [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) +- [Setup guide for Windows](link/to/standalone/native/windows/README) @@ -69,29 +68,101 @@ This setup is recommended when survey and observation features powered by Samiks This setup integrates the Projects Service with the **Samiksha Service**, providing a full-featured, production-ready deployment environment. -In this **Integrated Setup**, the system supports the complete lifecycle of **program creation and program consumption**, along with **project creation and project consumption**. It also enables **survey creation, survey consumption, observation creation, and observation consumption**, allowing structured assessments and evaluations to be conducted. +In this **Integrated Setup**, the system supports the complete lifecycle of **program creation and program consumption**, along with **project creation and project consumption**. It also enables **survey creation, survey consumption, observation creation, and observation consumption**, allowing structured assessments and evaluations to be conducted. Users can further **view and generate reports** across programs, projects, surveys, and observations, making this setup suitable for end-to-end project execution and assessment workflows in real-world deployments. #### I. Docker Setup (Recommended) -- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md) -- [Setup guide for macOS](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md) -- [Setup guide for Windows](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md) +- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md) +- [Setup guide for macOS](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md) +- [Setup guide for Windows](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md)
#### II. Native Setup (PM2 Managed Services) -- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md) -- [Setup guide for macOS](link/to/samiksha/native/macos/README) -- [Setup guide for Windows](link/to/samiksha/native/windows/README) +- [Setup guide for Linux](https://github.com/ELEVATE-Project/project-service/blob/main/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md) +- [Setup guide for macOS](link/to/samiksha/native/macos/README) +- [Setup guide for Windows](link/to/samiksha/native/windows/README) + + +
+ +### 🚀 **WITH SELF CREATION PORTAL (SCP) (Integrated Deployment)** + +
+ **Click to Expand Integrated Setup Options** +
+ +This setup integrates the Projects Service and Samiksha Service with the **Self Creation Portal**, providing a full-featured, production-ready deployment environment. + +#### I. Docker Setup (Recommended) + +
+ 1. Ubuntu Setup +
+Go to the detailed Ubuntu Docker setup guide: **SETUP_SCP_DOCKER_UBUNTU.md** +
+ +
+ 2. macOS Setup +
+Go to the detailed macOS Docker setup guide: **SETUP_SCP_DOCKER_MACOS.md** +
+
+ 3. Windows Setup +
+Go to the detailed Windows Docker setup guide: **SETUP_SCP_DOCKER_WINDOWS.md**
+
+#### II. Native Setup (PM2 Managed Services) + +
+ 1. Ubuntu Setup +
+Go to the detailed Ubuntu Native setup guide: **SETUP_SCP_NATIVE_UBUNTU.md** +
+ +
+ 2. macOS Setup +
+Go to the detailed macOS Native setup guide: **SETUP_SCP_NATIVE_MACOS.md** +
+ +
+ 3. Windows Setup +
+Go to the detailed Windows Native setup guide: **SETUP_SCP_NATIVE_WINDOWS.md** +
+ +
+ +--- + ## 📖 Related Documentation & Tools +### Versioning & Documentation Links + +This README is focused on the **3.4.0 Setup Guide** for the Projects Service. + +- **Current Version (3.4.0) Documentation:** All setup links above point to the **3.4.0** guides. +- **Legacy Version (1.0.0) Documentation:** Access the documentation for the previous major release here: **View 1.0.0 Documentation** + +### Postman Collections + +- **Projects Service API Collection** + +### Adding New Projects to the System + +With implementation scripts, you can seamlessly add new projects to the system. Once a project is successfully added, it becomes visible on the portal, ready for use and interaction. For a comprehensive guide on setting up and using the implementation script, please refer to the **documentation here**. + +--- + +## 📖 Related Documentation & Tools ### 🗂️ Database Architecture Diagrams @@ -131,11 +202,11 @@ Click on a service name to expand and view the diagram. ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection -- - Samiksha Service API Collection - +- + Projects Service API Collection +- + Samiksha Service API Collection + --- @@ -146,11 +217,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -158,15 +229,16 @@ For a comprehensive guide on setting up and using the SUP, please refer to: This README is focused on the **3.4.0 Setup Guide** for the Projects Service. -- **Current Version (3.4.0) Documentation** - All setup links above point to the **3.4.0** guides. +- **Current Version (3.4.0) Documentation** + All setup links above point to the **3.4.0** guides. -- **Legacy Version (1.0.0) Documentation** - +- **Legacy Version (1.0.0) Documentation** + View 1.0.0 Documentation - + --- + ## 👥 Team @@ -176,6 +248,7 @@ This README is focused on the **3.4.0 Setup Guide** for the Projects Service. --- ### Open Source Dependencies + This project uses several open-source tools and dependencies that supported its development ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) @@ -184,4 +257,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/common-files/dockerized/project-with-survey/entity_sampleData.js b/documentation/3.4.0/common-files/dockerized/project-with-survey/entity_sampleData.js index b0b3e335..aec6715a 100644 --- a/documentation/3.4.0/common-files/dockerized/project-with-survey/entity_sampleData.js +++ b/documentation/3.4.0/common-files/dockerized/project-with-survey/entity_sampleData.js @@ -287,4 +287,4 @@ let entities = [ module.exports = { entities, entityType, -} \ No newline at end of file +} diff --git a/documentation/3.4.0/common-files/dockerized/project-with-survey/insert_sample_solutions.js b/documentation/3.4.0/common-files/dockerized/project-with-survey/insert_sample_solutions.js index 6b02bb98..9710806d 100644 --- a/documentation/3.4.0/common-files/dockerized/project-with-survey/insert_sample_solutions.js +++ b/documentation/3.4.0/common-files/dockerized/project-with-survey/insert_sample_solutions.js @@ -3,10 +3,10 @@ const { MongoClient } = require('mongodb') const url = 'mongodb://localhost:27017/' // MongoDB URL const projectDB = 'elevate-project' const entityDB = 'elevate-entity' -const samikshaDB = "elevate-samiksha"; +const samikshaDB = 'elevate-samiksha' const entityData = require('./entity_sampleData.js') const projectData = require('./project_sampleData.js') -const surveyData = require("./survey_sampleData.js"); +const surveyData = require('./survey_sampleData.js') // MongoDB Error Code for Duplicate Key const DUPLICATE_KEY_ERROR_CODE = 11000 @@ -116,7 +116,6 @@ async function insertData(collectionName, dataFile, currentDB = projectDB) { } } - async function main({ dataToBeInserted }) { const collectionsToInsert = [ { name: 'entities', data: dataToBeInserted.entities, db: entityDB }, @@ -130,20 +129,21 @@ async function main({ dataToBeInserted }) { { name: 'projectCategories', data: dataToBeInserted.projectCategoriesData, db: projectDB }, { name: 'configurations', data: dataToBeInserted.configurationData, db: projectDB }, { name: 'organizationExtension', data: dataToBeInserted.organizationExtensionData, db: projectDB }, - { name: "solutions", data: dataToBeInserted.solutionData, db:samikshaDB}, - { name: "criteria", data:dataToBeInserted.criteriaData, db : samikshaDB}, - { name: "criteriaQuestions", data: dataToBeInserted.criteriaQuestionsData, db : samikshaDB}, - { name: "frameworks", data: dataToBeInserted.frameworkData, db : samikshaDB}, - { name: "questions", data: dataToBeInserted.questionsData, db : samikshaDB}, - { name: "observations", data: dataToBeInserted.observationData, db : samikshaDB}, - { name: "surveys", data: dataToBeInserted.surveyData, db : samikshaDB}, - { name: "organizationExtension", data: dataToBeInserted.organizationExtensionData, db : samikshaDB}, - + { name: 'solutions', data: dataToBeInserted.solutionData, db: samikshaDB }, + { name: 'criteria', data: dataToBeInserted.criteriaData, db: samikshaDB }, + { name: 'criteriaQuestions', data: dataToBeInserted.criteriaQuestionsData, db: samikshaDB }, + { name: 'frameworks', data: dataToBeInserted.frameworkData, db: samikshaDB }, + { name: 'questions', data: dataToBeInserted.questionsData, db: samikshaDB }, + { name: 'observations', data: dataToBeInserted.observationData, db: samikshaDB }, + { name: 'surveys', data: dataToBeInserted.surveyData, db: samikshaDB }, + { name: 'organizationExtension', data: dataToBeInserted.organizationExtensionData, db: samikshaDB }, ] console.log(`\n=================================================`) console.log( - `🗑️ Starting CLEANUP for ${dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data' } Collections...` + `🗑️ Starting CLEANUP for ${ + dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data' + } Collections...` ) console.log(`=================================================`) @@ -155,7 +155,9 @@ async function main({ dataToBeInserted }) { console.log(`\n=================================================`) console.log( - `➕ Starting INSERTION for ${dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data '} Collections...` + `➕ Starting INSERTION for ${ + dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data ' + } Collections...` ) console.log(`=================================================`) @@ -182,11 +184,10 @@ main({ dataToBeInserted: projectData }) }) .catch(console.error) - main({ dataToBeInserted: surveyData }) -.then(() => { - console.log('\n=======================================') - console.log('✅ survey data population process finished.') - console.log('=======================================') -}) -.catch(console.error) + .then(() => { + console.log('\n=======================================') + console.log('✅ survey data population process finished.') + console.log('=======================================') + }) + .catch(console.error) diff --git a/documentation/3.4.0/common-files/dockerized/project-with-survey/project_sampleData.js b/documentation/3.4.0/common-files/dockerized/project-with-survey/project_sampleData.js index 585a7fb4..ecf44d06 100644 --- a/documentation/3.4.0/common-files/dockerized/project-with-survey/project_sampleData.js +++ b/documentation/3.4.0/common-files/dockerized/project-with-survey/project_sampleData.js @@ -438,158 +438,159 @@ let programData = [ cluster: ['ALL'], school: ['ALL'], }, - },, - { - _id: new ObjectId("691c1b06e71d83091cf9c336"), - resourceType: ["program"], - language: ["English"], - keywords: [], - concepts: [], - components: [ - { - _id: new ObjectId("691c1b10e71d83091cf9c35d"), - order: 1, - }, - { - _id: new ObjectId("691c1b17266ef5649ce4104c"), - order: 2, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c474"), - order: 3, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c495"), - order: 4, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4b6"), - order: 5, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4da"), - order: 6, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4fb"), - order: 7, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c51c"), - order: 8, - }, - { - _id: new ObjectId("691c1f96266ef5649ce41171"), - order: 9, - }, - ], - isAPrivateProgram: false, - isDeleted: false, - requestForPIIConsent: true, - rootOrganisations: [], - createdFor: [], - deleted: false, - status: "active", - owner: "1", - createdBy: "1", - updatedBy: "1", - externalId: "Testing_for_creation_sup_18_11", - name: "Testing for creation sup 18-11", - description: "This is the description of the program.", - metaInformation: { - state: ["Tripura"], - recommendedFor: ["student"], - }, - imageCompression: { - quality: 10, - }, - startDate: new Date("2025-11-16T18:30:00.000Z"), - endDate: new Date("2030-11-28T18:29:59.000Z"), - tenantId: 'default', - orgId: 'default_code', - updatedAt: new Date("2025-11-18T07:26:14.940Z"), - createdAt: new Date("2025-11-18T07:06:46.613Z"), - __v: 0, - scope: { - professional_role: ["6867a3c10d8d24001465c2d1"], - professional_subroles: ["6867a1420d8d24001465c28f"], - state: ["6863a9941d52e30014093ad9"], - district: ["6863aa5f1d52e30014093b41"], - block: ["ALL"], - cluster: ["ALL"], - school: ["ALL"], - }, - }, - { - _id: new ObjectId("691b10a0dbb768073d67328c"), - resourceType: ["program"], - language: ["English"], - keywords: [], - concepts: [], - components: [ - { - _id: new ObjectId("691b141a1ce3f5956e9f30e8"), - order: 1, - }, - { - _id: new ObjectId("691b1783dbb768073d67330d"), - order: 2, - }, - { - _id: new ObjectId("691b1790dbb768073d673366"), - order: 3, - }, - { - _id: new ObjectId("691b179e7b8c31191b8facee"), - order: 4, - }, - { - _id: new ObjectId("691b17ae1ce3f5956e9f319d"), - order: 5, - }, - { - _id: new ObjectId("691b192a1ce3f5956e9f320e"), - order: 6, - }, - ], - isAPrivateProgram: false, - isDeleted: false, - requestForPIIConsent: true, - rootOrganisations: [], - createdFor: [], - deleted: false, - status: "active", - owner: "1", - createdBy: "1", - updatedBy: "1", - externalId: "Testing_for_creation_sup_17_11", - name: "Testing for creation sup 17-11", - description: "This is the description of the program.", - metaInformation: { - state: ["Tripura"], - recommendedFor: ["student"], - }, - imageCompression: { - quality: 10, - }, - startDate: new Date("2025-11-16T18:30:00.000Z"), - endDate: new Date("2030-11-28T18:29:59.000Z"), - tenantId: 'default', - orgId: 'default_code', - updatedAt: new Date("2025-11-17T12:46:34.713Z"), - createdAt: new Date("2025-11-17T12:10:08.914Z"), - __v: 0, - scope: { - professional_role: ["6867a3c10d8d24001465c2d1"], - professional_subroles: ["6867a1420d8d24001465c28f"], - state: ["6863a9941d52e30014093ad9"], - district: ["6863aa5f1d52e30014093b41"], - block: ["ALL"], - cluster: ["ALL"], - school: ["ALL"], - }, - }, -]; + }, + , + { + _id: new ObjectId('691c1b06e71d83091cf9c336'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('691c1b10e71d83091cf9c35d'), + order: 1, + }, + { + _id: new ObjectId('691c1b17266ef5649ce4104c'), + order: 2, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c474'), + order: 3, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c495'), + order: 4, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4b6'), + order: 5, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4da'), + order: 6, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4fb'), + order: 7, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c51c'), + order: 8, + }, + { + _id: new ObjectId('691c1f96266ef5649ce41171'), + order: 9, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_creation_sup_18_11', + name: 'Testing for creation sup 18-11', + description: 'This is the description of the program.', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['student'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-11-16T18:30:00.000Z'), + endDate: new Date('2030-11-28T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-11-18T07:26:14.940Z'), + createdAt: new Date('2025-11-18T07:06:46.613Z'), + __v: 0, + scope: { + professional_role: ['6867a3c10d8d24001465c2d1'], + professional_subroles: ['6867a1420d8d24001465c28f'], + state: ['6863a9941d52e30014093ad9'], + district: ['6863aa5f1d52e30014093b41'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, + { + _id: new ObjectId('691b10a0dbb768073d67328c'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('691b141a1ce3f5956e9f30e8'), + order: 1, + }, + { + _id: new ObjectId('691b1783dbb768073d67330d'), + order: 2, + }, + { + _id: new ObjectId('691b1790dbb768073d673366'), + order: 3, + }, + { + _id: new ObjectId('691b179e7b8c31191b8facee'), + order: 4, + }, + { + _id: new ObjectId('691b17ae1ce3f5956e9f319d'), + order: 5, + }, + { + _id: new ObjectId('691b192a1ce3f5956e9f320e'), + order: 6, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_creation_sup_17_11', + name: 'Testing for creation sup 17-11', + description: 'This is the description of the program.', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['student'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-11-16T18:30:00.000Z'), + endDate: new Date('2030-11-28T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-11-17T12:46:34.713Z'), + createdAt: new Date('2025-11-17T12:10:08.914Z'), + __v: 0, + scope: { + professional_role: ['6867a3c10d8d24001465c2d1'], + professional_subroles: ['6867a1420d8d24001465c28f'], + state: ['6863a9941d52e30014093ad9'], + district: ['6863aa5f1d52e30014093b41'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, +] let projectTemplatesData = [ { @@ -1476,139 +1477,136 @@ let projectTemplateTasksData = [ updatedAt: new Date('2025-09-24T09:28:14.374Z'), createdAt: new Date('2025-09-24T09:28:07.083Z'), __v: 0, - },, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d75"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [], - deleted: false, - type: "observation", - solutionDetails: { - type: "observation", - subType: "Social Studies", - _id: "68ee4bb440fd155dceef08a9", - externalId: - "fb34d196-a8fe-11f0-9793-553f35f97dd1-OBSERVATION-TEMPLATE-1760447411986", - name: "obsasatask oct 8 facilitator only 2nd", - isReusable: false, - minNoOfSubmissionsRequired: "2.0", - }, - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Review the Activity Manual", - externalId: "DPDTSC-HandBook-1-2025-Task1-1760447411369-1760447411984", - description: "", - sequenceNumber: "1", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "True", - minNoOfSubmissionsRequired: "2.0", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.146Z"), - createdAt: new Date("2025-10-14T13:10:11.744Z"), - __v: 0, - }, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d7e"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [], - deleted: false, - type: "simple", - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Conduct the Activity with students", - externalId: "DPDTSC-HandBook-1-2025-Task3-1760447411369-1760447412197", - description: "", - sequenceNumber: "3", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "", - minNoOfSubmissionsRequired: "", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.202Z"), - createdAt: new Date("2025-10-14T13:10:11.813Z"), - __v: 0, - }, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d82"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [ - { - name: "learn", - link: "https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link", - app: "projectService", - id: "view?usp=drive_link", - }, - ], - deleted: false, - type: "content", - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Conduct the Activity Assessment", - externalId: "DPDTSC-HandBook-1-2025-Task4-1760447411369-1760447412206", - description: "", - sequenceNumber: "4", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "", - minNoOfSubmissionsRequired: "", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.210Z"), - createdAt: new Date("2025-10-14T13:10:11.825Z"), - __v: 0, - }, -]; + }, + , + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d75'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'observation', + solutionDetails: { + type: 'observation', + subType: 'Social Studies', + _id: '68ee4bb440fd155dceef08a9', + externalId: 'fb34d196-a8fe-11f0-9793-553f35f97dd1-OBSERVATION-TEMPLATE-1760447411986', + name: 'obsasatask oct 8 facilitator only 2nd', + isReusable: false, + minNoOfSubmissionsRequired: '2.0', + }, + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Review the Activity Manual', + externalId: 'DPDTSC-HandBook-1-2025-Task1-1760447411369-1760447411984', + description: '', + sequenceNumber: '1', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: 'True', + minNoOfSubmissionsRequired: '2.0', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.146Z'), + createdAt: new Date('2025-10-14T13:10:11.744Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d7e'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'DPDTSC-HandBook-1-2025-Task3-1760447411369-1760447412197', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.202Z'), + createdAt: new Date('2025-10-14T13:10:11.813Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d82'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'learn', + link: 'https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link', + app: 'projectService', + id: 'view?usp=drive_link', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity Assessment', + externalId: 'DPDTSC-HandBook-1-2025-Task4-1760447411369-1760447412206', + description: '', + sequenceNumber: '4', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.210Z'), + createdAt: new Date('2025-10-14T13:10:11.825Z'), + __v: 0, + }, +] let certificateTemplatesData = [ { @@ -1925,5 +1923,5 @@ module.exports = { certificateBaseTemplatesData, projectCategoriesData, configurationData, - organizationExtensionData + organizationExtensionData, } diff --git a/documentation/3.4.0/common-files/dockerized/project-with-survey/survey_sampleData.js b/documentation/3.4.0/common-files/dockerized/project-with-survey/survey_sampleData.js index ec74f678..1928b075 100644 --- a/documentation/3.4.0/common-files/dockerized/project-with-survey/survey_sampleData.js +++ b/documentation/3.4.0/common-files/dockerized/project-with-survey/survey_sampleData.js @@ -1,5298 +1,5206 @@ -const { ObjectId } = require("mongodb"); +const { ObjectId } = require('mongodb') let solutionData = [ - { - _id: new ObjectId("691c1b17266ef5649ce4104c"), - externalId: "691c1b15266ef5649ce4100d_CHILD", - isReusable: false, - name: "Observation led imp fro sanity 18-11", - description: "Classrom Observation for Selection of Sectors", - author: "2", - parentSolutionId: new ObjectId("691c1b15266ef5649ce4100d"), - resourceType: ["Observations Framework"], - language: ["English"], - keywords: ["Framework", "Observation", "English"], - concepts: [], - scoringSystem: "pointsBasedScoring", - levelToScoreMapping: { - L1: { - points: 10, - label: "Level 1", - }, - L2: { - points: 20, - label: "Level 2", - }, - L3: { - points: 30, - label: "Level 3", - }, - }, - themes: [ - { - name: "Domain 1", - type: "theme", - label: "theme", - externalId: "D1", - weightage: 1, - criteria: [ - { - criteriaId: new ObjectId("691c1b17266ef5649ce41042"), - weightage: 1, - }, - ], - rubric: { - expressionVariables: { - SCORE: "D1.sumOfPointsOfAllChildren()", - }, - levels: { - L1: { - expression: "(20<=SCORE<=35)", - }, - L2: { - expression: "(35 { const tempId = doc._id || `(Document Index: ${index})` try { const result = await collection.insertOne(doc) - - // The _id is either the one from the source doc or the generated one const finalId = result.insertedId || doc._id results.push({ @@ -83,7 +78,6 @@ async function insertData(collectionName, dataFile, currentDB = projectDB) { }) } catch (error) { if (error.code === DUPLICATE_KEY_ERROR_CODE) { - // This typically happens if the document has an _id or a unique index violation results.push({ id: tempId, status: 'DUPLICATE', @@ -120,8 +114,6 @@ async function insertData(collectionName, dataFile, currentDB = projectDB) { } } -// --- MAIN EXECUTION LOGIC --- - async function main({ dataToBeInserted }) { const collectionsToInsert = [ { name: 'entities', data: dataToBeInserted.entities, db: entityDB }, @@ -143,9 +135,7 @@ async function main({ dataToBeInserted }) { ) console.log(`=================================================`) - // 1. CLEANUP PHASE: Drop all relevant collections first for (const item of collectionsToInsert) { - // Only call cleanData if there is corresponding data to be inserted, to avoid dropping unrelated collections if (item.data) { await cleanData(item.name, item.db) } @@ -157,17 +147,13 @@ async function main({ dataToBeInserted }) { ) console.log(`=================================================`) - // 2. INSERTION PHASE: Insert new data for (const item of collectionsToInsert) { if (item.data) { - // The insertData function already handles the database selection via the last argument await insertData(item.name, item.data, item.db) } } } -// --- EXECUTION CALLS --- - main({ dataToBeInserted: entityData }) .then(() => { console.log('\n=======================================') diff --git a/documentation/3.4.0/common-files/native/project-with-survey/entity_sampleData.js b/documentation/3.4.0/common-files/native/project-with-survey/entity_sampleData.js index b0b3e335..aec6715a 100644 --- a/documentation/3.4.0/common-files/native/project-with-survey/entity_sampleData.js +++ b/documentation/3.4.0/common-files/native/project-with-survey/entity_sampleData.js @@ -287,4 +287,4 @@ let entities = [ module.exports = { entities, entityType, -} \ No newline at end of file +} diff --git a/documentation/3.4.0/common-files/native/project-with-survey/insert_sample_solutions.js b/documentation/3.4.0/common-files/native/project-with-survey/insert_sample_solutions.js index 6b02bb98..9710806d 100644 --- a/documentation/3.4.0/common-files/native/project-with-survey/insert_sample_solutions.js +++ b/documentation/3.4.0/common-files/native/project-with-survey/insert_sample_solutions.js @@ -3,10 +3,10 @@ const { MongoClient } = require('mongodb') const url = 'mongodb://localhost:27017/' // MongoDB URL const projectDB = 'elevate-project' const entityDB = 'elevate-entity' -const samikshaDB = "elevate-samiksha"; +const samikshaDB = 'elevate-samiksha' const entityData = require('./entity_sampleData.js') const projectData = require('./project_sampleData.js') -const surveyData = require("./survey_sampleData.js"); +const surveyData = require('./survey_sampleData.js') // MongoDB Error Code for Duplicate Key const DUPLICATE_KEY_ERROR_CODE = 11000 @@ -116,7 +116,6 @@ async function insertData(collectionName, dataFile, currentDB = projectDB) { } } - async function main({ dataToBeInserted }) { const collectionsToInsert = [ { name: 'entities', data: dataToBeInserted.entities, db: entityDB }, @@ -130,20 +129,21 @@ async function main({ dataToBeInserted }) { { name: 'projectCategories', data: dataToBeInserted.projectCategoriesData, db: projectDB }, { name: 'configurations', data: dataToBeInserted.configurationData, db: projectDB }, { name: 'organizationExtension', data: dataToBeInserted.organizationExtensionData, db: projectDB }, - { name: "solutions", data: dataToBeInserted.solutionData, db:samikshaDB}, - { name: "criteria", data:dataToBeInserted.criteriaData, db : samikshaDB}, - { name: "criteriaQuestions", data: dataToBeInserted.criteriaQuestionsData, db : samikshaDB}, - { name: "frameworks", data: dataToBeInserted.frameworkData, db : samikshaDB}, - { name: "questions", data: dataToBeInserted.questionsData, db : samikshaDB}, - { name: "observations", data: dataToBeInserted.observationData, db : samikshaDB}, - { name: "surveys", data: dataToBeInserted.surveyData, db : samikshaDB}, - { name: "organizationExtension", data: dataToBeInserted.organizationExtensionData, db : samikshaDB}, - + { name: 'solutions', data: dataToBeInserted.solutionData, db: samikshaDB }, + { name: 'criteria', data: dataToBeInserted.criteriaData, db: samikshaDB }, + { name: 'criteriaQuestions', data: dataToBeInserted.criteriaQuestionsData, db: samikshaDB }, + { name: 'frameworks', data: dataToBeInserted.frameworkData, db: samikshaDB }, + { name: 'questions', data: dataToBeInserted.questionsData, db: samikshaDB }, + { name: 'observations', data: dataToBeInserted.observationData, db: samikshaDB }, + { name: 'surveys', data: dataToBeInserted.surveyData, db: samikshaDB }, + { name: 'organizationExtension', data: dataToBeInserted.organizationExtensionData, db: samikshaDB }, ] console.log(`\n=================================================`) console.log( - `🗑️ Starting CLEANUP for ${dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data' } Collections...` + `🗑️ Starting CLEANUP for ${ + dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data' + } Collections...` ) console.log(`=================================================`) @@ -155,7 +155,9 @@ async function main({ dataToBeInserted }) { console.log(`\n=================================================`) console.log( - `➕ Starting INSERTION for ${dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data '} Collections...` + `➕ Starting INSERTION for ${ + dataToBeInserted === entityData ? 'Entity Data' : 'Project Data & Survey Data ' + } Collections...` ) console.log(`=================================================`) @@ -182,11 +184,10 @@ main({ dataToBeInserted: projectData }) }) .catch(console.error) - main({ dataToBeInserted: surveyData }) -.then(() => { - console.log('\n=======================================') - console.log('✅ survey data population process finished.') - console.log('=======================================') -}) -.catch(console.error) + .then(() => { + console.log('\n=======================================') + console.log('✅ survey data population process finished.') + console.log('=======================================') + }) + .catch(console.error) diff --git a/documentation/3.4.0/common-files/native/project-with-survey/project_sampleData.js b/documentation/3.4.0/common-files/native/project-with-survey/project_sampleData.js index 585a7fb4..ecf44d06 100644 --- a/documentation/3.4.0/common-files/native/project-with-survey/project_sampleData.js +++ b/documentation/3.4.0/common-files/native/project-with-survey/project_sampleData.js @@ -438,158 +438,159 @@ let programData = [ cluster: ['ALL'], school: ['ALL'], }, - },, - { - _id: new ObjectId("691c1b06e71d83091cf9c336"), - resourceType: ["program"], - language: ["English"], - keywords: [], - concepts: [], - components: [ - { - _id: new ObjectId("691c1b10e71d83091cf9c35d"), - order: 1, - }, - { - _id: new ObjectId("691c1b17266ef5649ce4104c"), - order: 2, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c474"), - order: 3, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c495"), - order: 4, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4b6"), - order: 5, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4da"), - order: 6, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c4fb"), - order: 7, - }, - { - _id: new ObjectId("691c1f96e71d83091cf9c51c"), - order: 8, - }, - { - _id: new ObjectId("691c1f96266ef5649ce41171"), - order: 9, - }, - ], - isAPrivateProgram: false, - isDeleted: false, - requestForPIIConsent: true, - rootOrganisations: [], - createdFor: [], - deleted: false, - status: "active", - owner: "1", - createdBy: "1", - updatedBy: "1", - externalId: "Testing_for_creation_sup_18_11", - name: "Testing for creation sup 18-11", - description: "This is the description of the program.", - metaInformation: { - state: ["Tripura"], - recommendedFor: ["student"], - }, - imageCompression: { - quality: 10, - }, - startDate: new Date("2025-11-16T18:30:00.000Z"), - endDate: new Date("2030-11-28T18:29:59.000Z"), - tenantId: 'default', - orgId: 'default_code', - updatedAt: new Date("2025-11-18T07:26:14.940Z"), - createdAt: new Date("2025-11-18T07:06:46.613Z"), - __v: 0, - scope: { - professional_role: ["6867a3c10d8d24001465c2d1"], - professional_subroles: ["6867a1420d8d24001465c28f"], - state: ["6863a9941d52e30014093ad9"], - district: ["6863aa5f1d52e30014093b41"], - block: ["ALL"], - cluster: ["ALL"], - school: ["ALL"], - }, - }, - { - _id: new ObjectId("691b10a0dbb768073d67328c"), - resourceType: ["program"], - language: ["English"], - keywords: [], - concepts: [], - components: [ - { - _id: new ObjectId("691b141a1ce3f5956e9f30e8"), - order: 1, - }, - { - _id: new ObjectId("691b1783dbb768073d67330d"), - order: 2, - }, - { - _id: new ObjectId("691b1790dbb768073d673366"), - order: 3, - }, - { - _id: new ObjectId("691b179e7b8c31191b8facee"), - order: 4, - }, - { - _id: new ObjectId("691b17ae1ce3f5956e9f319d"), - order: 5, - }, - { - _id: new ObjectId("691b192a1ce3f5956e9f320e"), - order: 6, - }, - ], - isAPrivateProgram: false, - isDeleted: false, - requestForPIIConsent: true, - rootOrganisations: [], - createdFor: [], - deleted: false, - status: "active", - owner: "1", - createdBy: "1", - updatedBy: "1", - externalId: "Testing_for_creation_sup_17_11", - name: "Testing for creation sup 17-11", - description: "This is the description of the program.", - metaInformation: { - state: ["Tripura"], - recommendedFor: ["student"], - }, - imageCompression: { - quality: 10, - }, - startDate: new Date("2025-11-16T18:30:00.000Z"), - endDate: new Date("2030-11-28T18:29:59.000Z"), - tenantId: 'default', - orgId: 'default_code', - updatedAt: new Date("2025-11-17T12:46:34.713Z"), - createdAt: new Date("2025-11-17T12:10:08.914Z"), - __v: 0, - scope: { - professional_role: ["6867a3c10d8d24001465c2d1"], - professional_subroles: ["6867a1420d8d24001465c28f"], - state: ["6863a9941d52e30014093ad9"], - district: ["6863aa5f1d52e30014093b41"], - block: ["ALL"], - cluster: ["ALL"], - school: ["ALL"], - }, - }, -]; + }, + , + { + _id: new ObjectId('691c1b06e71d83091cf9c336'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('691c1b10e71d83091cf9c35d'), + order: 1, + }, + { + _id: new ObjectId('691c1b17266ef5649ce4104c'), + order: 2, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c474'), + order: 3, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c495'), + order: 4, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4b6'), + order: 5, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4da'), + order: 6, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c4fb'), + order: 7, + }, + { + _id: new ObjectId('691c1f96e71d83091cf9c51c'), + order: 8, + }, + { + _id: new ObjectId('691c1f96266ef5649ce41171'), + order: 9, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_creation_sup_18_11', + name: 'Testing for creation sup 18-11', + description: 'This is the description of the program.', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['student'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-11-16T18:30:00.000Z'), + endDate: new Date('2030-11-28T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-11-18T07:26:14.940Z'), + createdAt: new Date('2025-11-18T07:06:46.613Z'), + __v: 0, + scope: { + professional_role: ['6867a3c10d8d24001465c2d1'], + professional_subroles: ['6867a1420d8d24001465c28f'], + state: ['6863a9941d52e30014093ad9'], + district: ['6863aa5f1d52e30014093b41'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, + { + _id: new ObjectId('691b10a0dbb768073d67328c'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('691b141a1ce3f5956e9f30e8'), + order: 1, + }, + { + _id: new ObjectId('691b1783dbb768073d67330d'), + order: 2, + }, + { + _id: new ObjectId('691b1790dbb768073d673366'), + order: 3, + }, + { + _id: new ObjectId('691b179e7b8c31191b8facee'), + order: 4, + }, + { + _id: new ObjectId('691b17ae1ce3f5956e9f319d'), + order: 5, + }, + { + _id: new ObjectId('691b192a1ce3f5956e9f320e'), + order: 6, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_creation_sup_17_11', + name: 'Testing for creation sup 17-11', + description: 'This is the description of the program.', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['student'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-11-16T18:30:00.000Z'), + endDate: new Date('2030-11-28T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-11-17T12:46:34.713Z'), + createdAt: new Date('2025-11-17T12:10:08.914Z'), + __v: 0, + scope: { + professional_role: ['6867a3c10d8d24001465c2d1'], + professional_subroles: ['6867a1420d8d24001465c28f'], + state: ['6863a9941d52e30014093ad9'], + district: ['6863aa5f1d52e30014093b41'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, +] let projectTemplatesData = [ { @@ -1476,139 +1477,136 @@ let projectTemplateTasksData = [ updatedAt: new Date('2025-09-24T09:28:14.374Z'), createdAt: new Date('2025-09-24T09:28:07.083Z'), __v: 0, - },, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d75"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [], - deleted: false, - type: "observation", - solutionDetails: { - type: "observation", - subType: "Social Studies", - _id: "68ee4bb440fd155dceef08a9", - externalId: - "fb34d196-a8fe-11f0-9793-553f35f97dd1-OBSERVATION-TEMPLATE-1760447411986", - name: "obsasatask oct 8 facilitator only 2nd", - isReusable: false, - minNoOfSubmissionsRequired: "2.0", - }, - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Review the Activity Manual", - externalId: "DPDTSC-HandBook-1-2025-Task1-1760447411369-1760447411984", - description: "", - sequenceNumber: "1", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "True", - minNoOfSubmissionsRequired: "2.0", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.146Z"), - createdAt: new Date("2025-10-14T13:10:11.744Z"), - __v: 0, - }, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d7e"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [], - deleted: false, - type: "simple", - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Conduct the Activity with students", - externalId: "DPDTSC-HandBook-1-2025-Task3-1760447411369-1760447412197", - description: "", - sequenceNumber: "3", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "", - minNoOfSubmissionsRequired: "", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.202Z"), - createdAt: new Date("2025-10-14T13:10:11.813Z"), - __v: 0, - }, - { - _id: new ObjectId("68ee4bb4fb9bee08b93b6d82"), - createdBy: "1", - updatedBy: "1", - isDeleted: false, - isDeletable: false, - taskSequence: [], - children: [], - visibleIf: [], - hasSubTasks: false, - learningResources: [ - { - name: "learn", - link: "https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link", - app: "projectService", - id: "view?usp=drive_link", - }, - ], - deleted: false, - type: "content", - projectTemplateId: new ObjectId("68ee4bb3fb9bee08b93b6d70"), - projectTemplateExternalId: - "PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED", - name: "Conduct the Activity Assessment", - externalId: "DPDTSC-HandBook-1-2025-Task4-1760447411369-1760447412206", - description: "", - sequenceNumber: "4", - tenantId: "default", - orgId: "default_code", - metaInformation: { - hasAParentTask: "NO", - parentTaskOperator: "", - parentTaskValue: "", - parentTaskId: "", - startDate: "01/08/2025", - endDate: "31/12/2025", - isAnExternalTask: "", - minNoOfSubmissionsRequired: "", - redirectLink: "", - buttonLabel: "", - }, - updatedAt: new Date("2025-10-14T13:10:12.210Z"), - createdAt: new Date("2025-10-14T13:10:11.825Z"), - __v: 0, - }, -]; + }, + , + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d75'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'observation', + solutionDetails: { + type: 'observation', + subType: 'Social Studies', + _id: '68ee4bb440fd155dceef08a9', + externalId: 'fb34d196-a8fe-11f0-9793-553f35f97dd1-OBSERVATION-TEMPLATE-1760447411986', + name: 'obsasatask oct 8 facilitator only 2nd', + isReusable: false, + minNoOfSubmissionsRequired: '2.0', + }, + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Review the Activity Manual', + externalId: 'DPDTSC-HandBook-1-2025-Task1-1760447411369-1760447411984', + description: '', + sequenceNumber: '1', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: 'True', + minNoOfSubmissionsRequired: '2.0', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.146Z'), + createdAt: new Date('2025-10-14T13:10:11.744Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d7e'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'DPDTSC-HandBook-1-2025-Task3-1760447411369-1760447412197', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.202Z'), + createdAt: new Date('2025-10-14T13:10:11.813Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d82'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'learn', + link: 'https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link', + app: 'projectService', + id: 'view?usp=drive_link', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity Assessment', + externalId: 'DPDTSC-HandBook-1-2025-Task4-1760447411369-1760447412206', + description: '', + sequenceNumber: '4', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.210Z'), + createdAt: new Date('2025-10-14T13:10:11.825Z'), + __v: 0, + }, +] let certificateTemplatesData = [ { @@ -1925,5 +1923,5 @@ module.exports = { certificateBaseTemplatesData, projectCategoriesData, configurationData, - organizationExtensionData + organizationExtensionData, } diff --git a/documentation/3.4.0/common-files/native/project-with-survey/survey_sampleData.js b/documentation/3.4.0/common-files/native/project-with-survey/survey_sampleData.js index ec74f678..1928b075 100644 --- a/documentation/3.4.0/common-files/native/project-with-survey/survey_sampleData.js +++ b/documentation/3.4.0/common-files/native/project-with-survey/survey_sampleData.js @@ -1,5298 +1,5206 @@ -const { ObjectId } = require("mongodb"); +const { ObjectId } = require('mongodb') let solutionData = [ - { - _id: new ObjectId("691c1b17266ef5649ce4104c"), - externalId: "691c1b15266ef5649ce4100d_CHILD", - isReusable: false, - name: "Observation led imp fro sanity 18-11", - description: "Classrom Observation for Selection of Sectors", - author: "2", - parentSolutionId: new ObjectId("691c1b15266ef5649ce4100d"), - resourceType: ["Observations Framework"], - language: ["English"], - keywords: ["Framework", "Observation", "English"], - concepts: [], - scoringSystem: "pointsBasedScoring", - levelToScoreMapping: { - L1: { - points: 10, - label: "Level 1", - }, - L2: { - points: 20, - label: "Level 2", - }, - L3: { - points: 30, - label: "Level 3", - }, - }, - themes: [ - { - name: "Domain 1", - type: "theme", - label: "theme", - externalId: "D1", - weightage: 1, - criteria: [ - { - criteriaId: new ObjectId("691c1b17266ef5649ce41042"), - weightage: 1, - }, - ], - rubric: { - expressionVariables: { - SCORE: "D1.sumOfPointsOfAllChildren()", - }, - levels: { - L1: { - expression: "(20<=SCORE<=35)", - }, - L2: { - expression: "(35 + bash -c "echo 'Waiting for PostgreSQL on citus_master:5432 to accept connections...' && + while ! timeout 1 bash -c 'cat < /dev/null > /dev/tcp/citus_master/5432' 2> /dev/null; do + echo 'Waiting for citus_master to be ready...'; + sleep 1; + done; + echo 'Database is ready.'; + npm run db:init && npm run db:seed:all && + (echo 'Running nodeee' && nodemon app.js &) && + (while ! curl -sSf http://user:3001 > /dev/null; do + sleep 1; + done && echo 'Service is up' && + /bin/bash -c 'cd scripts && echo Running user service scripts && node -r module-alias/register uploadSampleCSV.js'); + tail -f /dev/null" + depends_on: + - kafka + - citus + - redis + - scheduler + environment: + - DEV_DATABASE_URL=postgres://postgres:postgres@citus_master:5432/user + - KAFKA_URL=kafka:9092 + - REDIS_HOST=redis://redis:6379 + volumes: + - ./user:/usr/src/app + networks: + - project_net + env_file: + - ./user_env + + notification: + image: shikshalokamqa/elevate-notification:2.6.1 + container_name: notification + ports: + - '3002:3002' + command: > + bash -c "echo 'Waiting for PostgreSQL on citus_master:5432 to accept connections...' && + while ! timeout 1 bash -c 'cat < /dev/null > /dev/tcp/citus_master/5432' 2> /dev/null; do + echo 'Waiting for citus_master to be ready...'; + sleep 1; + done; + echo 'Database is ready.'; + npm run db:init && nodemon app.js" + depends_on: + - kafka + - citus + environment: + - KAFKA_HOST=kafka:9092 + - DEV_DATABASE_URL=postgres://postgres:postgres@citus_master:5432/notification + networks: + - project_net + env_file: + - ./notification_env + + scheduler: + image: shikshalokamqa/elevate-scheduler:2.6.1 + container_name: scheduler + ports: + - '4000:4000' + command: ['nodemon', 'app.js'] + depends_on: + kafka: + condition: service_healthy + redis: + condition: service_started + networks: + - project_net + env_file: + - ./scheduler_env + interface: + image: shikshalokamqa/elevate-interface:3.3.2 + container_name: interface + ports: + - '3569:3569' + command: ['node', 'app.js'] + networks: + - project_net + env_file: + - ./interface_env + citus: + image: citusdata/citus:11.2.0 + container_name: 'citus_master' + platform: linux/amd64 + ports: + - 5432:5432 + expose: + - 5432 + environment: &AUTH + POSTGRES_USER: '${POSTGRES_USER:-postgres}' + POSTGRES_PASSWORD: '${POSTGRES_PASSWORD:-postgres}' + PGUSER: '${POSTGRES_USER:-postgres}' + PGPASSWORD: '${POSTGRES_PASSWORD:-postgres}' + POSTGRES_DB: 'postgres' + POSTGRES_HOST_AUTH_METHOD: '${POSTGRES_HOST_AUTH_METHOD:-trust}' + POSTGRES_LOG_STATEMENT: 'all' # Enable query logging (set to 'all' for all queries) + networks: + - project_net + #volumes: + # - citus-data:/var/lib/postgresql/data + pgadmin: + image: dpage/pgadmin4 + container_name: elevate-pgadmin + restart: always + ports: + - '5500:80' + environment: + - PGADMIN_DEFAULT_EMAIL=user@shikshalokam.org + - PGADMIN_DEFAULT_PASSWORD=password + networks: + - project_net + # logging: + # driver: none + + # Mongo config + mongo: + image: 'mongo:4.4.14' + container_name: mongo + restart: 'always' + ports: + - '27017:27017' + networks: + - project_net + # volumes: + # - mongo-data:/data/db + # logging: + # driver: none + + # Gotenberg config + gotenberg: + image: gotenberg/gotenberg:latest + container_name: gotenberg + ports: + - '3003:3000' + networks: + - project_net + restart: 'always' + + portal: + image: shikshalokamqa/elevate-project-obervation-pwa:3.4.0 + container_name: portal + ports: + - '7007:7007' + volumes: + - ./env.js:/usr/src/app/www/assets/env/env.js + command: > + /bin/bash -c "ionic build --prod && ionic serve --host 0.0.0.0" + networks: + - project_net + scp: + image: shikshalokamqa/elevate-scp-service:pre-release-1.0 + container_name: survey-project-creation-service + ports: + - '6001:6001' + command: > + bash -c "echo 'Waiting for PostgreSQL on citus_master:5432 to accept connections...' && + while ! timeout 1 bash -c 'cat < /dev/null > /dev/tcp/citus_master/5432' 2> /dev/null; do + echo 'Waiting for citus_master to be ready...'; + sleep 1; + done; + echo 'Database is ready.'; + echo 'Creating config.json from config-sample.json...'; + if [ -f /var/src/config-sample.json ]; then + cp /var/src/config-sample.json /var/src/config.json; + echo 'config.json created successfully'; + else + echo 'ERROR: config-sample.json not found'; + exit 1; + fi; + npm run db:init && + (echo 'Running nodeee' && nodemon app.js &) && + (while ! curl -sSf http://scp:6001 > /dev/null; do + sleep 1; + done && echo 'Service is up' && + /bin/bash -c 'cd scripts && echo Running scp service scripts && node addDefaultEntitiesForEducationSector.js'); + tail -f /dev/null" + env_file: + - ./survey_project_creation_env + networks: + - project_net +networks: + project_net: + external: false +#volumes: +# mongo-data: +# citus-data: diff --git a/documentation/3.4.0/dockerized/envs/entity_management_env b/documentation/3.4.0/dockerized/envs/entity_management_env index 8f530d17..b784c0d4 100644 --- a/documentation/3.4.0/dockerized/envs/entity_management_env +++ b/documentation/3.4.0/dockerized/envs/entity_management_env @@ -1,23 +1,22 @@ -APPLICATION_PORT = 5001 -APPLICATION_ENV ="development" +APPLICATION_PORT=5001 +APPLICATION_ENV="development" APPLICATION_BASE_URL='/entity-management/' -INTERNAL_ACCESS_TOKEN =xahusub12yexlashsbxAXADHBlaj +INTERNAL_ACCESS_TOKEN=xahusub12yexlashsbxAXADHBlaj ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj MONGODB_URL=mongodb://mongo:27017/elevate-entity -AUTH_METHOD = native -USER_SERVICE_URL = http://interface:3569 +AUTH_METHOD=native +USER_SERVICE_URL=http://interface:3569 USER_SERVICE_BASE_URL=/user +SERVICE_NAME=elevate-entity-service KAFKA_HEALTH_CHECK_TOPIC=test -SERVICE_NAME = elevate-entity-service API_DOC_URL="https://entity-management/entity-management/api-doc" APPLICATION_HOST=entity_management IS_AUTH_TOKEN_BEARER="false" ADMIN_ACCESS_TOKEN=rwwee3$123 ADMIN_TOKEN_HEADER_NAME="admin-auth-token" INTERFACE_SERVICE_URL=http://interface:3569 -KAFKA_HEALTH_CHECK_TOPIC = entity-health-check-topic-check -KAFKA_COMMUNICATIONS_ON_OFF = ON +KAFKA_HEALTH_CHECK_TOPIC=entity-health-check-topic-check +KAFKA_COMMUNICATIONS_ON_OFF=ON KAFKA_URL=kafka:9092 -KAFKA_COMMUNICATIONS_ON_OFF = ON -KAFKA_GROUP_ID = entity -HEALTH_CHECK_DEBUG_MODE = true \ No newline at end of file +KAFKA_GROUP_ID=entity +HEALTH_CHECK_DEBUG_MODE=true diff --git a/documentation/3.4.0/dockerized/envs/env.js b/documentation/3.4.0/dockerized/envs/env.js index 9606a60a..923660d5 100644 --- a/documentation/3.4.0/dockerized/envs/env.js +++ b/documentation/3.4.0/dockerized/envs/env.js @@ -1,6 +1,6 @@ window['env'] = { production: true, - baseURL: 'https://qa.elevate-apis.shikshalokam.org', + baseURL: 'http://interface:3569', capabilities: 'all', restrictedPages: ['DOWNLOADS', 'AUTH_PAGES', 'PROFILE', 'EDIT_PROFILE'], unauthorizedRedirectUrl: '/', diff --git a/documentation/3.4.0/dockerized/envs/interface_env b/documentation/3.4.0/dockerized/envs/interface_env index e0119e8d..53e46aa9 100644 --- a/documentation/3.4.0/dockerized/envs/interface_env +++ b/documentation/3.4.0/dockerized/envs/interface_env @@ -17,6 +17,7 @@ REQUIRED_PACKAGES=elevate-mentoring@1.2.90 elevate-survey-observation@1.0.22 ele ROUTE_CONFIG_JSON_URLS_PATHS=https://raw.githubusercontent.com/ELEVATE-Project/utils/refs/heads/develop/interface-routes/elevate-routes.json SAAS_NOTIFICATION_BASE_URL=interface/v1/notification/send-raw SAAS_NOTIFICATION_SEND_EMAIL_ROUTE=interface/v1/notification/send-raw +SELF-CREATION-PORTAL_SERVICE_BASE_URL=http://scp:6001 SAMIKSHA_SERVICE_BASE_URL=http://localhost:4301 SCHEDULER_SERVICE_BASE_URL=http://localhost:7401 SUPPORTED_HTTP_TYPES=GET POST PUT PATCH DELETE diff --git a/documentation/3.4.0/dockerized/envs/notification_env b/documentation/3.4.0/dockerized/envs/notification_env index c821b118..e726ef56 100644 --- a/documentation/3.4.0/dockerized/envs/notification_env +++ b/documentation/3.4.0/dockerized/envs/notification_env @@ -9,4 +9,4 @@ RABBITMQ_URL=amqp://rabbitmq:5672 # Application PORT=3002 -NODE_ENV=development \ No newline at end of file +NODE_ENV=development diff --git a/documentation/3.4.0/dockerized/envs/project_env b/documentation/3.4.0/dockerized/envs/project_env index 2494e2b2..e0aeb03a 100644 --- a/documentation/3.4.0/dockerized/envs/project_env +++ b/documentation/3.4.0/dockerized/envs/project_env @@ -1,49 +1,64 @@ -APPLICATION_PORT = 6000 -APPLICATION_ENV = development +APPLICATION_PORT=6000 +APPLICATION_ENV=development ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj -INTERNAL_ACCESS_TOKEN =xahusub12yexlashsbxAXADHBlaj -MONGODB_URL = mongodb://mongodb:27017/elevate-project -KEYCLOAK_PUBLIC_KEY_PATH = keycloak-public-keys -KAFKA_COMMUNICATIONS_ON_OFF = ON -KAFKA_URL =kafka:9092 -KAFKA_GROUP_ID = projects -KAFKA_HEALTH_CHECK_TOPIC = project-health-check-topic-check +INTERNAL_ACCESS_TOKEN=xahusub12yexlashsbxAXADHBlaj +MONGODB_URL=mongodb://mongodb:27017/elevate-project +KEYCLOAK_PUBLIC_KEY_PATH=keycloak-public-keys +KAFKA_COMMUNICATIONS_ON_OFF=ON +KAFKA_URL=kafka:9092 +KAFKA_GROUP_ID=projects +KAFKA_HEALTH_CHECK_TOPIC=project-health-check-topic-check PROJECT_SUBMISSION_TOPIC=sl-improvement-project-submission-dev SUBMISSION_TOPIC = Projectsubmissions PROJECT_CERTIFICATE_TOPIC = generateProjectCertificate ELEVATE_PROJECT_SERVICE_URL=http://project:6000 -SERVICE_NAME = project -USER_DELETE_TOPIC = deleteuser +SERVICE_NAME=project +USER_DELETE_TOPIC=deleteuser TELEMETRY_TOPIC=telemetry.raw -ID = projectservice +ID=projectservice TELEMETRY_ON_OFF=ON -USER_DELETE_ON_OFF=OFF +USER_DELETE_ON_OFF=ON CLOUD_STORAGE=ON -TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC = +05:30 -VALIDATE_ENTITIES = ON -APP_PORTAL_BASE_URL =http://portal:7007 -NO_OF_MINUTES = 30 -NO_OF_EXPIRY_TIME = 60 -PRESIGNED_URL_EXPIRY_IN_SECONDS = 300 -DOWNLOADABLE_URL_EXPIRY_IN_SECONDS = 300 -DEFAULT_ORGANISATION_CODE = 1 +TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC=+05:30 +VALIDATE_ENTITIES=ON +APP_PORTAL_BASE_URL=http://portal:7007 +NO_OF_MINUTES=30 +NO_OF_EXPIRY_TIME=60 +PRESIGNED_URL_EXPIRY_IN_SECONDS=300 +DOWNLOADABLE_URL_EXPIRY_IN_SECONDS=300 +DEFAULT_ORGANISATION_CODE=default_code GOTENBERG_URL=http://gotenberg:3000 API_DOC_URL="http://project/project/api-doc" -INTERFACE_SERVICE_URL = http://interface:3569 -USER_SERVICE_BASE_URL = "/user" -ENTITY_MANAGEMENT_SERVICE_BASE_URL = "/entity-management" +INTERFACE_SERVICE_URL=http://interface:3569 +USER_SERVICE_BASE_URL="/user" +ENTITY_MANAGEMENT_SERVICE_BASE_URL="/entity-management" CLOUD_STORAGE_PROVIDER=gcloud -CLOUD_STORAGE_ACCOUNTNAME=CLOUD_STORAGE_ACCOUNTNAME -CLOUD_STORAGE_SECRET="CLOUD_STORAGE_SECRET" -CLOUD_STORAGE_BUCKETNAME=CLOUD_STORAGE_BUCKETNAME +CLOUD_STORAGE_ACCOUNTNAME=project-storage +CLOUD_STORAGE_SECRET=AKIAIOSFODNN7EXAMPLE +CLOUD_STORAGE_BUCKETNAME=project-storage-bucket CLOUD_STORAGE_BUCKET_TYPE=private -ADMIN_ACCESS_TOKEN = N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl -ADMIN_AUTH_TOKEN = N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl -ADMIN_TOKEN_HEADER_NAME = 'admin-auth-token' -IS_AUTH_TOKEN_BEARER = false -AUTH_METHOD = native +ADMIN_ACCESS_TOKEN=N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl +ADMIN_AUTH_TOKEN=N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl +ADMIN_TOKEN_HEADER_NAME='admin-auth-token' +IS_AUTH_TOKEN_BEARER=false +AUTH_METHOD=native REDIS_HOST=redis://redis:6379 PUBLIC_ASSET_BUCKETNAME=mentoring-storage-public -USER_SERVICE_URL = http://user:3569 +USER_SERVICE_URL=http://user:3569 RESOURCE_DELETION_TOPIC=RESOURCE_DELETION_TOPIC -CLOUD_STORAGE_PROJECT =sl-project \ No newline at end of file +CLOUD_STORAGE_PROJECT=sl-project +APPLICATION_BASE_URL=/project/ +APPLICATION_HOST=project +AUTH_CONFIG_FILE_PATH=config.json +ENABLE_REFLECTION=true +ENTITY_BASE_URL=http://interface:3569 +ENTITY_MONGODB_URL=mongodb://mongo:27017/elevate_entity +ORGANIZATION_EXTENSION_TOPIC=dev.organizationEvent +ORG_ID_HEADER_NAME=Org-id +ORG_UPDATES_TOPIC=dev.organizationEvent +PROGRAM_USER_MAPPING_TOPIC=dev.program +SESSION_VERIFICATION_METHOD=user_service_authenticated +SUBMISSION_LEVEL=USER +USER_ACCOUNT_EVENT_TOPIC=dev.userCreate +USER_ACTIVITY_TOPIC=dev-user-activities + diff --git a/documentation/3.4.0/dockerized/envs/scp/interface_env b/documentation/3.4.0/dockerized/envs/scp/interface_env new file mode 100644 index 00000000..fc58ff0e --- /dev/null +++ b/documentation/3.4.0/dockerized/envs/scp/interface_env @@ -0,0 +1,26 @@ +API_DOC_URL=/interface/api-doc +APPLICATION_ENV=development +APPLICATION_PORT=3569 +ELEVATE_NOTIFICATION_KAFKA_BROKERS=kafka:9092 +ELEVATE_NOTIFICATION_KAFKA_GROUP_ID=mentoring +ELEVATE_NOTIFICATION_KAFKA_TOPIC=dev.notification +ENTITY_SERVICE_BASE_URL=http://entity_management:5001 +INSTALLED_PACKAGES=elevate-mentoring elevate-survey-observation@1.0.1 elevate-self-creation-portal +MENTORING_SERVICE_BASE_URL=http://mentoring:7101 +NOTIFICATION_SERVICE_BASE_URL=http://notification:7201 +PROJECT_SERVICE_BASE_URL=http://project:6000 +RATE_LIMITER_ENABLED=true +RATE_LIMITER_GENERAL_LIMIT=500 +RATE_LIMITER_NUMBER_OF_PROXIES=3 +RATE_LIMITER_PUBLIC_LOW_LIMIT=5 +REQUIRED_BASE_PACKAGES=elevate-mentoring elevate-project elevate-survey-observation self-creation-portal +REQUIRED_PACKAGES=elevate-mentoring@1.2.90 elevate-survey-observation@1.0.22 elevate-project@1.1.53 shiksha-notification@1.1.3 elevate-self-creation-portal@1.0.70 +ROUTE_CONFIG_JSON_URLS_PATHS=https://raw.githubusercontent.com/ELEVATE-Project/utils/refs/heads/develop/interface-routes/elevate-routes.json +SAAS_NOTIFICATION_BASE_URL=interface/v1/notification/send-raw +SAAS_NOTIFICATION_SEND_EMAIL_ROUTE=interface/v1/notification/send-raw +SAMIKSHA_SERVICE_BASE_URL=http://survey:5007 +SCHEDULER_SERVICE_BASE_URL=http://scheduler:7401 +SELF-CREATION-PORTAL_SERVICE_BASE_URL=http://scp:6001 +SUPPORTED_HTTP_TYPES=GET POST PUT PATCH DELETE +SURVEY_SERVICE_BASE_URL=http://survey:5007 +USER_SERVICE_BASE_URL=http://user:3001 \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/envs/scp/survey_project_creation_env b/documentation/3.4.0/dockerized/envs/scp/survey_project_creation_env new file mode 100644 index 00000000..3ab13486 --- /dev/null +++ b/documentation/3.4.0/dockerized/envs/scp/survey_project_creation_env @@ -0,0 +1,91 @@ +ACCESS_TOKEN_EXPIRY=30m +ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj +API_DOC_URL=/scp/api-doc +APPLICATION_BASE_URL=/scp/ +APPLICATION_ENV=development +APPLICATION_HOST=scp +APPLICATION_PORT=6001 +AUTH_CONFIG_FILE_PATH=config.json +AUTH_METHOD=native +AUTH_TOKEN_HEADER_NAME=x-auth-token +BROWSE_EXISTING_END_POINT=v1/internal/getAllPublishedResources +CLEAR_INTERNAL_CACHE=scpinternal +#Cloud storage details +CLOUD_ENDPOINT=s3.ap-south-1.amazonaws.com +CLOUD_STORAGE=aws +CLOUD_STORAGE_ACCOUNTNAME=project-scp-storage +CLOUD_STORAGE_BUCKETNAME=scp-prod-storage-private +CLOUD_STORAGE_PROVIDER=aws +CLOUD_STORAGE_REGION=ap-south-1 +CLOUD_STORAGE_SECRET=AKIAIOSFODNN7EXAMPLE +CLOUD_STORAGE_BUCKET_TYPE=private +PUBLIC_ASSET_BUCKETNAME=scp-public-assets +CONSUMPTION_SERVICE=elevate +CONSUMPTION_SERVICE_BASE_URL=/project/ +CONSUMPTION_SERVICE_DOWNLOADBLE_URL=v1/cloud-services/files/download +CONSUMPTION_SERVICE_ENTITY_MANAGEMENT_BASE_URL=/entity-management/ +CONSUMPTION_SERVICE_PRESIGNED_URL=v1/cloud-services/files/preSignedUrls +DEFAULT_ADMIN_ROLE=admin +DEFAULT_CONTENT_CREATOR_ROLE=content_creator +DEFAULT_DATA_MANAGERS=program_manager +DEFAULT_ORGANIZATION_CODE=default_code +DEFAULT_ORG_ADMIN_ROLE=org_admin +DEFAULT_ORG_ID=default_code +DEFAULT_PROGRAM_DESIGNER_ROLES=program_designer +DEFAULT_PROGRAM_MANAGERS=program_manager +DEFAULT_REVIEWER_ROLE=reviewer +DEFAULT_ROLLOUT_ROLES=rollout_manager +DEFAULT_TENANT_CODE=default +DEV_DATABASE_URL=postgres://postgres:postgres@citus_master:5432/scp +DISABLE_LOG=false +ENABLE_ENTITY_TAGGING_IN_PROJECTS=false +ENABLE_OBSERVATION_IN_PROJECTS=true +ENABLE_TASK_START_END_DATE_IN_PROJECTS=false +ENTITY_MANAGEMENT_SERVICE_NAME=/entity-management/ +ERROR_LOG_LEVEL=silly +HIGHEST_IN_ENTITY_HIERARCHY=state +INTERFACE_SERVICE_HOST=http://interface:3569 +INTERNAL_ACCESS_TOKEN=xahusub12yexlashsbxAXADHBlaj +INTERNAL_CACHE_EXP_TIME=86400 +IS_AUTH_TOKEN_BEARER=false +KAFKA_COMMUNICATIONS_ON_OFF=ON +KAFKA_GROUP_ID=scp +KAFKA_URL=kafka:9092 +MAX_BODY_LENGTH_FOR_UPLOAD=5242880 +MAX_PROJECT_TASK_COUNT=10 +MAX_RESOURCE_NOTE_LENGTH=200 +MIN_APPROVAL=1 +MONGODB_URL=mongodb://mongo:27017/elevate-project +MONGO_DB_MODE=individual +NOTIFICATION_KAFKA_TOPIC=dev.notification +OBSERVATION_DEEP_LINK_REGEX=^https://portal/view/observation/[a-f0-9]{32}$ +ORGANIZATION_LIST_ENDPOINT=v1/organization/list +ORGANIZATION_READ_ENDPOINT=v1/organization/read +ORG_ID_HEADER_NAME=organization-id +PROGRAM_META_INFO_KEYS=state,recommendedFor +PROGRAM_PUBLISH_KAFKA_TOPIC=dev.programpublish +PROJECT_DEEP_LINK_URL=https://portal/view/project/ +PROJECT_MONGO_DB_URL=mongodb://mongodb:27017/elevate-project +PROJECT_PUBLISH_END_POINT=v1/scp/publishTemplateAndTasks +PROJECT_PUBLISH_KAFKA_TOPIC=dev.projectpublish +PROJECT_REFLECTION_TASK_REDIRECT_URL=https://elevate-mitra.shikshalokam.org/mohini/sso?flow=guest-mi-story +PROJECT_SERVICE_BASE_URL=/project/ +REDIS_HOST=redis://redis:6379 +RESOURCE_AUTO_SAVE_TIMER=30000 +RESOURCE_KAFKA_PUSH_ON_OFF=ON +RESOURCE_TYPES=project,observation,observation_with_rubric,survey,program +REVIEW_REQUIRED=true +REVIEW_REQUIRED_AFTER_PUBLISH=true +REVIEW_TYPE=SEQUENTIAL +ROLLOUT_PUBLISH_KAFKA_TOPIC=dev.rolloutpublish +SESSION_VERIFICATION_METHOD=user_service_authenticated +SHOW_REVIEWER_LIST=true +SURVEY_MONGO_DB_URL=mongodb://mongo:27017/elevate-samiksha +SURVEY_SERVICE_BASE_URL=/survey/ +TENANT_ID_HEADER_NAME=tenant-id +USER_LIST_ENDPOINT=v1/account/search +USER_PROFILE_DETAILS_ENDPOINT=v1/user/read +USER_SERVICE_BASE_URL=/user/ +USER_SERVICE_HOST=http://interface:3569 +USER_SERVICE_ORG_UPDATE_TOPIC=dev.organizationEvent +USER_SERVICE_TENANT_CREATION_TOPIC=dev.tenantEvent \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/envs/user_env b/documentation/3.4.0/dockerized/envs/user_env index c72a1d2c..b68d74a4 100644 --- a/documentation/3.4.0/dockerized/envs/user_env +++ b/documentation/3.4.0/dockerized/envs/user_env @@ -79,7 +79,7 @@ CAPTCHA_ENABLE=false RECAPTCHA_SECRET_KEY="6LfWEKYpAAAAAJS0eukS2Su_5vwlXRs5vPbC34W0" ALLOWED_IDLE_TIME=1200000 APPLICATION_BASE_URL="/user" -ENTITY_MANAGEMENT_SERVICE_BASE_URL="http://interface:3569/entity-management/" +ENTITY_MANAGEMENT_SERVICE_BASE_URL="/entity-management" IS_AUTH_TOKEN_BEARER=false DEFAULT_TENANT_ORG_CODE=default_code DEFAULT_TENANT_ORG_NAME="Default Organization" @@ -97,3 +97,4 @@ SERVICE_NAME="UserService" SIGNED_URL_EXPIRY_IN_SECONDS="900" ORG_CODE_HEADER_NAME=organization-id ORG_ID_HEADER_NAME=organization-id +TENANT_CODE_HEADER_NAME=tenant-id diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/citus_setup.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/citus_setup.sh new file mode 100644 index 00000000..861094d4 --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/citus_setup.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# Exit on error +set -e + +# Ensure correct number of arguments are provided +if [ $# -lt 2 ]; then + echo "Error: Folder name and database URL not provided. Usage: $0 " + exit 1 +fi + +# Use the provided folder name +FOLDER_NAME="$1" + +# Check if folder exists +if [ ! -d "$FOLDER_NAME" ]; then + echo "Error: Folder '$FOLDER_NAME' not found." + exit 1 +fi + +# Use the provided database URL +DEV_DATABASE_URL="$2" + +# Extract database credentials and connection details using awk for portability +DB_USER=$(echo $DEV_DATABASE_URL | awk -F '[:@/]' '{print $4}') +DB_PASSWORD=$(echo $DEV_DATABASE_URL | awk -F '[:@/]' '{print $5}') +DB_HOST=$(echo $DEV_DATABASE_URL | awk -F '[:@/]' '{print $6}') +DB_PORT=$(echo $DEV_DATABASE_URL | awk -F '[:@/]' '{split($7,a,"/"); print a[1]}') +DB_NAME=$(echo $DEV_DATABASE_URL | awk -F '/' '{print $NF}') + +# Log database variables +echo "Extracted Database Variables:" +echo "DB_USER: $DB_USER" +echo "DB_PASSWORD: $DB_PASSWORD" +echo "DB_HOST: $DB_HOST" +echo "DB_PORT: $DB_PORT" +echo "DB_NAME: $DB_NAME" + +# Define the container name (same as DB_HOST) +CONTAINER_NAME="$DB_HOST" + +# Wait for Docker container to be up +echo "Waiting for Docker container '$CONTAINER_NAME' to be up..." +while ! docker inspect "$CONTAINER_NAME" &>/dev/null; do + echo "Waiting for container..." + sleep 1 +done +echo "Container is now up." + +# Wait for PostgreSQL to be ready to accept connections +echo "Waiting for PostgreSQL on '$DB_HOST:$DB_PORT' to accept connections..." +until docker exec "$CONTAINER_NAME" bash -c "pg_isready -h localhost -p $DB_PORT -U $DB_USER"; do + echo "Waiting for database to be ready..." + sleep 1 +done +echo "Database is ready." + +# Function to check if the database exists +check_database() { + docker exec "$CONTAINER_NAME" bash -c "PGPASSWORD='$DB_PASSWORD' psql -h localhost -U $DB_USER -p $DB_PORT -lqt | cut -d \| -f 1 | grep -qw '$DB_NAME'" +} + +echo "Checking existence of database '$DB_NAME'..." +until check_database; do + echo "Database '$DB_NAME' does not exist, waiting..." + sleep 5 +done +echo "Database '$DB_NAME' exists, proceeding with script." + +# Retrieve and prepare SQL file operations +DISTRIBUTION_COLUMNS_FILE="$FOLDER_NAME/distributionColumns.sql" +if [ ! -f "$DISTRIBUTION_COLUMNS_FILE" ]; then + echo "Error: distributionColumns.sql not found in folder '$FOLDER_NAME'." + exit 1 +fi +echo "Copying distributionColumns.sql to container '$CONTAINER_NAME'..." +docker cp "$DISTRIBUTION_COLUMNS_FILE" "$CONTAINER_NAME:/distributionColumns.sql" + +echo "Creating Citus extension in the database..." +docker exec --user "$DB_USER" "$CONTAINER_NAME" bash -c "PGPASSWORD='$DB_PASSWORD' psql -h localhost -U $DB_USER -d $DB_NAME -p $DB_PORT -c 'CREATE EXTENSION IF NOT EXISTS citus;'" + +# Function to check if table exists +check_table() { + local table=$1 + local exists=$(docker exec "$CONTAINER_NAME" bash -c "PGPASSWORD='$DB_PASSWORD' psql -h localhost -U $DB_USER -d $DB_NAME -p $DB_PORT -t -c \"SELECT EXISTS(SELECT 1 FROM pg_tables WHERE schemaname = 'public' AND tablename = '$table');\"") + exists=$(echo "$exists" | tr -d '[:space:]') # Trim whitespace + echo "Debug: exists result for table $table = '$exists'" # Debug line + [[ "$exists" == "t" ]] # Checking specifically for 't' +} + +# Execute the SQL file with checks for table existence +echo "Creating distribution columns..." +while IFS= read -r line; do + if [[ $line =~ create_distributed_table\(\'([^\']+)\', ]]; then + table="${BASH_REMATCH[1]}" + echo "Checking existence of table '$table'..." + until check_table "$table"; do + echo "Table '$table' does not exist, waiting..." + sleep 1 + done + echo "Table '$table' exists, executing: $line" + docker exec --user "$DB_USER" "$CONTAINER_NAME" bash -c "PGPASSWORD='$DB_PASSWORD' psql -h localhost -U $DB_USER -d $DB_NAME -p $DB_PORT -c \"$line\"" + fi +done <"$DISTRIBUTION_COLUMNS_FILE" + +echo "Citus extension setup complete." \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-down.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-down.sh new file mode 100644 index 00000000..7237a2b0 --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-down.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Get the directory of the shell script +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Set environment variables +export notification_env="$SCRIPT_DIR/notification_env" +export scheduler_env="$SCRIPT_DIR/scheduler_env" +export project_env="$SCRIPT_DIR/project_env" +export users_env="$SCRIPT_DIR/user_env" +export interface_env="$SCRIPT_DIR/interface_env" +export entity_management_env="$SCRIPT_DIR/entity_management_env" +export survey_project_creation_env="$SCRIPT_DIR/survey_project_creation_env" + +# Run docker-compose +docker-compose -f "$SCRIPT_DIR/docker-compose-project.yml" down \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-up.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-up.sh new file mode 100644 index 00000000..972bf3db --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-up.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Get the directory of the shell script +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Set environment variables +export notification_env="$SCRIPT_DIR/notification_env" +export scheduler_env="$SCRIPT_DIR/scheduler_env" +export project_env="$SCRIPT_DIR/project_env" +export users_env="$SCRIPT_DIR/user_env" +export interface_env="$SCRIPT_DIR/interface_env" +export entity_management_env="$SCRIPT_DIR/entity_management_env" +export survey_project_creation_env="$SCRIPT_DIR/survey_project_creation_env" + +# Run docker-compose +docker-compose -f "$SCRIPT_DIR/docker-compose-project.yml" up \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/import_forms_postgres.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/import_forms_postgres.sh new file mode 100644 index 00000000..e69de29b diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/insert_sample_data.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/insert_sample_data.sh new file mode 100755 index 00000000..56c1f453 --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/insert_sample_data.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +# --- 1. INSERT INTO public.user_roles --- +# Add new roles for content creation and program management workflows +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_roles (title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label, translations, tenant_code) VALUES ('content_creator', 0, 'ACTIVE', NOW(), NOW(), NULL, 'PUBLIC', 1, 'Content Creator', NULL, 'default');" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_roles (title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label, translations, tenant_code) VALUES ('reviewer', 0, 'ACTIVE', NOW(), NOW(), NULL, 'PUBLIC', 1, 'Reviewer', NULL, 'default');" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_roles (title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label, translations, tenant_code) VALUES ('program_designer', 0, 'ACTIVE', NOW(), NOW(), NULL, 'PUBLIC', 1, 'Program Designer', NULL, 'default');" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_roles (title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label, translations, tenant_code) VALUES ('program_manager', 0, 'ACTIVE', NOW(), NOW(), NULL, 'PUBLIC', 1, 'Program Manager', NULL, 'default');" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_roles (title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label, translations, tenant_code) VALUES ('rollout_manager', 0, 'ACTIVE', NOW(), NOW(), NULL, 'PUBLIC', 1, 'Rollout Manager', NULL, 'default');" + +# --- 2. INSERT INTO public.users --- +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (1, 'Rahul R B', 'a0db5e0a39ee13db7fc5d1309e637f2c', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e4','+91', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (2, 'Prajwal C S', 'c4113be1bc2cef51981a6ec687302e42fc4f87f4dfac4276584844d9e3e0f5ae', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a767','+91', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (3, 'Vishnu V P', '1092be87fd483fce1deba56c8cdefa79bed4f70a4b110fc4e7947c57aacff219', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e0','+91', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (4, 'Mallanagouda R B', 'e5fc674d4b1a54c6cf772485e3bca6f7ae14b60de32b9f0cd9f955ee469345bc', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a700','+91', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (5, 'Priyanka', 'ceb796d9c0a6219d4323ff794b2af33a61bfd2bf6770ba566e5dbcb9755687fd', false, '{8,11,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default',NULL, NULL, NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (6, 'Adithya', 'ea959d865423d4f7105e33f6413e0a1d9b87c455c558f7629c60dd39c1c836b9', false, '{8,9,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default',NULL, NULL, NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (7, 'Praveen', '67bd4cacaef5be249b1587060f54b8631cffd7a75fa913323dda320858442e27', false, '{8,10,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default',NULL, NULL, NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (8, 'Nevin', '3d83442625031895c5b76602acd5083e', false, '{8,13,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default',NULL, NULL, NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (9, 'Saish', '28c23e53cfa34cc4eec7a44bd83d9625', false, '{8,12,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default',NULL, NULL, NULL);" + +# --- 3. INSERT INTO public.user_organizations --- +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (1, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (2, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (3, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (4, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (5, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (6, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (7, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (8, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (9, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" + +# --- 4. UPDATE public.tenants --- +psql -h localhost -p 5432 -U postgres -d user -c " +UPDATE public.tenants +SET meta = '{ + \"factors\": [\"professional_role\", \"professional_subroles\"], + \"observableEntityKeys\": [\"professional_subroles\"], + \"optional_factors\": [\"state\", \"district\", \"block\", \"cluster\", \"school\"], + \"validationExcludedScopeKeys\": [\"language\", \"gender\"], + \"portalSignInUrl\": \"https://shikshagrah-qa.tekdinext.com/register\" +}' +WHERE code = 'default'; +" + +# --- 5. INSERT INTO public.user_organization_roles --- +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 2, 'default_code', 1, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 3, 'default_code', 2, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 2, 'default_code', 3, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 4, 'default_code', 3, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 5, 'default_code', 8, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 5, 'default_code', 11, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 6, 'default_code', 9, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 6, 'default_code', 8, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 7, 'default_code', 10, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 7, 'default_code', 8, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 8, 'default_code', 13, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 8, 'default_code', 8, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 9, 'default_code', 12, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 9, 'default_code', 8, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL);" + +# --- 6. Ensure users and users_credentials sequences are up-to-date --- +psql -h localhost -p 5432 -U postgres -d user -c "SELECT setval('users_id_seq', COALESCE((SELECT MAX(id) FROM public.users), 1));" +psql -h localhost -p 5432 -U postgres -d user -c "SELECT setval('users_credentials_id_seq', COALESCE((SELECT MAX(id) FROM public.users_credentials), 1));" + +# --- 7. Ensure entity_types sequence exists and is set, then insert WITHOUT an explicit id --- +psql -h localhost -p 5432 -U postgres -d user -c "SELECT setval(pg_get_serial_sequence('public.entity_types','id'), COALESCE((SELECT MAX(id) FROM public.entity_types), 1));" +psql -h localhost -p 5432 -U postgres -d user -c "INSERT INTO public.entity_types (value, label, status, created_by, updated_by, allow_filtering, data_type, organization_id, parent_id, has_entities, allow_custom_entities, model_names, created_at, updated_at, deleted_at, meta, external_entity_type, required, regex, tenant_code, organization_code) VALUES ('state', 'State', 'ACTIVE', 0, 0, true, 'STRING', 1, NULL, true, true, '{User}', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, NULL, true, false, NULL, 'default', 'default_code') RETURNING id;" + +# --- 8. UPDATES --- +psql -h localhost -p 5432 -U postgres -d user -c "UPDATE public.entity_types SET status = 'INACTIVE' WHERE id = 3;" + +# Update role_permission_mapping to reflect new role titles +psql -h localhost -p 5432 -U postgres -d user -c "UPDATE role_permission_mapping SET role_title = 'state_education_officer' WHERE role_title = 'mentor';" +psql -h localhost -p 5432 -U postgres -d user -c "SELECT NULL;" + + + diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/replace_volume_path.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/replace_volume_path.sh new file mode 100644 index 00000000..e427fe5e --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/replace_volume_path.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Define the path of your docker-compose file +DOCKER_COMPOSE_FILE="docker-compose-project.yml" + +# Check if the Docker Compose file exists +if [ ! -f "$DOCKER_COMPOSE_FILE" ]; then + echo "Error: Docker Compose file '$DOCKER_COMPOSE_FILE' does not exist." + exit 1 +fi + +# Get the current directory path +CURRENT_DIR=$(pwd) + +# Escape the current directory path to be used in a sed expression +ESCAPED_CURRENT_DIR=$(printf '%s\n' "$CURRENT_DIR" | sed -e 's/[\/&]/\\&/g') + +# Use sed to replace the path leading up to 'env.js' in the docker-compose file +# The pattern ensures that it only replaces the path component up to ':/usr/src/app/www/assets/env/env.js' +sed -i -e "s|/[^:]*\(\/env\.js\):/usr/src/app/www/assets/env/env.js|$ESCAPED_CURRENT_DIR\1:/usr/src/app/www/assets/env/env.js|" "$DOCKER_COMPOSE_FILE" +echo "Updated volume path for 'env.js' in $DOCKER_COMPOSE_FILE" \ No newline at end of file diff --git a/documentation/3.4.0/dockerized/scripts/scp/ubuntu/setup_project.sh b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/setup_project.sh new file mode 100644 index 00000000..93660be3 --- /dev/null +++ b/documentation/3.4.0/dockerized/scripts/scp/ubuntu/setup_project.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +# Logging function +log() { + echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> setup_log.txt +} + +# Step 1: Download Docker Compose file +log "Downloading Docker Compose file..." +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/dockerFiles/scp/docker-compose-project.yml +log "Docker Compose file downloaded." + +# Step 2: Download environment files +log "Downloading environment files..." +curl -L \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/scp/interface_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/entity_management_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/project_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/notification_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/scheduler_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/user_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/scp/survey_project_creation_env \ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/envs/env.js +log "Environment files downloaded." + +# Step 3: Download replace_volume_path.sh script +log "Downloading replace_volume_path.sh script..." +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/replace_volume_path.sh +log "replace_volume_path.sh script downloaded." + +# Step 4: Make replace_volume_path.sh executable +log "Making replace_volume_path.sh executable..." +chmod +x replace_volume_path.sh +log "Made replace_volume_path.sh executable." + +# Step 5: Run replace_volume_path.sh script +log "Running replace_volume_path.sh script..." +./replace_volume_path.sh +log "replace_volume_path.sh script executed." + +# Step 6: Download additional scripts +log "Downloading docker-compose scripts..." +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-up.sh +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/docker-compose-down.sh +log "docker-compose scripts downloaded." + +# Step 7: Make the scripts executable +log "Making docker-compose scripts executable..." +chmod +x docker-compose-up.sh +chmod +x docker-compose-down.sh +log "Made docker-compose scripts executable." + +# Step 8: Create user directory and download SQL file +log "Creating user directory and downloading distributionColumns.sql..." +mkdir -p user && curl -o ./user/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/user/distributionColumns.sql +log "User directory created and distributionColumns.sql downloaded." + +# Step 9: Create survey-project-creation directory and download SQL file +log "Creating survey-project-creation directory and downloading distributionColumns.sql..." +mkdir -p survey-project-creation && curl -o ./survey-project-creation/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/survey-project-creation/distributionColumns.sql +log "survey-project-creation directory created and distributionColumns.sql downloaded." + +# Step 10: Download and make citus_setup.sh executable +log "Downloading citus_setup.sh..." +curl -OJL https://github.com/ELEVATE-Project/project-service/raw/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/citus_setup.sh +chmod +x citus_setup.sh + +# Step 11: Create sample-data directory and download SQL file +log "Creating sample-data directory and downloading sampleData.sql..." +mkdir -p sample-data/user && \ +curl -L https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/sample-data/scp/mac-linux/user/sampleData.sql -o sample-data/user/sampleData.sql +log "Sample-data directory created and sampleData.sql downloaded." + + +# Install MongoDB driver (usually needed if connecting directly to MongoDB/Citus) +npm install mongodb + +# Install Mongoose (Object Data Modeling library, if the scripts use it) +npm install mongoose + +# Step 12: Download additional scripts to add data +log "Downloading sample data scripts..." +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/entity_sampleData.js +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/project_sampleData.js +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/insert_sample_solutions.js +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/insert_sample_data.sh +chmod +x insert_sample_data.sh +log "sample data scripts downloaded." + + +log "Downloading config.json file..." +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/config.json +log "config.json file is downloaded." + +# remove once the docker image is generated +# log "Cloning survey-project-creation-service repository..." +# git clone -b release-1.0.0 https://github.com/ELEVATE-Project/survey-project-creation-service.git +# log "survey-project-creation-service repository cloned." + +# Step 14: Run docker-compose-up.sh script +log "Running docker-compose-up.sh script..." +./docker-compose-up.sh +log "docker-compose-up.sh script executed." diff --git a/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/citus_setup.sh b/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/citus_setup.sh index 34066c39..7ceb202d 100644 --- a/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/citus_setup.sh +++ b/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/citus_setup.sh @@ -126,4 +126,4 @@ done # Clean up temporary file in the container docker exec "$CONTAINER_NAME" rm "$CONTAINER_SQL_PATH" -echo "✅ Citus extension setup and distribution columns complete successfully!" \ No newline at end of file +echo "✅ Citus extension setup and distribution columns complete successfully!" diff --git a/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/setup_project.sh b/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/setup_project.sh index 1961d19c..120dae9b 100644 --- a/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/setup_project.sh +++ b/documentation/3.4.0/dockerized/scripts/stand-alone/ubuntu/setup_project.sh @@ -66,4 +66,4 @@ log "config.json file is downloaded." # Step 13: Run docker-compose-up.sh script log "Running docker-compose-up.sh script..." ./docker-compose-up.sh -log "docker-compose-up.sh script executed." +log "docker-compose-up.sh script executed." \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/elevate_portal_env b/documentation/3.4.0/native/envs/scp/elevate_portal_env new file mode 100644 index 00000000..14b3959f --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/elevate_portal_env @@ -0,0 +1,48 @@ +AUTH_API_TOKEN= "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJPc3NtSUhXaW1NMDN2MUxsVnFvNHBqaS0ydEMwTGhLY0o5dmtwQTlJZV9zIn0.eyJleHAiOjE3MzI4NjE5ODcsImlhdCI6MTczMjc3NTU4NywianRpIjoiOTM5NWM4N2QtOTliYy00YTRkLWIyNTUtNDQ4NjFhYTBjYWE2IiwiaXNzIjoiaHR0cHM6Ly9xYS5wcmF0aGFtdGVhY2hlcmFwcC50ZWtkaW5leHQuY29tL2F1dGgvcmVhbG1zL3ByYXRoYW0iLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiY2IwN2RlNjItZWM0Yy00YmRlLWI5YjYtOWIwZjM3OWMwMTExIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoicHJhdGhhbSIsInNlc3Npb25fc3RhdGUiOiI2MzQ0ZWZjNS05NmUwLTQyNzYtYjViYi1hNTcyMGI0YzVmYjkiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIi8qIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIiwiZGVmYXVsdC1yb2xlcy1wcmF0aGFtIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbWFpbCBwcm9maWxlIiwic2lkIjoiNjM0NGVmYzUtOTZlMC00Mjc2LWI1YmItYTU3MjBiNGM1ZmI5IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJuYW1lIjoiUmFqbmlzaCIsInByZWZlcnJlZF91c2VybmFtZSI6InJham5pc2g5ODc2MSIsImdpdmVuX25hbWUiOiJSYWpuaXNoIiwiZmFtaWx5X25hbWUiOiIifQ.OpTwdzG8sWhVK_VY6iAYy1klR2cfSLn2gYCqgnu9FJi4zTjPY-B0d8F--cEPVGZ4HdJiSZnGvfOgalICPKxthG-HfYR-cwznGWJVfte4HsvL5UbteOq5KDT3lsyzUkScgQ0bTKztSsePdhU2ctAGXv52DtPK8u7xWkKD6GYDeQCIHJlFS2JgR9v50d6Mva-stvtDRS7LEFgoes1hKQ0_k_C-5g1w7Rh084XJQC7tPmczap_Q-RqI-jkJZvUl_cAJK6NppZArSFA0AePkY-0_pZKBx82nBJbho2IETMIa7KzvnhdRCtjP0ynoTY-YJ4eL3jYhmIJ5DzWj3FpOZkrpSw" +AWS_ACCESS_KEY_ID= "AWS_ACCESS_KEY_ID" +AWS_ACCESS_SECRET_KEY= "AWS_ACCESS_SECRET_KEY" +AWS_BUCKET_NAME= "qa-knowlg-inquiry" +AWS_REGION= "ap-south-1" +BASE_URL= "https://qa-middleware.tekdinext.com" +NEXT_API_BASE_URL= "https://middleware.prathamdigital.org" +NEXT_PRIVATE_LOCAL_WEBPACK= "true" +NEXT_PUBLIC_AUTH= "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI5dndaeklzS3U0ZzRjSWxoZnE1MWQ2SlR1d0w4dktlZCJ9.4jPaZhi9dHMzqqoZAZvfD5t5QPAVAuWOr9SDf1apZb8" +NEXT_PUBLIC_BASE_URL= "https://dev.elevate-apis.shikshalokam.org" +NEXT_PUBLIC_BASE_URL_ENTITY= "https://shiksha-dev-interface.tekdinext.com/entity-management" +NEXT_PUBLIC_BASE_URL_READ= "https://saas-dev-interface.tekdinext.com" +NEXT_PUBLIC_BASE_URL_SCHEMA= "https://qa-interface.prathamdigital.org" +NEXT_PUBLIC_CHANNEL_ID= "scp-channel" +NEXT_PUBLIC_CLIENT_ID= "implementation" +NEXT_PUBLIC_CLIENT_SECRET= "3e92df83-a773-4e3e-89c6-3a9afe81211a" +NEXT_PUBLIC_CLOUD_STORAGE_URL= "https://qa-knowlg-inquiry.s3-ap-south-1.amazonaws.com/" +NEXT_PUBLIC_CONTENT= "http://localhost:8000/shikshalokam/content" +NEXT_PUBLIC_CONTENT_FRAMEWORK_ID= "level1arning-framework" +NEXT_PUBLIC_DELETE_USER= "/api/user/v1/block" +NEXT_PUBLIC_FORGOT_PASSWORD= "https://dev.sunbirdsaas.com/recover/identify/account" +NEXT_PUBLIC_FRAMEWORK_ID= "shiksha-fw" +NEXT_PUBLIC_GENRATE_OTP= "/api/otp/v2/generate" +NEXT_PUBLIC_GRANT_TYPE= "password" +NEXT_PUBLIC_LOCATION_SEARCH= "/api/data/v1/location/search" +NEXT_PUBLIC_LOGINPAGE= "https://dev.elevate-apis.shikshalokam.org/" +NEXT_PUBLIC_LOGIN_PATH= "/auth/realms/sunbird/protocol/openid-connect/token" +NEXT_PUBLIC_NEW_REGISTRATION= "/interface/v1/account/create" +NEXT_PUBLIC_ORGID= "1" +NEXT_PUBLIC_PROGRAM_BASE_URL= "https://dev.elevate-sandbox.shikshalokam.org" +NEXT_PUBLIC_PWA= "http://localhost:8000/shikshalokam/pwa" +NEXT_PUBLIC_READ_USER= "/api/user/v1/search" +NEXT_PUBLIC_REGISTRATION= "http://localhost:8000/shikshalokam/registration/newUser" +NEXT_PUBLIC_SEARCH_LOCATION= "/interface/v1/user/locations/search" +NEXT_PUBLIC_SEND_OTP= "/api/otp/v1/generate" +NEXT_PUBLIC_SHIKSHAGRAHA_BASEPATH= "/shikshalokam" +NEXT_PUBLIC_SSUNBIRD_BASE_URL= "https://saas-qa.tekdinext.com/interface/v1" +NEXT_PUBLIC_SSUNBIRD_HIERARCHY_PATH= "/api/course/v1/" +NEXT_PUBLIC_TELEMETRY_URL= "https://qa.prathamteacherapp.tekdinext.com/telemetry" +NEXT_PUBLIC_TENANT_ID= "ef99949b-7f3a-4a5f-806a-e67e683e38f3" +NEXT_PUBLIC_TRACKING_BASE_URL= "https://shiksha2-dev.tekdinext.com/tracking" +NEXT_PUBLIC_UPDATE_USER= "/api/framework/v1/update" +NEXT_PUBLIC_VERIFT_OTP= "/api/otp/v2/verify" +NEXT_PUBLIC_VERIFY_OTP= "/api/otp/v1/verify" +created_time= "2025-06-18T08:50:04.71092372Z" +custom_metadata= "null" +destroyed= "false" +version= "5" \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/entity_management_env b/documentation/3.4.0/native/envs/scp/entity_management_env new file mode 100644 index 00000000..aaf45d4f --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/entity_management_env @@ -0,0 +1,23 @@ +APPLICATION_PORT = 5001 +APPLICATION_ENV ="development" +APPLICATION_BASE_URL='/entity-management/' +INTERNAL_ACCESS_TOKEN =xahusub12yexlashsbxAXADHBlaj +ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj +MONGODB_URL=mongodb://localhost:27017/entity +AUTH_METHOD = native +USER_SERVICE_URL = http://localhost:3569 +USER_SERVICE_BASE_URL=/user +KAFKA_HEALTH_CHECK_TOPIC=test +SERVICE_NAME = elevate-entity-service +API_DOC_URL="http://localhost:3569/entity-management/api-doc" +APPLICATION_HOST=localhost +IS_AUTH_TOKEN_BEARER="false" +ADMIN_ACCESS_TOKEN=rwwee3$123 +ADMIN_TOKEN_HEADER_NAME="admin-auth-token" +INTERFACE_SERVICE_URL=http://localhost:3569 +KAFKA_HEALTH_CHECK_TOPIC = entity-health-check-topic-check +KAFKA_COMMUNICATIONS_ON_OFF = ON +KAFKA_URL = kafka:9092 +KAFKA_COMMUNICATIONS_ON_OFF = ON +KAFKA_GROUP_ID = entity +HEALTH_CHECK_DEBUG_MODE = true \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/interface_env b/documentation/3.4.0/native/envs/scp/interface_env new file mode 100644 index 00000000..d12c7e5d --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/interface_env @@ -0,0 +1,26 @@ +API_DOC_URL=/interface/api-doc +APPLICATION_ENV=development +APPLICATION_PORT=3569 +ELEVATE_NOTIFICATION_KAFKA_BROKERS=10.148.0.38:9092 +ELEVATE_NOTIFICATION_KAFKA_GROUP_ID=dev.mentoring +ELEVATE_NOTIFICATION_KAFKA_TOPIC=dev.notification +ENTITY_SERVICE_BASE_URL=http://localhost:5001 +INSTALLED_PACKAGES=elevate-mentoring elevate-survey-observation@1.0.1 elevate-self-creation-portal +MENTORING_SERVICE_BASE_URL=http://localhost:7101 +NOTIFICATION_SERVICE_BASE_URL=http://localhost:7201 +PROJECT_SERVICE_BASE_URL=http://localhost:6000 +RATE_LIMITER_ENABLED=true +RATE_LIMITER_GENERAL_LIMIT=500 +RATE_LIMITER_NUMBER_OF_PROXIES=3 +RATE_LIMITER_PUBLIC_LOW_LIMIT=5 +REQUIRED_BASE_PACKAGES=elevate-mentoring elevate-project elevate-survey-observation self-creation-portal +REQUIRED_PACKAGES=elevate-mentoring@1.2.90 elevate-survey-observation@1.0.22 elevate-project@1.1.53 shiksha-notification@1.1.3 elevate-self-creation-portal@1.0.70 +ROUTE_CONFIG_JSON_URLS_PATHS=https://raw.githubusercontent.com/ELEVATE-Project/utils/refs/heads/develop/interface-routes/elevate-routes.json +SAAS_NOTIFICATION_BASE_URL=interface/v1/notification/send-raw +SAAS_NOTIFICATION_SEND_EMAIL_ROUTE=interface/v1/notification/send-raw +SAMIKSHA_SERVICE_BASE_URL=http://localhost:5007 +SCHEDULER_SERVICE_BASE_URL=http://localhost:7401 +SELF-CREATION-PORTAL_SERVICE_BASE_URL=http://localhost:6001 +SUPPORTED_HTTP_TYPES=GET POST PUT PATCH DELETE +SURVEY_SERVICE_BASE_URL=http://localhost:5007 +USER_SERVICE_BASE_URL=http://localhost:3001 \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/notification_env b/documentation/3.4.0/native/envs/scp/notification_env new file mode 100644 index 00000000..c6fde34c --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/notification_env @@ -0,0 +1,16 @@ +API_DOC_URL=/api-doc +APPLICATION_BASE_URL=/notification/ +APPLICATION_ENV=development +APPLICATION_PORT=3002 +DEV_DATABASE_URL=postgres://postgres:postgres@localhost:5432/notification +DISABLE_LOG=false +ENABLE_LOG=true +ERROR_LOG_LEVEL=silly +INTERNAL_ACCESS_TOKEN=xahusub12yexlashsbxAXADHBlaj +KAFKA_GROUP_ID=notification +KAFKA_HOST=localhost:9092 +KAFKA_TOPIC=develop.notifications +SENDGRID_API_KEY=SG.asd9f87a9s8d7f. +SENDGRID_FROM_MAIL=no-reply@some.org +EMAIL_SERVICE=sendgrid +FROM_EMAIL=no-reply@some.org \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/observation_portal_env b/documentation/3.4.0/native/envs/scp/observation_portal_env new file mode 100644 index 00000000..50d7ba42 --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/observation_portal_env @@ -0,0 +1,4 @@ +window["env"] = { + production: true, + surveyBaseURL:"https://qa.elevate-apis.shikshalokam.org" +} \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/observation_survey_projects_pwa_env b/documentation/3.4.0/native/envs/scp/observation_survey_projects_pwa_env new file mode 100644 index 00000000..6dc12a6a --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/observation_survey_projects_pwa_env @@ -0,0 +1,17 @@ +window["env"] = { + production: true, + baseURL: 'http://localhost:3569', //interface url + capabilities: 'all', + restrictedPages: ['DOWNLOADS','AUTH_PAGES'], + unauthorizedRedirectUrl: "/", + isAuthBypassed: true, + profileRedirectPath: "/profile-edit", + showHeader: true, + config:{ + logoPath:'assets/images/logo.png', + faviconPath:'assets/icons/elevate-logo.png', + title:"Elevate", + redirectUrl:"/home" + }, + hostPath:'/ml/' +}; \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/project_env b/documentation/3.4.0/native/envs/scp/project_env new file mode 100644 index 00000000..09d09564 --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/project_env @@ -0,0 +1,47 @@ +APPLICATION_PORT = 6000 +APPLICATION_ENV = development +ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj +INTERNAL_ACCESS_TOKEN =xahusub12yexlashsbxAXADHBlaj +MONGODB_URL = mongodb://localhost:27017/project +KEYCLOAK_PUBLIC_KEY_PATH = keycloak-public-keys +KAFKA_COMMUNICATIONS_ON_OFF = ON +KAFKA_URL=localhost:9092 +KAFKA_GROUP_ID = projects +KAFKA_HEALTH_CHECK_TOPIC = project-health-check-topic-check +PROJECT_SUBMISSION_TOPIC=sl-improvement-project-submission-dev +SUBMISSION_TOPIC = Projectsubmissions +PROJECT_CERTIFICATE_TOPIC = generateProjectCertificate +ELEVATE_PROJECT_SERVICE_URL= 'http://localhost:6000' +SERVICE_NAME = project +USER_DELETE_TOPIC = deleteuser +TELEMETRY_TOPIC=telemetry.raw +ID = projectservice +TELEMETRY_ON_OFF=ON +USER_DELETE_ON_OFF=OFF +CLOUD_STORAGE=ON +TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC = +05:30 +VALIDATE_ENTITIES = ON +APP_PORTAL_BASE_URL = "http://localhost:7007" +NO_OF_MINUTES = 30 +NO_OF_EXPIRY_TIME = 60 +DEFAULT_ORGANISATION_CODE = 1 +GOTENBERG_URL=http://localhost:3000 +API_DOC_URL="http://http://localhost:3569/project/api-doc" +INTERFACE_SERVICE_URL=http://localhost:3569 +USER_SERVICE_BASE_URL = "/user" +ENTITY_MANAGEMENT_SERVICE_BASE_URL = "/entity-management" +SURVEY_SERVICE_URL = http://localhost:4301/survey +CLOUD_STORAGE_PROVIDER=gcloud +CLOUD_STORAGE_ACCOUNTNAME=CLOUD_STORAGE_ACCOUNTNAME +CLOUD_STORAGE_SECRET="-----BEGIN PRIVATE KEY-----\n" +CLOUD_STORAGE_PROJECT =sl-dev-project +CLOUD_STORAGE_BUCKETNAME=mentoring-dev-storage-private +CLOUD_STORAGE_BUCKET_TYPE=private +ADMIN_ACCESS_TOKEN = N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl +ADMIN_AUTH_TOKEN = N0DM5NAwwCN5KNXKJwlwu6c0nQQt6Rcl +ADMIN_TOKEN_HEADER_NAME = 'admin-auth-token' +IS_AUTH_TOKEN_BEARER = false +AUTH_METHOD = native +REDIS_HOST=redis://127.0.0.1:6379 +USER_SERVICE_URL = http://localhost:3569 +RESOURCE_DELETION_TOPIC=RESOURCE_DELETION_TOPIC \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/scheduler_env b/documentation/3.4.0/native/envs/scp/scheduler_env new file mode 100644 index 00000000..07ffc681 --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/scheduler_env @@ -0,0 +1,13 @@ +API_DOC_URL=/api-doc +APPLICATION_BASE_URL=/scheduler/ +APPLICATION_ENV=development +APPLICATION_PORT=4000 +DEFAULT_QUEUE=email +DISABLE_LOG=false +ENABLE_LOG=true +ERROR_LOG_LEVEL=silly +KAFKA_URL=localhost:9092 +NOTIFICATION_KAFKA_TOPIC=develop.notifications +REDIS_HOST=localhost +REDIS_PORT=6379 +MONGODB_URL="mongodb://localhost:27017/tl-cron-rest" \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/survey_project_creation_env b/documentation/3.4.0/native/envs/scp/survey_project_creation_env new file mode 100644 index 00000000..f9cce313 --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/survey_project_creation_env @@ -0,0 +1,91 @@ +ACCESS_TOKEN_EXPIRY=30m +ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj +API_DOC_URL=/scp/api-doc +APPLICATION_BASE_URL=/scp/ +APPLICATION_ENV=development +APPLICATION_HOST=localhost +APPLICATION_PORT=6001 +AUTH_CONFIG_FILE_PATH=config.json +AUTH_METHOD=native +AUTH_TOKEN_HEADER_NAME=x-auth-token +BROWSE_EXISTING_END_POINT=v1/internal/getAllPublishedResources +CLEAR_INTERNAL_CACHE=scpinternal +#Cloud storage details +CLOUD_ENDPOINT=cloud_storage_endpoint +CLOUD_STORAGE=aws +CLOUD_STORAGE_ACCOUNTNAME=project-scp-storage +CLOUD_STORAGE_BUCKETNAME=scp-uploads-prod +CLOUD_STORAGE_PROVIDER=aws +CLOUD_STORAGE_REGION=us-west-2 +CLOUD_STORAGE_SECRET=AKIAIOSFODNN7EXAMPLE +CLOUD_STORAGE_BUCKET_TYPE=public +PUBLIC_ASSET_BUCKETNAME=scp-public-assets +CONSUMPTION_SERVICE=elevate +CONSUMPTION_SERVICE_BASE_URL=/project/ +CONSUMPTION_SERVICE_DOWNLOADBLE_URL=v1/cloud-services/files/download +CONSUMPTION_SERVICE_ENTITY_MANAGEMENT_BASE_URL=/entity-management/ +CONSUMPTION_SERVICE_PRESIGNED_URL=v1/cloud-services/files/preSignedUrls +DEFAULT_ADMIN_ROLE=admin +DEFAULT_CONTENT_CREATOR_ROLE=content_creator +DEFAULT_DATA_MANAGERS=program_manager +DEFAULT_ORGANIZATION_CODE=default_code +DEFAULT_ORG_ADMIN_ROLE=org_admin +DEFAULT_ORG_ID=default_code +DEFAULT_PROGRAM_DESIGNER_ROLES=program_designer +DEFAULT_PROGRAM_MANAGERS=program_manager +DEFAULT_REVIEWER_ROLE=reviewer +DEFAULT_ROLLOUT_ROLES=rollout_manager +DEFAULT_TENANT_CODE=default +DEV_DATABASE_URL=postgres://postgres:postgres@localhost:5432/scp +DISABLE_LOG=false +ENABLE_ENTITY_TAGGING_IN_PROJECTS=false +ENABLE_OBSERVATION_IN_PROJECTS=true +ENABLE_TASK_START_END_DATE_IN_PROJECTS=false +ENTITY_MANAGEMENT_SERVICE_NAME=/entity-management/ +ERROR_LOG_LEVEL=silly +HIGHEST_IN_ENTITY_HIERARCHY=state +INTERFACE_SERVICE_HOST=http://interface:3569 +INTERNAL_ACCESS_TOKEN=Fqn0m0HQ0gXydRtBCg5l +INTERNAL_CACHE_EXP_TIME=86400 +IS_AUTH_TOKEN_BEARER=false +KAFKA_COMMUNICATIONS_ON_OFF=ON +KAFKA_GROUP_ID=scp +KAFKA_URL=localhost:9092 +MAX_BODY_LENGTH_FOR_UPLOAD=5242880 +MAX_PROJECT_TASK_COUNT=10 +MAX_RESOURCE_NOTE_LENGTH=200 +MIN_APPROVAL=1 +MONGODB_URL=mongodb://localhost:27017/project +MONGO_DB_MODE=individual +NOTIFICATION_KAFKA_TOPIC=qa.notification +OBSERVATION_DEEP_LINK_REGEX=^https://portal/view/observation/[a-f0-9]{32}$ +ORGANIZATION_LIST_ENDPOINT=v1/organization/list +ORGANIZATION_READ_ENDPOINT=v1/organization/read +ORG_ID_HEADER_NAME=organization-id +PROGRAM_META_INFO_KEYS=state,recommendedFor +PROGRAM_PUBLISH_KAFKA_TOPIC=qa.programpublish +PROJECT_DEEP_LINK_URL=https://portal/view/project/ +PROJECT_MONGO_DB_URL=mongodb://mongodb:27017/project +PROJECT_PUBLISH_END_POINT=v1/scp/publishTemplateAndTasks +PROJECT_PUBLISH_KAFKA_TOPIC=qa.projectpublish +PROJECT_REFLECTION_TASK_REDIRECT_URL=https://elevate-mitra.shikshalokam.org/mohini/sso?flow=guest-mi-story +PROJECT_SERVICE_BASE_URL=/project/ +REDIS_HOST=redis://localhost:6379 +RESOURCE_AUTO_SAVE_TIMER=30000 +RESOURCE_KAFKA_PUSH_ON_OFF=ON +RESOURCE_TYPES=project,observation,observation_with_rubric,survey,program +REVIEW_REQUIRED=true +REVIEW_REQUIRED_AFTER_PUBLISH=true +REVIEW_TYPE=SEQUENTIAL +ROLLOUT_PUBLISH_KAFKA_TOPIC=dev.rolloutpublish +SESSION_VERIFICATION_METHOD=user_service_authenticated +SHOW_REVIEWER_LIST=true +SURVEY_MONGO_DB_URL=mongodb://mongodb:27017/survey +SURVEY_SERVICE_BASE_URL=/survey/ +TENANT_ID_HEADER_NAME=tenant-id +USER_LIST_ENDPOINT=v1/account/search +USER_PROFILE_DETAILS_ENDPOINT=v1/user/read +USER_SERVICE_BASE_URL=/user/ +USER_SERVICE_HOST=http://interface:3569 +USER_SERVICE_ORG_UPDATE_TOPIC=dev.organizationEvent +USER_SERVICE_TENANT_CREATION_TOPIC=dev.tenantEvent \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/scp/user_env b/documentation/3.4.0/native/envs/scp/user_env new file mode 100644 index 00000000..2078f5cc --- /dev/null +++ b/documentation/3.4.0/native/envs/scp/user_env @@ -0,0 +1,85 @@ +ACCESS_TOKEN_EXPIRY='30m' +ACCESS_TOKEN_SECRET=bsj82AHBxahusub12yexlashsbxAXADHBlaj +API_DOC_URL=/user/api-doc +APP_NAME=MentorED +APPLICATION_ENV=development +APPLICATION_PORT=3001 +CLOUD_STORAGE_PROVIDER = aws +CLOUD_STORAGE_BUCKETNAME =mentoring-prod-storage-private +CLOUD_STORAGE_SECRET= CLOUD_STORAGE_SECRET +CLOUD_STORAGE_REGION =ap-south-1 +CLOUD_ENDPOINT =CLOUD_ENDPOINT +CLOUD_STORAGE_ACCOUNTNAME =CLOUD_STORAGE_ACCOUNTNAME +CLOUD_STORAGE_BUCKET_TYPE = private +PUBLIC_ASSET_BUCKETNAME=mentoring-prod-storage-private +AZURE_ACCOUNT_KEY='AZURE_ACCOUNT_KEY' +AZURE_ACCOUNT_NAME=elevatementoringaccount +CLEAR_INTERNAL_CACHE=userinternal +CLOUD_STORAGE=GCP +DEFAULT_AZURE_CONTAINER_NAME=mentoring-azure-private +DEFAULT_GCP_BUCKET_NAME=DEFAULT_GCP_BUCKET_NAME +ENABLE_EMAIL_OTP_VERIFICATION=false +ENABLE_LOG=true +GCP_PATH=gcp.json +GCP_PROJECT_ID=sl-project +INTERNAL_ACCESS_TOKEN=xahusub12yexlashsbxAXADHBlaj +INTERNAL_CACHE_EXP_TIME=86400 +IV=LHYOA5YnTonqcgrm15k3/Q== +KAFKA_GROUP_ID=mentoring +KAFKA_TOPIC= +KAFKA_URL= localhost:9092 +KEY=E/m3RD/aM3Ed3lLfYVcKizakG9R+bFybAPZSLjIP2hY= +MENTOR_SECRET_CODE=4567 +MONGODB_URL=mongodb://localhost:27017/elevate-users +NOTIFICATION_KAFKA_TOPIC=notifications +OTP_EMAIL_TEMPLATE_CODE=emailotp +OTP_EXP_TIME=86400 +RATING_KAFKA_TOPIC=mentor_rating +REDIS_HOST=redis://localhost:6379 +REFRESH_TOKEN_EXPIRY=183 +REFRESH_TOKEN_SECRET=371hkjkjady2y3ihdkajshdkiq23iuekw71yekhaskdvkvegavy23t78veqwexqvxveit6ttxyeeytt62tx236vv +REGISTRATION_EMAIL_TEMPLATE_CODE=registration +REGISTRATION_OTP_EMAIL_TEMPLATE_CODE=registrationotp +SALT_ROUNDS=10 + +DEFAULT_OCI_BUCKET_NAME=mentoring-oci-private +OCI_ACCESS_KEY_ID= 81a4c2553026982360af6b24497c489b0fea9436 +OCI_BUCKET_ENDPOINT=https://axgqmpkrpmt5.compat.objectstorage.ap-hyderabad-1.oraclecloud.com +OCI_BUCKET_REGION= ap-hyderabad-1 +OCI_SECRET_ACCESS_KEY='+U4O+CjiC6M/mOcGjYh7K/9XjfSdJ79OoLuQrABPOJ8=' +ERROR_LOG_LEVEL= silly +DISABLE_LOG= false +DEFAULT_ORGANISATION_CODE=default_code +DEV_DATABASE_URL=postgres://postgres:postgres@localhost:5432/users +ADMIN_SECRET_CODE=W5bF7gesuS0xsNWmpsKy +INVITEE_EMAIL_TEMPLATE_CODE="emailcode" +ADMIN_INVITEE_UPLOAD_EMAIL_TEMPLATE_CODE="coeadmin" +DEFAULT_QUEUE="defaultque" +MENTOR_INVITATION_EMAIL_TEMPLATE_CODE="mentorinvitationTemplateCode" +MENTEE_INVITATION_EMAIL_TEMPLATE_CODE="mentee invitationTemplateCode" +MENTORING_SERVICE_URL=http://localhost:7201 +DEFAULT_ROLE="mentee" +SAMPLE_CSV_FILE_PATH="sample path" +ORG_ADMIN_INVITATION_EMAIL_TEMPLATE_CODE = "code5" +DEFAULT_ORG_ID = 1 +PORTAL_URL = "portaladdress" +SCHEDULER_SERVICE_HOST = "host" +SCHEDULER_SERVICE_BASE_URL = "/scheduler/" +REFRESH_VIEW_INTERVAL = 100000 +EMAIL_ID_ENCRYPTION_IV = 'a390328e496f025249a88384f318a536' +EMAIL_ID_ENCRYPTION_KEY = '9bbf4698e081176b4e38c3f04f9c0cff6ae80b1960e5ac868cc234ac8537aa66' +EMAIL_ID_ENCRYPTION_ALGORITHM = 'aes-256-cbc' +GENERIC_INVITATION_EMAIL_TEMPLATE_CODE = 'check_code' +EVENT_ORG_LISTENER_URLS = "sample url" +EVENT_ENABLE_ORG_EVENTS = false +DOWNLOAD_URL_EXPIRATION_DURATION = 300 +APPLICATION_HOST= "localhost" +CHANGE_PASSWORD_TEMPLATE_CODE = "change_password" +CAPTCHA_ENABLE = false +RECAPTCHA_SECRET_KEY= "6LfWEKYpAAAAAJS0eukS2Su_5vwlXRs5vPbC34W0" +ALLOWED_IDLE_TIME=1200000 +APPLICATION_BASE_URL="/user" +ENTITY_MANAGEMENT_SERVICE_BASE_URL="/" +ORG_CODE_HEADER_NAME=organization-id +ORG_ID_HEADER_NAME=organization-id +TENANT_CODE_HEADER_NAME=tenant-id \ No newline at end of file diff --git a/documentation/3.4.0/native/envs/stand-alone/user_env b/documentation/3.4.0/native/envs/stand-alone/user_env index 193d7859..4f4a583f 100644 --- a/documentation/3.4.0/native/envs/stand-alone/user_env +++ b/documentation/3.4.0/native/envs/stand-alone/user_env @@ -79,4 +79,4 @@ CAPTCHA_ENABLE = false RECAPTCHA_SECRET_KEY= "6LfWEKYpAAAAAJS0eukS2Su_5vwlXRs5vPbC34W0" ALLOWED_IDLE_TIME=1200000 APPLICATION_BASE_URL="/user" -ENTITY_MANAGEMENT_SERVICE_BASE_URL="http://localhost:3569/entity-management/" \ No newline at end of file +ENTITY_MANAGEMENT_SERVICE_BASE_URL="/entity-management/" diff --git a/documentation/3.4.0/native/scripts/linux/import_forms.js b/documentation/3.4.0/native/scripts/linux/import_forms.js new file mode 100644 index 00000000..700368d5 --- /dev/null +++ b/documentation/3.4.0/native/scripts/linux/import_forms.js @@ -0,0 +1,51 @@ +const mongoose = require('mongoose') +const axios = require('axios') + +// MongoDB URL and Collection +const mongoURL = 'mongodb://localhost:27017/project' +const collectionName = 'forms' + +// Connect to MongoDB +mongoose + .connect(mongoURL, { + useNewUrlParser: true, + useUnifiedTopology: true, + }) + .then(() => { + console.log('Connected to MongoDB') + }) + .catch((err) => { + console.error('Failed to connect to MongoDB', err) + }) + +// Define schema for forms collection (adjust fields based on JSON structure) +const formSchema = new mongoose.Schema({}, { strict: false }) +const Form = mongoose.model(collectionName, formSchema) + +// Fetch JSON data from URL and insert into MongoDB +async function fetchAndInsertData() { + try { + const response = await axios.get( + 'https://raw.githubusercontent.com/ELEVATE-Project/observation-survey-projects-pwa/refs/heads/release-2.0.0/forms.json' + ) + const data = response.data + + const modifiedData = data.map((form) => ({ + ...form, + organizationId: 1, + deleted: false, + version: 0, + })) + + // Insert modified data into the forms collection + await Form.insertMany(modifiedData) + console.log('Data inserted successfully') + } catch (error) { + console.error('Error fetching or inserting data:', error) + } finally { + mongoose.connection.close() + } +} + +// Execute the function +fetchAndInsertData() \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/check-dependencies.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/check-dependencies.sh new file mode 100644 index 00000000..db67da25 --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/check-dependencies.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +# Define ANSI color codes for output formatting +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Function to check Node.js installation +check_nodejs() { + if command -v node > /dev/null 2>&1; then + echo -e "${GREEN}Node.js is installed. Version: $(node --version)${NC}" + else + echo -e "${RED}Node.js is not installed.${NC}" + fi +} + +# Function to check Apache Kafka and Zookeeper installation +check_kafka() { + if [ -d "/opt/kafka" ]; then + echo -e "${GREEN}Kafka directory exists.${NC}" + else + echo -e "${RED}Kafka directory does not exist.${NC}" + fi + + if systemctl is-active --quiet zookeeper; then + echo -e "${GREEN}Zookeeper service is running.${NC}" + else + echo -e "${RED}Zookeeper service is not running.${NC}" + fi + + if systemctl is-active --quiet kafka; then + echo -e "${GREEN}Kafka service is running.${NC}" + else + echo -e "${RED}Kafka service is not running.${NC}" + fi +} + +# Function to check Redis installation and service status +check_redis() { + if command -v redis-server > /dev/null 2>&1; then + echo -e "${GREEN}Redis server is installed. Version: $(redis-server --version)${NC}" + else + echo -e "${RED}Redis server is not installed.${NC}" + return + fi + + if systemctl status redis-server.service &> /dev/null; then + echo -e "${GREEN}Redis service is running.${NC}" + else + echo -e "${RED}Redis service is not running or inactive.${NC}" + fi +} + +# Function to check Citus installation +check_citus() { + if sudo su - postgres -c "psql -p 9700 -c 'SELECT citus_version();'" &> /dev/null; then + echo -e "${GREEN}Citus is running on port 9700.${NC}" + else + echo -e "${RED}Citus is not running or not installed.${NC}" + fi +} + +# Function to check PM2 installation +check_pm2() { + if command -v pm2 > /dev/null 2>&1; then + echo -e "${GREEN}PM2 is installed. Version: $(pm2 -v)${NC}" + else + echo -e "${RED}PM2 is not installed.${NC}" + fi +} + +# Function to check PostgreSQL installation and service +check_postgres() { + if command -v psql > /dev/null 2>&1; then + echo -e "${GREEN}PostgreSQL is installed. Version: $(psql --version)${NC}" + else + echo -e "${RED}PostgreSQL is not installed.${NC}" + fi + + if systemctl is-active --quiet postgresql; then + echo -e "${GREEN}PostgreSQL service is running.${NC}" + else + echo -e "${RED}PostgreSQL service is not running.${NC}" + fi +} + +# Function to check MongoDB installation and service +check_mongo() { + if command -v mongod > /dev/null 2>&1; then + echo -e "${GREEN}MongoDB is installed. Version: $(mongod --version | head -n 1)${NC}" + else + echo -e "${RED}MongoDB is not installed.${NC}" + return + fi + + if systemctl is-active --quiet mongod; then + echo -e "${GREEN}MongoDB service is running.${NC}" + else + echo -e "${RED}MongoDB service is not running.${NC}" + fi +} + +# Function to check if Redis BullMQ is installed (in Node.js context) +check_bullmq() { + if npm list -g | grep -q bullmq; then + echo -e "${GREEN}Redis BullMQ is installed globally.${NC}" + else + echo -e "${RED}Redis BullMQ is not installed globally.${NC}" + fi +} + +# Function to check Gotenberg installation and service status +check_gotenberg() { + if command -v docker > /dev/null 2>&1; then + echo -e "${GREEN}Docker is installed. Version: $(docker --version)${NC}" + else + echo -e "${RED}Docker is not installed.${NC}" + return + fi + + if docker ps | grep -q gotenberg; then + echo -e "${GREEN}Gotenberg Docker container is running.${NC}" + else + echo -e "${RED}Gotenberg Docker container is not running.${NC}" + fi +} + +# Main execution flow of the script +echo "ELEVATE-Project Dependencies Status" + +check_nodejs +check_kafka +check_redis +check_pm2 +check_postgres +check_citus +check_mongo +# check_bullmq +check_gotenberg \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json b/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json new file mode 100644 index 00000000..b3d32b2f --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json @@ -0,0 +1,11 @@ +{ + "authTokenUserInformation": { + "userId": "data.id", + "userName": "data.name", + "firstName": "data.name", + "organization_id": "data.organization_codes[0]", + "roles": "data.organizations[?code={{organization_id}}].roles", + "organizations": "data.organizations", + "tenant_id": "data.tenant_code" + } +} diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/configSCP.json b/documentation/3.4.0/native/scripts/scp/ubuntu/configSCP.json new file mode 100644 index 00000000..a2dcc74a --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/configSCP.json @@ -0,0 +1,239 @@ +{ + "authTokenUserInformation": { + "id": "data.id", + "name": "data.name", + "organization_code": "data.organization_codes[0]", + "organization_id": "data.organization_ids[0]", + "organizations": "data.organizations", + "roles": "data.organizations[?code={{organization_code}}].roles", + "tenant_code": "data.tenant_code" + }, + "targeting_criteria": { + "factors": [ + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/entityListBasedOnEntityType", + "method": "GET", + "query_params": { + "entityType": "state", + "limit": "{$limit}", + "page": "{$page}", + "paginate": true + }, + "service": "entity-service" + }, + "default": null, + "depends_on": null, + "key": "state", + "mandatory": true, + "multi_select": true, + "order": 1, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/subEntityListBasedOnRoleAndLocation", + "method": "GET", + "path_params": { + "stateId": "{$state._id}" + }, + "query_params": { + "limit": "{$limit}", + "page": "{$page}", + "paginate": true + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "state" + ], + "key": "entityType", + "mandatory": true, + "multi_select": true, + "order": 2, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/entityListBasedOnEntityType", + "method": "GET", + "query_params": { + "entityType": "professional_role", + "limit": "{$limit}", + "page": "{$page}", + "paginate": true + }, + "service": "entity-service" + }, + "default": null, + "depends_on": null, + "key": "professional_role", + "mandatory": true, + "multi_select": true, + "order": 3, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/entityListBasedOnEntityType", + "method": "GET", + "query_params": { + "entityType": "professional_subroles", + "limit": "{$limit}", + "page": "{$page}", + "paginate": true + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "professional_role" + ], + "key": "professional_subroles", + "mandatory": true, + "multi_select": true, + "order": 4, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/subEntityList", + "method": "GET", + "path_params": { + "stateId": "{$state._id}" + }, + "query_params": { + "limit": "{$limit}", + "page": "{$page}", + "paginate": true, + "parentInfoRequired": true, + "type": "district" + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "state" + ], + "key": "district", + "mandatory": true, + "multi_select": true, + "order": 5, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/subEntityList", + "method": "GET", + "path_params": { + "stateId": "{$state._id}" + }, + "query_params": { + "limit": "{$limit}", + "page": "{$page}", + "paginate": true, + "parentInfoRequired": true, + "type": "block" + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "district" + ], + "key": "block", + "mandatory": true, + "multi_select": true, + "order": 6, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/subEntityList", + "method": "GET", + "path_params": { + "stateId": "{$state._id}" + }, + "query_params": { + "limit": "{$limit}", + "page": "{$page}", + "paginate": true, + "parentInfoRequired": true, + "type": "cluster" + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "block" + ], + "key": "cluster", + "mandatory": true, + "multi_select": true, + "order": 7, + "type": "selection" + }, + { + "api": { + "base_name": "entity-management", + "data_key": "result.data", + "endpoint": "v1/entities/subEntityList", + "method": "GET", + "path_params": { + "stateId": "{$state._id}" + }, + "query_params": { + "limit": "{$limit}", + "page": "{$page}", + "paginate": true, + "parentInfoRequired": true, + "type": "school" + }, + "service": "entity-service" + }, + "default": null, + "depends_on": [ + "cluster" + ], + "key": "school", + "mandatory": true, + "multi_select": true, + "order": 8, + "type": "selection" + } + ], + "ui_config": { + "tabs": [ + { + "fields": [ + "state", + "entityType", + "professional_role", + "professional_subroles", + "district", + "block", + "cluster", + "school" + ], + "id": "location", + "name": "Location" + } + ] + } + } +} \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/create-databases.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/create-databases.sh new file mode 100644 index 00000000..bf9d6a5f --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/create-databases.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Run commands as the postgres user +sudo -u postgres psql -p 5432 -c "CREATE USER postgres WITH ENCRYPTED PASSWORD 'postgres';" + +# Create the user database and assign privileges +sudo -u postgres psql -p 5432 -c "CREATE DATABASE users;" +sudo -u postgres psql -p 5432 -d users -c "GRANT ALL PRIVILEGES ON DATABASE users TO postgres;" +sudo -u postgres psql -p 5432 -d users -c "GRANT ALL ON SCHEMA public TO postgres;" + +# Create the scp database and assign privileges +sudo -u postgres psql -p 5432 -c "CREATE DATABASE scp;" +sudo -u postgres psql -p 5432 -d scp -c "GRANT ALL PRIVILEGES ON DATABASE scp TO postgres;" +sudo -u postgres psql -p 5432 -d scp -c "GRANT ALL ON SCHEMA public TO postgres;" + +# Create the notification database and assign privileges +sudo -u postgres psql -p 5432 -c "CREATE DATABASE notification;" +sudo -u postgres psql -p 5432 -d notification -c "GRANT ALL PRIVILEGES ON DATABASE notification TO postgres;" +sudo -u postgres psql -p 5432 -d notification -c "GRANT ALL ON SCHEMA public TO postgres;" + +echo "Database setup complete." \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/entity-project-sample-data.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/entity-project-sample-data.sh new file mode 100644 index 00000000..9fb56eb7 --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/entity-project-sample-data.sh @@ -0,0 +1,813 @@ +#!/bin/bash + +clean_object_id() { + local object_id="$1" + + # Use parameter expansion to remove unwanted characters + cleaned_id="${object_id//ObjectId(/}" + cleaned_id="${cleaned_id//)/}" + cleaned_id="${cleaned_id//\'/}" + + echo "$cleaned_id" +} + + +MONGO_HOST=localhost +MONGO_PORT=27017 + +# Entity database details +ENTITY_SERVICE_DB_NAME="entity" +ENTITY_TYPE_COLLECTION="entityTypes" +ENTITIES_COLLECTION="entities" + +ENTITY_TYPE_DOCUMENT=$(cat < 0) { + print('Entity document updated successfully'); + } else { + throw new Error('Update failed'); + } +" + + + + +# Project database details +PROJECT_DB_NAME="project" +PROJECT_CATEGORY_COLLECTION="projectCategories" + +PROJECT_CATEGORY_DOCUMENT=$(cat < 0) { + print(result.insertedIds); + } else { + throw new Error('Insert failed'); + } +") + + +# Convert the string into an array +IFS=',' read -r -a PROJECT_CATEGORY_ID_ARRAY <<< "$PROJECT_CATEGORY_ID" +PROJECT_CATEGORY_ID=$(echo "$PROJECT_CATEGORY_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | head -n 1) + +echo "Project Category ID: $PROJECT_CATEGORY_ID" + +PROGRAMS_COLLECTION="programs" + +PROGRAMS_DOCUMENT=$(cat < 0) { + print(result.insertedIds); + } else { + throw new Error('Insert failed'); + } +") + +# Convert the string into an array +IFS=',' read -r -a PROJECT_TEMPLATE_ID_ARRAY <<< "$PROJECT_TEMPLATE_ID" + + +PROJECT_TEMPLATE_ID_1=$(echo "$PROJECT_TEMPLATE_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | head -n 1) +PROJECT_TEMPLATE_ID_2=$(echo "$PROJECT_TEMPLATE_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '2p') +PROJECT_TEMPLATE_ID_3=$(echo "$PROJECT_TEMPLATE_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '3p') +PROJECT_TEMPLATE_ID_4=$(echo "$PROJECT_TEMPLATE_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '4p') + + +PROJECT_TEMPLATE_TASKS_COLLECTION="projectTemplateTasks" +PROJECT_TEMPLATE_TASKS_DOCUMENTS=$(cat < 0) { + print(result.insertedIds); + } else { + throw new Error('Insert failed'); + } +") + +# Convert the string into an array +IFS=',' read -r -a PROJECT_TEMPLATE_TASKS_ID_ARRAY <<< "$PROJECT_TEMPLATE_TASKS_ID" + + +echo $PROJECT_TEMPLATE_TASKS_ID + + +PROJECT_TEMPLATE_TASK_ID_1=$(echo "$PROJECT_TEMPLATE_TASKS_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | head -n 1) +PROJECT_TEMPLATE_TASK_ID_2=$(echo "$PROJECT_TEMPLATE_TASKS_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '2p') +PROJECT_TEMPLATE_TASK_ID_3=$(echo "$PROJECT_TEMPLATE_TASKS_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '3p') +PROJECT_TEMPLATE_TASK_ID_4=$(echo "$PROJECT_TEMPLATE_TASKS_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '4p') + +SOLUTIONS_COLLECTION="solutions" + +SOLUTION_DOCUMENT=$(cat < 0) { + print(result.insertedIds); + } else { + throw new Error('Insert failed'); + } +") + +# Convert the string into an array +IFS=',' read -r -a SOLUTION_ID_ARRAY <<< "$SOLUTION_ID" + +echo $SOLUTION_ID + +SOLUTION_ID_1=$(echo "$SOLUTION_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | head -n 1) +SOLUTION_ID_2=$(echo "$SOLUTION_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '2p') +SOLUTION_ID_3=$(echo "$SOLUTION_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '3p') +SOLUTION_ID_4=$(echo "$SOLUTION_ID" | grep -oP "ObjectId\('\K[0-9a-f]{24}" | sed -n '4p') + + +mongosh --host "$MONGO_HOST" --port "$MONGO_PORT" --quiet --eval " + var updateResult = db.getSiblingDB('$PROJECT_DB_NAME').$PROJECT_TEMPLATES_COLLECTION.updateOne( + {_id: ObjectId('$PROJECT_TEMPLATE_ID_1')}, + { + \$set: { + 'solutionId': ObjectId('$SOLUTION_ID_1') + }, + \$push: { + 'tasks': ObjectId('$PROJECT_TEMPLATE_TASK_ID_1') + } + } + ); + if (updateResult.matchedCount > 0) { + print('Document updated successfully for ID: $PROJECT_TEMPLATE_ID_1'); // Output the specific ID + } else { + throw new Error('Update failed for ID: $PROJECT_TEMPLATE_ID_1'); + }" + + +mongosh --host "$MONGO_HOST" --port "$MONGO_PORT" --quiet --eval " + var updateResult = db.getSiblingDB('$PROJECT_DB_NAME').$PROJECT_TEMPLATES_COLLECTION.updateOne( + {_id: ObjectId('$PROJECT_TEMPLATE_ID_2')}, + { + \$set: { + 'solutionId': ObjectId('$SOLUTION_ID_2') + }, + \$push: { + 'tasks': ObjectId('$PROJECT_TEMPLATE_TASK_ID_2') + } + } + ); + if (updateResult.matchedCount > 0) { + print('Document updated successfully for ID: $PROJECT_TEMPLATE_ID_2'); // Output the specific ID + } else { + throw new Error('Update failed for ID: $PROJECT_TEMPLATE_ID_2'); + }" + + +mongosh --host "$MONGO_HOST" --port "$MONGO_PORT" --quiet --eval " + var updateResult = db.getSiblingDB('$PROJECT_DB_NAME').$PROJECT_TEMPLATES_COLLECTION.updateOne( + {_id: ObjectId('$PROJECT_TEMPLATE_ID_3')}, + { + \$set: { + 'solutionId': ObjectId('$SOLUTION_ID_3') + }, + \$push: { + 'tasks': ObjectId('$PROJECT_TEMPLATE_TASK_ID_3') + } + } + ); + if (updateResult.matchedCount > 0) { + print('Document updated successfully for ID: $PROJECT_TEMPLATE_ID_3'); // Output the specific ID + } else { + throw new Error('Update failed for ID: $PROJECT_TEMPLATE_ID_3'); + }" + +CONFIGURATIONS_COLLECTION="configurations" + +CONFIGURATIONS_DOCUMENT=$(cat < { + console.log('Entity data populated successfully.') + }) + .catch(console.error) +main({ dataToBeInserted: projectData }) + .then(() => { + console.log('project data populated successfully.') + }) + .catch(console.error) diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/install-dependencies.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/install-dependencies.sh new file mode 100644 index 00000000..6d6b50ba --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/install-dependencies.sh @@ -0,0 +1,206 @@ +#!/bin/bash + +echo "Starting the installation script..." + +# Function to install Node.js LTS +install_nodejs() { + echo "Installing Node.js version 20..." + curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential +} + + +# Function to install Kafka +install_kafka() { + echo "Installing Kafka..." + sudo DEBIAN_FRONTEND=noninteractive apt install -y openjdk-11-jdk + sudo wget https://archive.apache.org/dist/kafka/3.5.0/kafka_2.12-3.5.0.tgz -O kafka.tgz + sudo tar xzf kafka.tgz -C /opt + sudo mv /opt/kafka_2.12-3.5.0 /opt/kafka + + echo "Creating Zookeeper service..." + sudo bash -c 'cat > /etc/systemd/system/zookeeper.service << EOF +[Unit] +Description=Apache Zookeeper service +Documentation=http://zookeeper.apache.org +Requires=network.target remote-fs.target +After=network.target remote-fs.target + +[Service] +Type=simple +ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties +ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target +EOF' + + echo "Creating Kafka service..." + sudo bash -c 'cat > /etc/systemd/system/kafka.service << EOF +[Unit] +Description=Apache Kafka Service +Documentation=http://kafka.apache.org/documentation.html +Requires=zookeeper.service + +[Service] +Type=simple +Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64" +ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties +ExecStop=/opt/kafka/bin/kafka-server-stop.sh + +[Install] +WantedBy=multi-user.target +EOF' + + sudo systemctl daemon-reload + sudo systemctl start zookeeper + sudo systemctl start kafka +} + +# Function to install Redis +install_redis() { + echo "Installing Redis..." + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt install -y redis-server + sudo sed -i 's/^# *supervised .*/supervised systemd/' /etc/redis/redis.conf + sudo systemctl restart redis.service +} + +# Function to install Redis BullMQ (as a global Node.js package) +install_bullmq() { + echo "Installing Redis BullMQ..." + sudo npm install -g bullmq + echo "Redis BullMQ has been installed globally." +} + +# Function to install Citus +install_citus() { + echo "Installing Citus..." + + # Ensure the 'postgres' user exists + if ! id "postgres" &>/dev/null; then + echo "Creating postgres user..." + sudo useradd -m -s /bin/bash postgres + echo "postgres user created." + else + echo "postgres user already exists." + fi + + # Download and install the Citus repository setup script + curl https://install.citusdata.com/community/deb.sh | sudo bash + + # Install Citus along with PostgreSQL + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-16-citus-12.1 + + # Switch to the postgres user + sudo su - postgres <> ~/citus/postgresql.conf + + # Start the Citus server + pg_ctl -D ~/citus -o "-p 9700" -l ~/citus_logfile start + + # Create the Citus extension + psql -p 9700 -c "CREATE EXTENSION citus;" + + # Check the Citus version + PSQL_OUTPUT=\$(psql -p 9700 -c "select citus_version();") + echo "\$PSQL_OUTPUT" + +EOF +} + +# Function to install PM2 +install_pm2() { + echo "Installing PM2..." + sudo npm install pm2@latest -g +} + +# Function to install MongoDB +install_mongo() { + echo "Installing MongoDB 4.4.14..." + + # Import MongoDB public GPG key + wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - + + # Create the MongoDB source list for Ubuntu (MongoDB 4.4) + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list + + # Update apt and install MongoDB version 4.4.14 + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt install -y mongodb-org=4.4.14 mongodb-org-server=4.4.14 mongodb-org-shell=4.4.14 mongodb-org-mongos=4.4.14 mongodb-org-tools=4.4.14 + + # Start and enable MongoDB service + sudo systemctl start mongod + sudo systemctl enable mongod + echo "MongoDB 4.4.14 has been installed and started." +} + + +# Function to install Gotenberg (via Docker) +install_gotenberg() { + echo "Installing Docker (required for Gotenberg)..." + + # Install Docker + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt install -y docker.io + + # Start and enable Docker service + sudo systemctl start docker + sudo systemctl enable docker + + echo "Docker installed. Pulling Gotenberg Docker image..." + + # Pull and run Gotenberg Docker container + sudo docker pull gotenberg/gotenberg:7 + sudo docker run -d --name gotenberg -p 3000:3000 gotenberg/gotenberg:7 + + echo "Gotenberg has been installed and started on port 3000." +} + +# Function to display options +display_menu() { + echo "Please select an installation option:" + options=("Install Node.js" "Install Kafka" "Install Redis" "Install Citus" "Install PM2" "Install MongoDB" "Install Gotenberg" "Exit") + for i in ${!options[@]}; do + echo "$((i+1)). ${options[i]}" + done +} + +# Main menu +display_menu + +while true; do + read -p "Enter your choice (1-${#options[@]}): " choice + if (( choice > 0 && choice <= ${#options[@]} )); then + case $choice in + 1) install_nodejs ;; + 2) install_kafka ;; + 3) install_redis ;; + 4) install_citus ;; + 5) install_pm2 ;; + 6) install_mongo ;; + 7) install_gotenberg ;; + 8) echo "Exiting the installation script."; break ;; + *) echo "Invalid option. Please try again." ;; + esac + echo "Operation completed. Here are the next options:" + display_menu + else + echo "Invalid option. Please try again." + fi +done + +echo "Installation script completed." \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/project_entity_sample_data.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/project_entity_sample_data.sh new file mode 100644 index 00000000..74166247 --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/project_entity_sample_data.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# ---------------------------------------------------------------------- +# ELEVATE Project Data Setup Script +# +# This script performs the following actions: +# 1. Downloads sample data files from the ELEVATE-Project GitHub repository. +# 2. Installs the 'mongoose' package (required to run the sample scripts). +# 3. Executes the sample data insertion script using Node.js. +# ---------------------------------------------------------------------- + +# Exit immediately if a command exits with a non-zero status (ensures script stops on download failure) +set -e + +echo "Starting data setup script..." + +# --- 1. Define URL and Files --- +BASE_URL="https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu" + +ENTITY_FILE="entity_sampleData.js" +PROJECT_FILE="project_sampleData.js" +INSERT_SCRIPT="insert_sample_solutions.js" + +# --- 2. Download Files --- +echo "1. Downloading sample data files..." + +# Download entity_sampleData.js +curl -L "${BASE_URL}/${ENTITY_FILE}" -o "${ENTITY_FILE}" +echo "Downloaded ${ENTITY_FILE}" + +# Download project_sampleData.js +curl -L "${BASE_URL}/${PROJECT_FILE}" -o "${PROJECT_FILE}" +echo "Downloaded ${PROJECT_FILE}" + +# Download insert_sample_solutions.js (saved correctly to be run by node) +curl -L "${BASE_URL}/${INSERT_SCRIPT}" -o "${INSERT_SCRIPT}" +echo "Downloaded ${INSERT_SCRIPT}" + +# NOTE on Original Request: If you need to populate 'user/src/.env' with a specific file, +# you would add another 'curl' command here, but the file you linked was a JS script. + +# --- 3. Install Dependencies --- +echo "" +echo "2. Installing required Node packages (mongoose)..." +npm install mongoose +npm install mongodb + +# --- 4. Run Insertion Script --- +echo "" +echo "3. Running the sample data insertion script..." +node "${INSERT_SCRIPT}" + +echo "" +echo "--- Data setup complete! ---" \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/project_sampleData.js b/documentation/3.4.0/native/scripts/scp/ubuntu/project_sampleData.js new file mode 100644 index 00000000..6c815cb2 --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/project_sampleData.js @@ -0,0 +1,1612 @@ +const { ObjectId } = require('mongodb') + +let solutionData = [ + { + _id: new ObjectId('68ee4bb3fb9bee08b93b6d68'), + resourceType: ['Improvement Project Solution'], + language: ['English'], + keywords: ['Improvement Project'], + concepts: [], + themes: [], + flattenedThemes: [], + entities: [], + registry: [], + isRubricDriven: false, + enableQuestionReadOut: false, + captureGpsLocationAtQuestionLevel: false, + isAPrivateProgram: false, + allowMultipleAssessemts: false, + isDeleted: false, + pageHeading: 'Domains', + minNoOfSubmissionsRequired: 1, + rootOrganisations: [], + createdFor: [], + submissionLevel: 'USER', + availableForPrivateConsumption: true, + parentEntityKey: null, + deleted: false, + programExternalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF12SDFGHJ345CVBNMDRGYY', + entityType: 'school', + externalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369-PROJECT-SOLUTION', + name: 'pro with obsasatask oct 8 facilitator only 2nd', + description: 'To construct a wired car using a DPDT switch.', + isReusable: false, + startDate: new Date('2025-09-09T00:00:00.000Z'), + endDate: new Date('2026-09-09T18:29:59.000Z'), + subType: 'improvementProject', + type: 'improvementProject', + programId: new ObjectId('68ee4b79fb9bee08b93b6d34'), + programName: 'custom observation as a task check on oct 14th facilitator', + programDescription: 'custom observation as a task check on oct 14th facilitator', + status: 'active', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-14T13:11:17.993Z'), + createdAt: new Date('2025-10-14T13:10:11.897Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + updatedBy: '1', + author: '1', + creator: 'Nevil', + certificateTemplateId: new ObjectId('68ee4bf5fb9bee08b93b6d97'), + link: 'f8a8e9ba397a29cf75ad5057db6cb7f9', + }, + { + _id: new ObjectId('68e8c635201642091e014914'), + resourceType: ['Improvement Project Solution'], + language: ['English'], + keywords: ['Improvement Project'], + concepts: [], + themes: [], + flattenedThemes: [], + entities: [], + registry: [], + isRubricDriven: false, + enableQuestionReadOut: false, + captureGpsLocationAtQuestionLevel: false, + isAPrivateProgram: false, + allowMultipleAssessemts: false, + isDeleted: false, + pageHeading: 'Domains', + minNoOfSubmissionsRequired: 1, + rootOrganisations: [], + createdFor: [], + submissionLevel: 'USER', + availableForPrivateConsumption: true, + parentEntityKey: null, + deleted: false, + programExternalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF123456', + entityType: 'school', + externalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008-PROJECT-SOLUTION', + name: 'Testing Project For LED IMP facilitator only', + description: 'To construct a wired car using a DPDT switch.', + isReusable: false, + startDate: new Date('2025-09-09T00:00:00.000Z'), + endDate: new Date('2026-09-09T18:29:59.000Z'), + subType: 'improvementProject', + type: 'improvementProject', + programId: new ObjectId('68e8c284201642091e0148c1'), + programName: 'custom observation as a task check on oct 10th facilitator', + programDescription: 'custom observation as a task check on oct 10th facilitator', + status: 'active', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-10T08:40:22.617Z'), + createdAt: new Date('2025-10-10T08:39:17.519Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + projectTemplateId: new ObjectId('68e8c635201642091e01491c'), + updatedBy: '1', + author: '1', + creator: 'Nevil', + certificateTemplateId: new ObjectId('68e8c676201642091e014943'), + link: '178ac1fdff5b367ef3335ce0e1665a6c', + }, + { + _id: new ObjectId('68c98d9538aee0086ee61096'), + resourceType: ['Improvement Project Solution'], + language: ['English'], + keywords: ['Improvement Project'], + concepts: [], + themes: [], + flattenedThemes: [], + entities: [], + registry: [], + isRubricDriven: false, + enableQuestionReadOut: false, + captureGpsLocationAtQuestionLevel: false, + isAPrivateProgram: false, + allowMultipleAssessemts: false, + isDeleted: false, + pageHeading: 'Domains', + minNoOfSubmissionsRequired: 1, + rootOrganisations: [], + createdFor: [], + submissionLevel: 'USER', + availableForPrivateConsumption: true, + parentEntityKey: null, + deleted: false, + programExternalId: 'ProgramTestKey1', + entityType: 'school', + externalId: 'ProjectIdtestKey1-1758039445176-PROJECT-SOLUTION', + name: 'Project name sep 16 9 30', + description: + 'Gathers insights from teachers regarding available resources, training needs, and challenges faced in classrooms.', + isReusable: false, + startDate: new Date('2025-07-29T18:30:00.000Z'), + endDate: new Date('2026-01-30T18:29:59.000Z'), + subType: 'improvementProject', + type: 'improvementProject', + programId: new ObjectId('68c98d8f38aee0086ee61070'), + programName: 'Program name is sep 16 9 30', + programDescription: 'Description of the Program', + status: 'active', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-09-16T16:17:25.599Z'), + createdAt: new Date('2025-09-16T16:17:25.472Z'), + __v: 0, + scope: { + professional_role: ['ALL'], + professional_subroles: ['ALL'], + organizations: ['default_code'], + state: ['ALL'], + district: ['ALL'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + projectTemplateId: new ObjectId('68c98d9538aee0086ee6109e'), + }, + { + _id: new ObjectId('68d3b9a72ba17cc3cb238821'), + resourceType: ['Improvement Project Solution'], + language: ['English'], + keywords: ['Improvement Project'], + concepts: [], + themes: [], + flattenedThemes: [], + entities: [], + registry: [], + isRubricDriven: false, + enableQuestionReadOut: false, + captureGpsLocationAtQuestionLevel: false, + isAPrivateProgram: false, + allowMultipleAssessemts: false, + isDeleted: false, + pageHeading: 'Domains', + minNoOfSubmissionsRequired: 1, + rootOrganisations: [], + createdFor: [], + submissionLevel: 'USER', + availableForPrivateConsumption: true, + parentEntityKey: null, + deleted: false, + programExternalId: 'SUP_as_a_task_test_sept_24_1500', + entityType: 'school', + externalId: 'DPDTSCH012025-1758706081315-PROJECT-SOLUTION', + name: 'project sup test with obs or sur tasks sep 23 1520', + description: 'To construct a wired car using a DPDT switch.', + isReusable: false, + startDate: new Date('2025-07-29T18:30:00.000Z'), + endDate: new Date('2025-12-30T18:29:59.000Z'), + subType: 'improvementProject', + type: 'improvementProject', + programId: new ObjectId('68d3b9681e09f9b5b1e0693d'), + programName: 'SUP_as_a_task_test_sept_24_1500', + programDescription: 'This is the description of the program.', + status: 'active', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-09-24T09:28:19.783Z'), + createdAt: new Date('2025-09-24T09:28:07.900Z'), + __v: 0, + scope: { + professional_role: ['ALL'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['ALL'], + district: ['ALL', '6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + projectTemplateId: new ObjectId('68d3b9a92ba17cc3cb238829'), + updatedBy: '1', + author: '1', + creator: 'Nevil', + link: 'a0acc357edbcf3287e9767d20a7d9f12', + }, +] + +let programData = [ + { + _id: new ObjectId('68ee4b79fb9bee08b93b6d34'), + resourceType: ['program'], + language: ['English'], + keywords: ['CBSE', 'SQAA'], + concepts: [], + components: [ + { + _id: new ObjectId('68ee4bb3fb9bee08b93b6d68'), + order: 1, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF12SDFGHJ345CVBNMDRGYY', + name: 'custom observation as a task check on oct 14th facilitator', + description: 'custom observation as a task check on oct 14th facilitator', + startDate: new Date('2025-09-08T18:30:00.000Z'), + endDate: new Date('2026-09-09T18:29:59.000Z'), + imageCompression: { + quality: 10, + }, + metaInformation: { + state: ['Tripura'], + recommendedFor: ['Facilitator'], + }, + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-14T13:18:46.936Z'), + createdAt: new Date('2025-10-14T13:09:13.649Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, + { + _id: new ObjectId('68e8c284201642091e0148c1'), + resourceType: ['program'], + language: ['English'], + keywords: ['CBSE', 'SQAA'], + concepts: [], + components: [ + { + _id: new ObjectId('68e8c635201642091e014914'), + order: 1, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF123456', + name: 'custom observation as a task check on oct 10th facilitator', + description: 'custom observation as a task check on oct 10th facilitator', + startDate: new Date('2025-09-08T18:30:00.000Z'), + endDate: new Date('2026-09-09T18:29:59.000Z'), + imageCompression: { + quality: 10, + }, + metaInformation: { + state: ['Tripura'], + recommendedFor: ['Facilitator'], + }, + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-10T08:44:35.535Z'), + createdAt: new Date('2025-10-10T08:23:32.295Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, + { + _id: new ObjectId('68c98d8f38aee0086ee61070'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('68c98d9538aee0086ee61096'), + order: 1, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'ProgramTestKey1', + name: 'Program name is sep 16 9 30', + description: 'Description of the Program', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['functionaries-officials', 'teacher-educators-coordinators'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-07-29T18:30:00.000Z'), + endDate: new Date('2026-01-30T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-09-16T17:06:14.752Z'), + createdAt: new Date('2025-09-16T16:17:19.239Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, + { + _id: new ObjectId('68d3b9681e09f9b5b1e0693d'), + resourceType: ['program'], + language: ['English'], + keywords: [], + concepts: [], + components: [ + { + _id: new ObjectId('68d3b9a72ba17cc3cb238821'), + order: 1, + }, + ], + isAPrivateProgram: false, + isDeleted: false, + requestForPIIConsent: true, + rootOrganisations: [], + createdFor: [], + deleted: false, + status: 'active', + owner: '1', + createdBy: '1', + updatedBy: '1', + externalId: 'SUP_as_a_task_test_sept_24_1500', + name: 'SUP_as_a_task_test_sept_24_1500 oct 3', + description: 'This is the description of the program.', + metaInformation: { + state: ['Tripura'], + recommendedFor: ['functionaries-officials'], + }, + imageCompression: { + quality: 10, + }, + startDate: new Date('2025-07-29T18:30:00.000Z'), + endDate: new Date('2025-12-30T18:29:59.000Z'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-03T09:20:39.907Z'), + createdAt: new Date('2025-09-24T09:27:04.322Z'), + __v: 0, + scope: { + professional_role: ['68876746b19aea00144c2af9'], + professional_subroles: ['688767deb19aea00144c2b08'], + organizations: ['default_code'], + state: ['6852c86c7248c20014b38a4d'], + district: ['6852c8ae7248c20014b38a57'], + block: ['ALL'], + cluster: ['ALL'], + school: ['ALL'], + }, + }, +] + +let projectTemplatesData = [ + { + _id: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + description: 'To construct a wired car using a DPDT switch.', + concepts: [''], + keywords: ['Science, Activity Based Learning, STEM Education, STEM Lab, DPDT Switch Car'], + isDeleted: false, + recommendedFor: ['Learner'], + tasks: [ + new ObjectId('68ee4bb4fb9bee08b93b6d7a'), + new ObjectId('68ee4bb4fb9bee08b93b6d7e'), + new ObjectId('68ee4bb4fb9bee08b93b6d82'), + new ObjectId('68ee4bb4fb9bee08b93b6d86'), + ], + createdBy: '1', + updatedBy: '1', + learningResources: [], + isReusable: false, + taskSequence: [ + 'DPDTSC-HandBook-1-2025-Task1-1760447411369-1760447411984', + 'DPDTSC-HandBook-1-2025-Task2-1760447411369', + 'DPDTSC-HandBook-1-2025-Task3-1760447411369', + 'DPDTSC-HandBook-1-2025-Task4-1760447411369', + 'DPDTSC-HandBook-1-2025-Task5-1760447411369', + ], + averageRating: 0, + noOfRatings: 0, + ratings: { + 1: 0, + 2: 0, + 3: 0, + 4: 0, + 5: 0, + }, + importCount: 0, + evidences: [], + isPrivate: false, + hasSpotlight: false, + hasStory: false, + text: [], + visibility: 'CURRENT', + visibleToOrganizations: ['default_code'], + deleted: false, + title: 'pro with obsasatask oct 8 facilitator only 2nd', + externalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + categories: [ + { + _id: new ObjectId('685ae6a0cb7c7200145dadae'), + externalId: 'teachers', + name: 'teachers', + }, + ], + entityType: '', + taskCreationForm: '', + durationInDays: 365, + metaInformation: { + testimonials: [], + goal: 'TEMP', + rationale: '', + primaryAudience: '', + duration: '1 year', + successIndicators: '', + risks: '', + approaches: '', + }, + status: 'published', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-14T13:11:17.899Z'), + createdAt: new Date('2025-10-14T13:10:11.630Z'), + __v: 0, + solutionId: new ObjectId('68ee4bb3fb9bee08b93b6d68'), + solutionExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369-PROJECT-SOLUTION', + programId: new ObjectId('68ee4b79fb9bee08b93b6d34'), + programExternalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF12SDFGHJ345CVBNMDRGYY', + parentTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d4c'), + certificateTemplateId: new ObjectId('68ee4bf5fb9bee08b93b6d97'), + }, + { + _id: new ObjectId('68e8c635201642091e01491c'), + description: 'To construct a wired car using a DPDT switch.', + concepts: [''], + keywords: ['Science, Activity Based Learning, STEM Education, STEM Lab, DPDT Switch Car'], + isDeleted: false, + recommendedFor: ['Learner'], + tasks: [ + new ObjectId('68e8c635201642091e014926'), + new ObjectId('68e8c635201642091e01492a'), + new ObjectId('68e8c635201642091e01492e'), + new ObjectId('68e8c635201642091e014932'), + ], + createdBy: '1', + updatedBy: '1', + learningResources: [], + isReusable: false, + taskSequence: [ + 'DPDTSC-HandBook-1-2025-Task1-1760085557008-1760085557606', + 'DPDTSC-HandBook-1-2025-Task2-1760085557008', + 'DPDTSC-HandBook-1-2025-Task3-1760085557008', + 'DPDTSC-HandBook-1-2025-Task4-1760085557008', + 'DPDTSC-HandBook-1-2025-Task5-1760085557008', + ], + averageRating: 0, + noOfRatings: 0, + ratings: { + 1: 0, + 2: 0, + 3: 0, + 4: 0, + 5: 0, + }, + importCount: 0, + evidences: [], + isPrivate: false, + hasSpotlight: false, + hasStory: false, + text: [], + visibility: 'CURRENT', + visibleToOrganizations: ['default_code'], + deleted: false, + title: 'Testing Project For LED IMP facilitator only', + externalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008_IMPORTED', + categories: [ + { + _id: new ObjectId('685ae6a0cb7c7200145dadae'), + externalId: 'teachers', + name: 'teachers', + }, + ], + entityType: '', + taskCreationForm: '', + durationInDays: 365, + metaInformation: { + testimonials: [], + goal: 'TEMP', + rationale: '', + primaryAudience: '', + duration: '1 year', + successIndicators: '', + risks: '', + approaches: '', + }, + status: 'published', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-10T08:40:22.544Z'), + createdAt: new Date('2025-10-10T08:39:17.260Z'), + __v: 0, + solutionId: new ObjectId('68e8c635201642091e014914'), + solutionExternalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008-PROJECT-SOLUTION', + programId: new ObjectId('68e8c284201642091e0148c1'), + programExternalId: 'Testing_for_prTGCEBGFFRYVBDFGJ7DGDGF123456', + parentTemplateId: new ObjectId('68e8c635201642091e0148f8'), + certificateTemplateId: new ObjectId('68e8c676201642091e014943'), + }, + { + _id: new ObjectId('68c98d9538aee0086ee6109e'), + description: + 'Gathers insights from teachers regarding available resources, training needs, and challenges faced in classrooms.', + concepts: [''], + keywords: ['Science, Activity Based Learning, STEM Education, STEM Lab, DPDT Switch Car'], + isDeleted: false, + recommendedFor: [''], + tasks: [ + new ObjectId('68c98d9538aee0086ee610a2'), + new ObjectId('68c98d9538aee0086ee610a6'), + new ObjectId('68c98d9538aee0086ee610aa'), + ], + createdBy: '1', + updatedBy: '1', + learningResources: [], + isReusable: false, + taskSequence: [ + 'Task1-1758039445176', + 'Task2-1758039445176', + 'Task3-1758039445176', + 'Task4-1758039445176', + 'Task5-1758039445176', + ], + averageRating: 0, + noOfRatings: 0, + ratings: { + 1: 0, + 2: 0, + 3: 0, + 4: 0, + 5: 0, + }, + importCount: 0, + evidences: [], + isPrivate: false, + hasSpotlight: false, + hasStory: false, + text: [], + deleted: false, + title: 'Project name sep 16 9 30', + externalId: 'ProjectIdtestKey1-1758039445176_IMPORTED', + categories: [ + { + _id: new ObjectId('685ae6a0cb7c7200145dadae'), + externalId: 'teachers', + name: 'teachers', + }, + ], + entityType: '', + taskCreationForm: '', + durationInDays: 365, + metaInformation: { + testimonials: [], + goal: 'TEMP', + rationale: '', + primaryAudience: '', + duration: '1 year', + successIndicators: '', + risks: '', + approaches: '', + }, + status: 'published', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-09-16T16:17:25.596Z'), + createdAt: new Date('2025-09-16T16:17:25.301Z'), + __v: 0, + solutionId: new ObjectId('68c98d9538aee0086ee61096'), + solutionExternalId: 'ProjectIdtestKey1-1758039445176-PROJECT-SOLUTION', + programId: new ObjectId('68c98d8f38aee0086ee61070'), + programExternalId: 'ProgramTestKey1', + parentTemplateId: new ObjectId('68c98d9538aee0086ee6107a'), + }, + { + _id: new ObjectId('68d3b9a92ba17cc3cb238829'), + description: 'To construct a wired car using a DPDT switch.', + concepts: [''], + keywords: ['Science, Activity Based Learning, STEM Education, STEM Lab, DPDT Switch Car'], + isDeleted: false, + recommendedFor: ['Learner'], + tasks: [ + new ObjectId('68d3b9ad2ba17cc3cb238837'), + new ObjectId('68d3b9ad2ba17cc3cb23883b'), + new ObjectId('68d3b9ae2ba17cc3cb23883f'), + ], + createdBy: '1', + updatedBy: '1', + learningResources: [], + isReusable: false, + taskSequence: [ + 'DPDTSC-HandBook-1/2025-Task1-1758706081315-1758706089304', + 'DPDTSC-HandBook-1/2025-Task2-1758706081315', + 'DPDTSC-HandBook-1/2025-Task3-1758706081315', + 'DPDTSC-HandBook-1/2025-Task4-1758706081315', + 'DPDTSC-HandBook-1/2025-Task5-1758706081315', + ], + averageRating: 0, + noOfRatings: 0, + ratings: { + 1: 0, + 2: 0, + 3: 0, + 4: 0, + 5: 0, + }, + importCount: 0, + evidences: [], + isPrivate: false, + hasSpotlight: false, + hasStory: false, + text: [], + deleted: false, + title: 'project sup test with obs or sur tasks sep 23 1520', + externalId: 'DPDTSCH012025-1758706081315_IMPORTED', + categories: [ + { + _id: new ObjectId('685ae6a0cb7c7200145dadae'), + externalId: 'teachers', + name: 'teachers', + }, + ], + entityType: '', + taskCreationForm: '', + durationInDays: 365, + metaInformation: { + testimonials: [], + goal: 'TEMP', + rationale: '', + primaryAudience: '', + duration: '1 year', + successIndicators: '', + risks: '', + approaches: '', + }, + status: 'published', + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-09-24T09:28:14.561Z'), + createdAt: new Date('2025-09-24T09:28:03.404Z'), + __v: 0, + solutionId: new ObjectId('68d3b9a72ba17cc3cb238821'), + solutionExternalId: 'DPDTSCH012025-1758706081315-PROJECT-SOLUTION', + programId: new ObjectId('68d3b9681e09f9b5b1e0693d'), + programExternalId: 'SUP_as_a_task_test_sept_24_1500', + parentTemplateId: new ObjectId('68d3b9a32ba17cc3cb238805'), + }, +] + +let projectTemplateTasksData = [ + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d7a'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'Activity Steps (Video)', + link: 'https://youtu.be/MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + app: 'projectService', + id: 'MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Watch the Activity Video', + externalId: 'DPDTSC-HandBook-1-2025-Task2-1760447411369-1760447412188', + description: '', + sequenceNumber: '2', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.192Z'), + createdAt: new Date('2025-10-14T13:10:11.805Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d7e'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'DPDTSC-HandBook-1-2025-Task3-1760447411369-1760447412197', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.202Z'), + createdAt: new Date('2025-10-14T13:10:11.813Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d82'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'learn', + link: 'https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link', + app: 'projectService', + id: 'view?usp=drive_link', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: 'Conduct the Activity Assessment', + externalId: 'DPDTSC-HandBook-1-2025-Task4-1760447411369-1760447412206', + description: '', + sequenceNumber: '4', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.210Z'), + createdAt: new Date('2025-10-14T13:10:11.825Z'), + __v: 0, + }, + { + _id: new ObjectId('68ee4bb4fb9bee08b93b6d86'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'walking', + link: 'https://drive.google.com/file/d/1eGLKxFb9BaeroTeIOlXoO8XCxyah7fM9/view?usp=sharing', + app: 'projectService', + id: 'view?usp=sharing', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68ee4bb3fb9bee08b93b6d70'), + projectTemplateExternalId: 'PROJ19099023DGHG789SDASDFGHR4567-1760447411369_IMPORTED', + name: "Log into the scanner app and scan the OMR sheets (check that the students' names are appearing on scanning the OMR)", + externalId: 'DPDTSC-HandBook-1-2025-Task5-1760447411369-1760447412214', + description: '', + sequenceNumber: '5', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2025', + endDate: '31/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-14T13:10:12.218Z'), + createdAt: new Date('2025-10-14T13:10:11.833Z'), + __v: 0, + }, + { + _id: new ObjectId('68e8c635201642091e014926'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'Activity Steps (Video)', + link: 'https://youtu.be/MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + app: 'projectService', + id: 'MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68e8c635201642091e01491c'), + projectTemplateExternalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008_IMPORTED', + name: 'Watch the Activity Video', + externalId: 'DPDTSC-HandBook-1-2025-Task2-1760085557008-1760085557809', + description: '', + sequenceNumber: '2', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2026', + endDate: '31/12/2026', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-10T08:39:17.813Z'), + createdAt: new Date('2025-10-10T08:39:17.430Z'), + __v: 0, + }, + { + _id: new ObjectId('68e8c635201642091e01492a'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68e8c635201642091e01491c'), + projectTemplateExternalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'DPDTSC-HandBook-1-2025-Task3-1760085557008-1760085557818', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2027', + endDate: '31/12/2027', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-10T08:39:17.822Z'), + createdAt: new Date('2025-10-10T08:39:17.439Z'), + __v: 0, + }, + { + _id: new ObjectId('68e8c635201642091e01492e'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'learn', + link: 'https://drive.google.com/file/d/1HOaFxlahxEzc5HOeFqVTw3V_yszmHFbZ/view?usp=drive_link', + app: 'projectService', + id: 'view?usp=drive_link', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68e8c635201642091e01491c'), + projectTemplateExternalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008_IMPORTED', + name: 'Conduct the Activity Assessment', + externalId: 'DPDTSC-HandBook-1-2025-Task4-1760085557008-1760085557827', + description: '', + sequenceNumber: '4', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2028', + endDate: '31/12/2028', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-10T08:39:17.831Z'), + createdAt: new Date('2025-10-10T08:39:17.449Z'), + __v: 0, + }, + { + _id: new ObjectId('68e8c635201642091e014932'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'walking', + link: 'https://drive.google.com/file/d/1eGLKxFb9BaeroTeIOlXoO8XCxyah7fM9/view?usp=sharing', + app: 'projectService', + id: 'view?usp=sharing', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68e8c635201642091e01491c'), + projectTemplateExternalId: 'PROJ190909764HJHF123FGHHcvvbgd-1760085557008_IMPORTED', + name: "Log into the scanner app and scan the OMR sheets (check that the students' names are appearing on scanning the OMR)", + externalId: 'DPDTSC-HandBook-1-2025-Task5-1760085557008-1760085557835', + description: '', + sequenceNumber: '5', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '01/08/2029', + endDate: '31/12/2029', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-10-10T08:39:17.840Z'), + createdAt: new Date('2025-10-10T08:39:17.458Z'), + __v: 0, + }, + { + _id: new ObjectId('68c98d9538aee0086ee610a2'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'Activity Manual (PDF)', + link: 'https://docs.google.com/document/d/1NCUdj9nPAz82sPV5q2BJ8At31sFJdSDwocrDCh_g7W0/edit?tab=t.0', + app: 'projectService', + id: 'edit?tab=t.0', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68c98d9538aee0086ee6109e'), + projectTemplateExternalId: 'ProjectIdtestKey1-1758039445176_IMPORTED', + name: 'Review the Activity Manual', + externalId: 'Task1-1758039445176-1758039445561', + description: '', + sequenceNumber: '1', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '28/07/2025', + endDate: '30/01/2026', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-16T16:17:25.564Z'), + createdAt: new Date('2025-09-16T16:17:25.375Z'), + __v: 0, + }, + { + _id: new ObjectId('68c98d9538aee0086ee610a6'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'Activity Steps (Video)', + link: 'https://youtu.be/MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + app: 'projectService', + id: 'MNvM_H9zD3Y?si=BdfslSzCkmDCggih', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68c98d9538aee0086ee6109e'), + projectTemplateExternalId: 'ProjectIdtestKey1-1758039445176_IMPORTED', + name: 'Watch the Activity Video', + externalId: 'Task2-1758039445176-1758039445567', + description: '', + sequenceNumber: '2', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '29/07/2025', + endDate: '30/01/2027', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-16T16:17:25.571Z'), + createdAt: new Date('2025-09-16T16:17:25.386Z'), + __v: 0, + }, + { + _id: new ObjectId('68c98d9538aee0086ee610aa'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68c98d9538aee0086ee6109e'), + projectTemplateExternalId: 'ProjectIdtestKey1-1758039445176_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'Task3-1758039445176-1758039445575', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '30/07/2025', + endDate: '30/01/2028', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-16T16:17:25.579Z'), + createdAt: new Date('2025-09-16T16:17:25.396Z'), + __v: 0, + }, + { + _id: new ObjectId('68d3b9ad2ba17cc3cb238837'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68d3b9a92ba17cc3cb238829'), + projectTemplateExternalId: 'DPDTSCH012025-1758706081315_IMPORTED', + name: 'Conduct the Activity with students', + externalId: 'DPDTSC-HandBook-1/2025-Task3-1758706081315-1758706093343', + description: '', + sequenceNumber: '3', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '30/07/2025', + endDate: '30/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-24T09:28:13.534Z'), + createdAt: new Date('2025-09-24T09:28:06.227Z'), + __v: 0, + }, + { + _id: new ObjectId('68d3b9ad2ba17cc3cb23883b'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [ + { + name: 'Activity Assessment (PDF)', + link: 'https://sunbirdsaaspublic.blob.core.windows.net/content/content/assets/do_2143687931908833281255/dpdt-switch-car.pdf', + app: 'projectService', + id: 'dpdt-switch-car.pdf', + }, + { + name: 'Activity OMR Sheet (PDF)', + link: 'https://drive.google.com/file/d/1-f7Tg8bmZd-xlcxlhfOcf2ZO6vpc6qkH/view', + app: 'projectService', + id: 'view', + }, + ], + deleted: false, + type: 'content', + projectTemplateId: new ObjectId('68d3b9a92ba17cc3cb238829'), + projectTemplateExternalId: 'DPDTSCH012025-1758706081315_IMPORTED', + name: 'Conduct the Activity Assessment', + externalId: 'DPDTSC-HandBook-1/2025-Task4-1758706081315-1758706093849', + description: '', + sequenceNumber: '4', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '30/07/2025', + endDate: '30/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-24T09:28:13.967Z'), + createdAt: new Date('2025-09-24T09:28:06.583Z'), + __v: 0, + }, + { + _id: new ObjectId('68d3b9ae2ba17cc3cb23883f'), + createdBy: '1', + updatedBy: '1', + isDeleted: false, + isDeletable: false, + taskSequence: [], + children: [], + visibleIf: [], + hasSubTasks: false, + learningResources: [], + deleted: false, + type: 'simple', + projectTemplateId: new ObjectId('68d3b9a92ba17cc3cb238829'), + projectTemplateExternalId: 'DPDTSCH012025-1758706081315_IMPORTED', + name: "Log into the scanner app and scan the OMR sheets (check that the students' names are appearing on scanning the OMR)", + externalId: 'DPDTSC-HandBook-1/2025-Task5-1758706081315-1758706094241', + description: '', + sequenceNumber: '5', + tenantId: 'default', + orgId: 'default_code', + metaInformation: { + hasAParentTask: 'NO', + parentTaskOperator: '', + parentTaskValue: '', + parentTaskId: '', + startDate: '30/07/2025', + endDate: '30/12/2025', + isAnExternalTask: '', + minNoOfSubmissionsRequired: '', + redirectLink: '', + buttonLabel: '', + }, + updatedAt: new Date('2025-09-24T09:28:14.374Z'), + createdAt: new Date('2025-09-24T09:28:07.083Z'), + __v: 0, + }, +] + +let certificateTemplatesData = [ + { + _id: new ObjectId('68ee4bf5fb9bee08b93b6d97'), + status: 'active', + deleted: false, + criteria: { + validationText: 'Complete validation message', + expression: 'C1&&(C3||C4||C5||C6)', + conditions: { + C1: { + validationText: 'Submit your project.', + expression: 'C1', + conditions: { + C1: { + scope: 'project', + key: 'status', + operator: '==', + value: 'submitted', + }, + }, + }, + C3: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68ee4bb3fb9bee08b93b6d53'], + }, + }, + validationText: 'Add 2 evidence for any task', + }, + C4: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68ee4bb3fb9bee08b93b6d57'], + }, + }, + }, + C5: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68ee4bb3fb9bee08b93b6d5b'], + }, + }, + }, + C6: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68ee4bb3fb9bee08b93b6d63'], + }, + }, + }, + }, + }, + issuer: { + name: 'default_code', + }, + solutionId: new ObjectId('68ee4bb3fb9bee08b93b6d68'), + programId: new ObjectId('68ee4b79fb9bee08b93b6d34'), + baseTemplateId: new ObjectId('68c008dfd113c30c11f1aca2'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-14T13:11:17.793Z'), + createdAt: new Date('2025-10-14T13:11:17.628Z'), + __v: 0, + templateUrl: + 'certificate/aa8529e3-6754-4432-a669-72b73d358e2f/1/7042c718-a1bf-43e3-b296-586de247a440/68ee4bf5fb9bee08b93b6d97/14-9-2025-1760447477692_Dowloaded.svg', + }, + { + _id: new ObjectId('68e8c676201642091e014943'), + status: 'active', + deleted: false, + criteria: { + validationText: 'Complete validation message', + expression: 'C1&&(C3||C4||C5||C6||C7)', + conditions: { + C1: { + validationText: 'Submit your project.', + expression: 'C1', + conditions: { + C1: { + scope: 'project', + key: 'status', + operator: '==', + value: 'submitted', + }, + }, + }, + C3: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68e8c635201642091e0148ff'], + }, + }, + validationText: 'Add 2 evidence for any task', + }, + C4: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68e8c635201642091e014903'], + }, + }, + }, + C5: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68e8c635201642091e014907'], + }, + }, + }, + C6: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68e8c635201642091e01490b'], + }, + }, + }, + C7: { + expression: 'C1', + conditions: { + C1: { + scope: 'task', + key: 'attachments', + function: 'count', + filter: { + key: 'type', + value: 'all', + }, + operator: '>=', + value: 2, + taskDetails: ['68e8c635201642091e01490f'], + }, + }, + }, + }, + }, + issuer: { + name: 'default_code', + }, + solutionId: new ObjectId('68e8c635201642091e014914'), + programId: new ObjectId('68e8c284201642091e0148c1'), + baseTemplateId: new ObjectId('68c008dfd113c30c11f1aca2'), + tenantId: 'default', + orgId: 'default_code', + updatedAt: new Date('2025-10-10T08:40:22.454Z'), + createdAt: new Date('2025-10-10T08:40:22.298Z'), + __v: 0, + templateUrl: + 'certificate/0bcc856d-0145-448c-8188-300ca3f3250e/1/58cfdf3c-f1a2-4a94-bbb5-21dcd7286913/68e8c676201642091e014943/10-9-2025-1760085622353_Dowloaded.svg', + }, +] + +let certificateBaseTemplatesData = [ + { + _id: new ObjectId('68c008dfd113c30c11f1aca2'), + deleted: false, + code: 'onelogo_onesign', + name: 'onelogo_onesign', + url: 'certificate/ef2058a1-92e0-4a63-af5f-b712f992bf90/1/81fc35ad-9519-4ec4-87bb-6cef64b940f0/9-8-2025-1757415647754_sl_s1l1.svg', + tenantId: 'default', + orgId: 'slorg', + updatedAt: new Date('2025-09-09T11:00:47.878Z'), + createdAt: new Date('2025-09-09T11:00:47.878Z'), + __v: 0, + }, +] + +let projectCategoriesData = [ + { + _id: new ObjectId('685ae6a0cb7c7200145dadae'), + createdBy: 'SYSTEM', + updatedBy: 'SYSTEM', + isDeleted: false, + isVisible: true, + status: 'active', + icon: '', + noOfProjects: 361, + evidences: [], + deleted: false, + name: 'teachers', + externalId: 'teachers', + tenantId: 'default', + orgId: 'slorg', + updatedAt: new Date('2025-06-24T17:55:44.720Z'), + createdAt: new Date('2025-06-24T17:55:44.720Z'), + __v: 0, + }, +] +module.exports = { + solutionData, + programData, + projectTemplatesData, + projectTemplateTasksData, + certificateTemplatesData, + certificateBaseTemplatesData, + projectCategoriesData, +} diff --git a/documentation/3.4.0/native/scripts/scp/ubuntu/uninstall-dependencies.sh b/documentation/3.4.0/native/scripts/scp/ubuntu/uninstall-dependencies.sh new file mode 100644 index 00000000..32a30ce6 --- /dev/null +++ b/documentation/3.4.0/native/scripts/scp/ubuntu/uninstall-dependencies.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +# Define color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# Function to show the menu +show_menu() { + echo -e "${GREEN}Please choose an option to uninstall:${NC}" + echo "1) PM2" + echo "2) Node.js and npm" + echo "3) Kafka and Zookeeper" + echo "4) Redis" + echo "5) MongoDB" + echo "6) Citus and PostgreSQL" + echo "7) Gotenberg" + echo "8) Exit" + echo -e "${GREEN}Enter your choice [1-8]: ${NC}" +} + +# Function to uninstall PM2 +uninstall_pm2() { + echo -e "${RED}Uninstalling PM2...${NC}" + sudo npm uninstall -g pm2 +} + +# Function to uninstall Node.js and npm +uninstall_nodejs() { + echo -e "${RED}Uninstalling Node.js and npm...${NC}" + sudo apt-get remove -y nodejs + sudo apt-get purge -y nodejs + sudo apt-get autoremove -y +} + +# Function to uninstall Kafka and Zookeeper +uninstall_kafka_zookeeper() { + echo -e "${RED}Removing Kafka and Zookeeper...${NC}" + sudo systemctl stop kafka + sudo systemctl disable kafka + sudo systemctl stop zookeeper + sudo systemctl disable zookeeper + sudo rm /etc/systemd/system/kafka.service + sudo rm /etc/systemd/system/zookeeper.service + sudo rm -rf /opt/kafka + sudo systemctl daemon-reload +} + +# Function to uninstall Redis +uninstall_redis() { + echo -e "${RED}Uninstalling Redis...${NC}" + sudo systemctl stop redis + sudo systemctl disable redis + sudo apt-get remove -y redis-server + sudo apt-get purge -y redis-server + sudo apt-get autoremove -y +} + +# Function to uninstall Redis BullMQ +uninstall_bullmq() { + echo -e "${RED}Uninstalling Redis BullMQ...${NC}" + sudo npm uninstall -g bullmq + echo -e "${GREEN}Redis BullMQ has been uninstalled.${NC}" +} + +# Function to uninstall MongoDB +uninstall_mongodb() { + echo -e "${RED}Uninstalling MongoDB...${NC}" + sudo systemctl stop mongod + sudo systemctl disable mongod + sudo apt-get remove -y mongodb-org + sudo apt-get purge -y mongodb-org + sudo apt-get autoremove -y + sudo rm -rf /var/log/mongodb + sudo rm -rf /var/lib/mongodb + sudo rm /etc/apt/sources.list.d/mongodb-org-*.list + echo -e "${GREEN}MongoDB has been uninstalled.${NC}" +} + +# Function to uninstall Citus and PostgreSQL +uninstall_citus_postgresql() { + echo -e "${RED}Uninstalling Citus and PostgreSQL...${NC}" + sudo su - postgres -c "pg_ctl -D ~/citus stop" + sudo apt-get remove -y postgresql-16-citus-12.1 + sudo apt-get purge -y postgresql-16-citus-12.1 + sudo apt-get remove -y postgresql* + sudo apt-get purge -y postgresql* + sudo apt-get autoremove -y + sudo pkill -u postgres + sudo deluser --remove-home postgres +} + +# Function to uninstall Gotenberg +uninstall_gotenberg() { + echo -e "${RED}Uninstalling Gotenberg...${NC}" + + # Stop and remove the Gotenberg Docker container + sudo docker stop gotenberg + sudo docker rm gotenberg + + # Optionally uninstall Docker (if it's no longer needed) + echo -e "${GREEN}Do you also want to uninstall Docker? (y/n)${NC}" + read uninstall_docker + if [[ "$uninstall_docker" == "y" || "$uninstall_docker" == "Y" ]]; then + echo -e "${RED}Uninstalling Docker...${NC}" + sudo apt-get remove -y docker.io + sudo apt-get purge -y docker.io + sudo apt-get autoremove -y + sudo rm -rf /var/lib/docker + echo -e "${GREEN}Docker has been uninstalled.${NC}" + fi + echo -e "${GREEN}Gotenberg has been uninstalled.${NC}" +} + +# Main loop +while true; do + show_menu + read choice + case $choice in + 1) uninstall_pm2 ;; + 2) uninstall_nodejs ;; + 3) uninstall_kafka_zookeeper ;; + 4) uninstall_redis ;; + 5) uninstall_mongodb ;; + 6) uninstall_citus_postgresql ;; + 7) uninstall_gotenberg ;; + 8) echo -e "${GREEN}Exiting uninstallation process.${NC}"; exit ;; + *) echo -e "${RED}Invalid option, please try again.${NC}" ;; + esac + echo -e "${GREEN}Operation completed.${NC}" +done \ No newline at end of file diff --git a/documentation/3.4.0/native/scripts/stand-alone/ubuntu/insert_sample_data.sh b/documentation/3.4.0/native/scripts/stand-alone/ubuntu/insert_sample_data.sh index fabcff4d..8cf48b85 100644 --- a/documentation/3.4.0/native/scripts/stand-alone/ubuntu/insert_sample_data.sh +++ b/documentation/3.4.0/native/scripts/stand-alone/ubuntu/insert_sample_data.sh @@ -55,4 +55,4 @@ sudo -u postgres psql -p 5432 -d users -c "INSERT INTO public.entity_types (id, sudo -u postgres psql -p 5432 -d users -c "SELECT nextval('users_id_seq'::regclass) FROM public.users;" sudo -u postgres psql -p 5432 -d users -c "SELECT nextval('users_credentials_id_seq'::regclass) FROM public.users_credentials;" sudo -u postgres psql -p 5432 -d users -c "UPDATE role_permission_mapping SET role_title = 'state_education_officer' WHERE role_title = 'mentor';" -sudo -u postgres psql -p 5432 -d users -c "SELECT NULL;" \ No newline at end of file +sudo -u postgres psql -p 5432 -d users -c "SELECT NULL;" diff --git a/documentation/3.4.0/sample-data/mac-linux/user/sampleData.sql b/documentation/3.4.0/sample-data/mac-linux/user/sampleData.sql index 9744d2fe..ee3018ab 100644 --- a/documentation/3.4.0/sample-data/mac-linux/user/sampleData.sql +++ b/documentation/3.4.0/sample-data/mac-linux/user/sampleData.sql @@ -1,3 +1,4 @@ + INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (1, 'Rahul R B', 'a0db5e0a39ee13db7fc5d1309e637f2c', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e4','+91', NULL); INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (2, 'Prajwal C S', 'c4113be1bc2cef51981a6ec687302e42fc4f87f4dfac4276584844d9e3e0f5ae', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a767','+91', NULL); INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (3, 'Vishnu V P', '1092be87fd483fce1deba56c8cdefa79bed4f70a4b110fc4e7947c57aacff219', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e0','+91', NULL); diff --git a/documentation/3.4.0/sample-data/scp/mac-linux/user/sampleData.sql b/documentation/3.4.0/sample-data/scp/mac-linux/user/sampleData.sql new file mode 100644 index 00000000..48620b41 --- /dev/null +++ b/documentation/3.4.0/sample-data/scp/mac-linux/user/sampleData.sql @@ -0,0 +1,28 @@ +INSERT INTO public.user_roles (id, title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label) VALUES (8, 'state_education_officer', 0, 'ACTIVE', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, 'PUBLIC', 1, 'State Education Officer'); +INSERT INTO public.user_roles (id, title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label) VALUES (9, 'content_creator', 0, 'ACTIVE', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, 'PUBLIC', 1, 'Content Creator'); +INSERT INTO public.user_roles (id, title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label) VALUES (10, 'reviewer', 0, 'ACTIVE', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, 'PUBLIC', 1, 'Reviewer'); +INSERT INTO public.user_roles (id, title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label) VALUES (11, 'program_designer', 0, 'ACTIVE', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, 'PUBLIC', 1, 'Program Designer'); +INSERT INTO public.user_roles (id, title, user_type, status, created_at, updated_at, deleted_at, visibility, organization_id, label) VALUES (12, 'program_manager', 0, 'ACTIVE', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, 'PUBLIC', 1, 'Program Manager'); +INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (1, 'Rahul R B', 'a0db5e0a39ee13db7fc5d1309e637f2c', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e4','+91', NULL); +INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (2, 'Prajwal C S', 'c4113be1bc2cef51981a6ec687302e42fc4f87f4dfac4276584844d9e3e0f5ae', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a767','+91', NULL); +INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (3, 'Vishnu V P', '1092be87fd483fce1deba56c8cdefa79bed4f70a4b110fc4e7947c57aacff219', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a7e0','+91', NULL); +INSERT INTO public.users (id, name, email, email_verified, roles, status, password, has_accepted_terms_and_conditions, about, location, languages, preferred_language, share_link, image, custom_entity_text, meta, created_at, updated_at, deleted_at, tenant_code, phone, phone_code, configs) VALUES (4, 'Mallanagouda R B', 'e5fc674d4b1a54c6cf772485e3bca6f7ae14b60de32b9f0cd9f955ee469345bc', false, '{8,2}', 'ACTIVE', '\$2a\$10\$NTzc2CjEbwB4DavjEKU11eqJXJLrODnvAwvXWor9Dz/gXr55Pvyj.', true, NULL, NULL, NULL, 'en', NULL, NULL, NULL, NULL, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.426+00', NULL, 'default','53bc5d0ff0c53bee460c08b8afe087455050dc7529a2f1d4f7319c0da653a700','+91', NULL); + +INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (1, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (2, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (3, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organizations (user_id,organization_code, tenant_code, created_at, updated_at, deleted_at) VALUES (4, 'default_code', 'default', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); + + +INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 2, 'default_code', 1, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 3, 'default_code', 2, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 2, 'default_code', 3, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); +INSERT INTO public.user_organization_roles (tenant_code, user_id, organization_code,role_id, created_at, updated_at, deleted_at) VALUES ('default', 4, 'default_code', 3, '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL); + + +INSERT INTO public.entity_types (id, value, label, status, created_by, updated_by, allow_filtering, data_type, organization_id, parent_id, has_entities, allow_custom_entities, model_names, created_at, updated_at, deleted_at, meta, external_entity_type, required, regex, tenant_code,organization_code) VALUES (5, 'state', 'State', 'ACTIVE', 0, 0, true, 'STRING', 1, NULL, true, true, '{User}', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, '{\"service\": \"entity-management-service\",\"endPoint\": \"v1/entities/find\"}', true, false, NULL,'default', 'default_code'); +INSERT INTO public.entity_types (id, value, label, status, created_by, updated_by, allow_filtering, data_type, organization_id, parent_id, has_entities, allow_custom_entities, model_names, created_at, updated_at, deleted_at, meta, external_entity_type, required, regex) VALUES (5, 'district', 'District', 'ACTIVE', 0, 0, true, 'STRING', 1, NULL, true, true, '{User}', '2024-04-18 08:12:19.394+00', '2024-04-18 08:12:19.394+00', NULL, NULL, true, false, NULL); +UPDATE public.entity_types SET status = 'INACTIVE' WHERE id = 3; +SELECT nextval('users_id_seq'::regclass) FROM public.users; +SELECT nextval('users_credentials_id_seq'::regclass) FROM public.users_credentials; +SELECT NULL; \ No newline at end of file diff --git a/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md b/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md index b986957c..a458de22 100644 --- a/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md +++ b/documentation/3.4.0/setup/docker/project-with-survey/mac-os/README.md @@ -35,7 +35,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -104,12 +104,12 @@ To enable the Citus extension for user services, follow these steps. To enable full functionality—including certificate generation, attachment uploads, and report storage—you must configure cloud credentials in the environment files for both services. A. Project Service Configuration Path: - ```./project_env - ``` +`./project_env + ` B. Samiksha (Survey & Observation) Service Configuration Path: - ```./samiksha_env - ``` +`./samiksha_env + ` Add or update the following variables in the .env file, substituting the example values with your actual cloud credentials: @@ -124,8 +124,6 @@ Add or update the following variables in the .env file, substituting the example For detailed configuration options, supported cloud providers, and integration guidelines, please refer to the official documentation available [here](https://www.npmjs.com/package/client-cloud-services?activeTab=readme) - - ## Persistence Of Database Data In Docker Container (Optional) To ensure the persistence of database data when running `docker compose down`, it is necessary to modify the `docker-compose-project.yml` file according to the steps given below: @@ -217,11 +215,11 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection -- - Samiksha Service API Collection - +- + Projects Service API Collection +- + Samiksha Service API Collection + --- @@ -232,11 +230,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -258,4 +256,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md b/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md index bbe31780..db667f79 100644 --- a/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md +++ b/documentation/3.4.0/setup/docker/project-with-survey/ubuntu/README.md @@ -35,7 +35,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -97,18 +97,17 @@ To enable the Citus extension for user services, follow these steps. sudo ./citus_setup.sh user postgres://postgres:postgres@citus_master:5432/user ``` - ## Update Cloud Credentials for Project Service To enable full functionality—including certificate generation, attachment uploads, and report storage—you must configure cloud credentials in the environment files for both services. A. Project Service Configuration Path: - ```./project_env - ``` +`./project_env + ` B. Samiksha (Survey & Observation) Service Configuration Path: - ```./samiksha_env - ``` +`./samiksha_env + ` Add or update the following variables in the .env file, substituting the example values with your actual cloud credentials: @@ -123,7 +122,6 @@ Add or update the following variables in the .env file, substituting the example For detailed configuration options, supported cloud providers, and integration guidelines, please refer to the official documentation available in this [ReadMe](https://www.npmjs.com/package/client-cloud-services?activeTab=readme) - ## Persistence Of Database Data In Docker Container (Optional) To ensure the persistence of database data when running `docker compose down`, it is necessary to modify the `docker-compose-project.yml` file according to the steps given below: @@ -216,11 +214,11 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection -- - Samiksha Service API Collection - +- + Projects Service API Collection +- + Samiksha Service API Collection + --- @@ -231,11 +229,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -246,6 +244,7 @@ For a comprehensive guide on setting up and using the SUP, please refer to: --- + # Open Source Dependencies This project uses several open-source tools and dependencies that supported its development @@ -256,4 +255,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md b/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md index 5bf0a10d..79375482 100644 --- a/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md +++ b/documentation/3.4.0/setup/docker/project-with-survey/windows/README.md @@ -35,7 +35,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -60,16 +60,16 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569 4301) do @( 2. **Download Environment Files**: Using the OS specific commands given below, download environment files for all the services. - ``` - curl -L ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/interface_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/entity_management_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/project_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/notification_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/scheduler_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/user_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/samiksha_env - ``` +``` +curl -L ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/interface_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/entity_management_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/project_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/notification_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/scheduler_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/user_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/samiksha_env +``` > **Note:** Modify the environment files as necessary for your deployment using any text editor, ensuring that the values are appropriate for your environment. The default values provided in the current files are functional and serve as a good starting point. Refer to the sample env files provided at the [Project](https://github.com/ELEVATE-Project/project-service/blob/main/.env.sample), [User](https://github.com/ELEVATE-Project/user/blob/master/src/.env.sample), [Notification](https://github.com/ELEVATE-Project/notification/blob/master/src/.env.sample), [Scheduler](https://github.com/ELEVATE-Project/scheduler/blob/master/src/.env.sample), [Interface](https://github.com/ELEVATE-Project/interface-service/blob/main/src/.env.sample) and [Entity-management](https://github.com/ELEVATE-Project/entity-management/blob/main/src/.env.sample) repositories for reference. @@ -77,25 +77,25 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569 4301) do @( 3. **Download `docker-compose-up` & `docker-compose-down` Script Files** - ``` - curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/docker-compose-up.bat - ``` - ``` - curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/docker-compose-down.bat - ``` +``` +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/docker-compose-up.bat +``` + +``` +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/docker-compose-down.bat +``` 4. **Download `Config` File** - ``` - curl -L https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/common-files/generics/configFile.json -o config.json - ``` - +``` +curl -L https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/common-files/generics/configFile.json -o config.json +``` 5. **Run All Services & Dependencies**:All services and dependencies can be started using the `docker-compose-up` script file. - ``` - docker-compose-up.bat - ``` +``` +docker-compose-up.bat +``` > Double-click the file or run the above command from the terminal. @@ -103,10 +103,10 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569 4301) do @( 6. **Remove All Service & Dependency Containers**: All docker containers can be stopped and removed by using the `docker-compose-down` file. - - ``` - docker-compose-down.bat - ``` + +``` +docker-compose-down.bat +``` > **Caution**: As per the default configuration in the `docker-compose-project.yml` file, using the `down` command will lead to data loss since the database container does not persist data. To persist data across `down` commands and subsequent container removals, refer to the "Persistence of Database Data in Docker Containers" section of this documentation. @@ -124,27 +124,27 @@ To enable the Citus extension for user services, follow these steps. ``` 2. Set up the citus_setup file by following the steps given below. - 1. Download the `citus_setup.bat` file. - ``` - curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/citus_setup.bat - ``` - 2. Enable Citus and set distribution columns for `user` database by running the `citus_setup.bat`with the following arguments. - ``` - citus_setup.bat user postgres://postgres:postgres@citus_master:5432/user - ``` - > **Note:** Since the `citus_setup.bat` file requires arguments, it must be run from a terminal. + 1. Download the `citus_setup.bat` file. + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/citus_setup.bat + ``` + 2. Enable Citus and set distribution columns for `user` database by running the `citus_setup.bat`with the following arguments. + ``` + citus_setup.bat user postgres://postgres:postgres@citus_master:5432/user + ``` + > **Note:** Since the `citus_setup.bat` file requires arguments, it must be run from a terminal. ## Update Cloud Credentials for Project Service To enable full functionality—including certificate generation, attachment uploads, and report storage—you must configure cloud credentials in the environment files for both services. A. Project Service Configuration Path: - ```./project_env - ``` +`./project_env + ` B. Samiksha (Survey & Observation) Service Configuration Path: - ```./samiksha_env - ``` +`./samiksha_env + ` Add or update the following variables in the .env file, substituting the example values with your actual cloud credentials: @@ -212,24 +212,25 @@ During the initial setup of Project services with the default configuration, you In such cases, you can generate sample user accounts using the steps below. This allows you to explore the Project services and portal immediately after setup. > **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. - 1. **Download The `sampleData.sql` Files:** - ``` - mkdir sample-data\user 2>nul & ^ - curl -L "https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/sampleData.sql" -o sample-data\user\sampleData.sql - ``` +1. **Download The `sampleData.sql` Files:** + + ``` + mkdir sample-data\user 2>nul & ^ + curl -L "https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/project-with-survey/windows/sampleData.sql" -o sample-data\user\sampleData.sql + ``` 2. **Download The `insert_sample_data` Script File:** - ``` - curl -L -o insert_sample_data.bat https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/sampleData.sql - ``` + ``` + curl -L -o insert_sample_data.bat https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/sampleData.sql + ``` 3. **Run The `insert_sample_data` Script File:** - ``` - insert_sample_data.bat user postgres://postgres:postgres@citus_master:5432/user - ``` + ``` + insert_sample_data.bat user postgres://postgres:postgres@citus_master:5432/user + ``` After successfully running the script mentioned above, the following user accounts will be created and available for login: @@ -239,30 +240,30 @@ In such cases, you can generate sample user accounts using the steps below. This | prajwal@gmail.com | Password1@ | State Education Officer | | vishnu@gmail.com | Password1@ | State Education Officer | - ## Sample Data Creation For Projects This step will guide us in implementing a sample project solution following the initial setup of the project service. 1. **Insert Sample Data To Database:** - 1. Download `insert_project_data.bat` Script File: + 1. Download `insert_project_data.bat` Script File: - ``` - curl -L ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_project_data.bat - ``` + ``` + curl -L ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_project_data.bat + ``` 2. Make the setup file executable by running the following command. - ``` - insert_project_data.bat - ``` + ``` + insert_project_data.bat + ``` + 3. Insert Sample Data To Database. - ``` - node insert_sample_solutions.js - ``` + ``` + node insert_sample_solutions.js + ``` @@ -281,11 +282,11 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection -- - Samiksha Service API Collection - +- + Projects Service API Collection +- + Samiksha Service API Collection + --- @@ -296,11 +297,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -311,6 +312,7 @@ For a comprehensive guide on setting up and using the SUP, please refer to: --- + # Open Source Dependencies This project uses several open-source tools and dependencies that supported its development @@ -321,4 +323,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/scp/mac/README.md b/documentation/3.4.0/setup/docker/scp/mac/README.md new file mode 100644 index 00000000..844fa0b7 --- /dev/null +++ b/documentation/3.4.0/setup/docker/scp/mac/README.md @@ -0,0 +1,253 @@ +
+ +# Projects Service + + + + + +![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + + + + +
+The Project building block facilitates the creation and engagement with micro-improvement projects. + +
+
+ +## Supported Operating Systems + +- **Mac (Recommended: Intel and M1 and above)** + +## Dockerized Services & Dependencies + +Expectation: By diligently following the outlined steps, you will successfully establish a fully operational Project application setup, including both the portal and backend services. + +## Prerequisites + +To set up the Project application, ensure you have Docker and Docker Compose installed on your system. For Mac users, detailed installation instructions for both can be found in the documentation here: [How To Install and Use Docker Compose on Mac](https://docs.docker.com/desktop/setup/install/mac-install/). To install and use Nodejs in Mac machine, you can follow instructions here: [How To Install Nodejs in Mac](https://nodejs.org/en/download/package-manager). + +## Installation + +**Create project Directory:** Establish a directory titled **project**. + +Example Command: + +``` +mkdir project && cd project/ +``` + +> Note: All commands are run from the project directory. + +## Operating Systems: Mac + +> **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this + +``` +for port in 3000 3001 3002 6000 5001 4000 9092 5432 7007 2181 2707 3569 6001 27017; do + if lsof -iTCP:"$port" -sTCP:LISTEN -n -P >/dev/null 2>&1 || lsof -iUDP:"$port" -n -P >/dev/null 2>&1; then + echo "Port $port is in use" + else + echo "Port $port is available" + fi +done +``` + +1. **Download and execute main setup script:** Execute the following command in your terminal from the project directory. + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/setup_project.sh && chmod +x setup_project.sh && sudo ./setup_project.sh + ``` + +> Note : The script will download all the essential files and launch the services in Docker. Once all services are successfully up and running, you can proceed to the next steps. + +> **General Instructions :** + +1. All containers which are part of the docker-compose can be gracefully stopped by pressing Ctrl + c in the same terminal where the services are running. + +2. All docker containers can be stopped and removed by using below command. + +``` +sudo ./docker-compose-down.sh +``` + +3. All services and dependencies can be started using below command. + +``` +sudo ./docker-compose-up.sh +``` + +**Keep the current terminal session active, and kindly open a new terminal window within the project directory.** + +**After successfully completing this, please move to the next section: [Enable Citus Extension](#enable-citus-extension-optional)** + +## Enable Citus Extension (Optional) + +User management service comes with this bundle relies on PostgreSQL as its core database system. To boost performance and scalability, users can opt to enable the Citus extension. This transforms PostgreSQL into a distributed database, spreading data across multiple nodes to handle large datasets more efficiently as demand grows. + +For more information, refer **[Citus Data](https://www.citusdata.com/)**. + +To enable the Citus extension for user services, follow these steps. + +1. Create a sub-directory named `user` and download `distributionColumns.sql` into it. (Skip this for linux) + ``` + mkdir user && curl -o ./user/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/distribution-columns/user/distributionColumns.sql + ``` +2. Create a sub-directory named `survey-project-creation` and download `distributionColumns.sql` into it. (Skip this for linux) + ``` + mkdir survey-project-creation && curl -o ./survey-project-creation/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/distribution-columns/survey-project-creation/distributionColumns.sql + ``` +3. Set up the citus_setup file by following the steps given below. + + 1. Enable Citus and set distribution columns for `user` database by running the `citus_setup.sh`with the following arguments. + + ``` + sudo ./citus_setup.sh user postgres://postgres:postgres@citus_master:5432/user + ``` + +4. Set up the citus_setup file by following the steps given below. + + 1. Enable Citus and set distribution columns for `survey-project-creation` database by running the `citus_setup.sh`with the following arguments. + + ``` + sudo ./citus_setup.sh survey-project-creation postgres://postgres:postgres@citus_master:5432/scp + ``` + +## Persistence Of Database Data In Docker Container (Optional) + +To ensure the persistence of database data when running `docker compose down`, it is necessary to modify the `docker-compose-project.yml` file according to the steps given below: + +1. **Modification Of The `docker-compose-project.yml` File:** + + Begin by opening the `docker-compose-project.yml` file. Locate the section pertaining to the Citus and mongo container and proceed to uncomment the volume specification. This action is demonstrated in the snippet provided below: + + ```yaml + mongo: + image: 'mongo:4.4.14' + restart: 'always' + ports: + - '27017:27017' + networks: + - project_net + volumes: + - mongo-data:/data/db + logging: + driver: none + + citus: + image: citusdata/citus:11.2.0 + container_name: 'citus_master' + ports: + - 5432:5432 + volumes: + - citus-data:/var/lib/postgresql/data + ``` + +2. **Uncommenting Volume Names Under The Volumes Section:** + + Next, navigate to the volumes section of the file and proceed to uncomment the volume names as illustrated in the subsequent snippet: + + ```yaml + networks: + elevate_net: + external: false + + volumes: + citus-data: + mongo-data: + ``` + +By implementing these adjustments, the configuration ensures that when the `docker-compose down` command is executed, the database data is securely stored within the specified volumes. Consequently, this data will be retained and remain accessible, even after the containers are terminated and subsequently reinstated using the `docker-compose up` command. + +## Sample User Accounts Generation + +During the initial setup of Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. + +In such cases, you can generate sample user accounts using the steps below. This allows you to explore the Project services and portal immediately after setup. + +> **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. + +``` +sudo ./insert_sample_data.sh user postgres://postgres:postgres@citus_master:5432/user +``` + +After successfully running the script mentioned above, the following user accounts will be created and available for login: + +| Email ID | Password | Role | +| ---------------------- | ---------- | ----------------------- | +| mallanagouda@gmail.com | Password1@ | State Education Officer | +| prajwal@gmail.com | Password1@ | State Education Officer | +| vishnu@gmail.com | Password1@ | State Education Officer | +| priyanka@gmail.com | Password1@ | Program Designer | +| adithya@gmail.com | Password1@ | Content Creator | +| praveen@gmail.com | Password1@ | Reviewer | + +## Sample Data Creation For Projects + +This step will guide us in implementing a sample project solution following the initial setup of the project service. + +1. **Insert Sample Data To Database:** + + ``` + node insert_sample_solutions.js + ``` + +## Default Forms Creation for Portal Configuration + +This step inserts configuration forms into MongoDB, enabling or disabling features and fields on portal pages. + +#### Insert Forms Data into Database + +``` +curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/1.0.0/dockerized/scripts/mac-linux/import_forms_mongo.sh && chmod +x import_forms_mongo.sh && sudo ./import_forms_mongo.sh mongodb://mongo:27017/elevate-project +``` + +## Explore the Consumption Portal + +Once the services are up and the front-end app bundle is built successfully, navigate to **[localhost:7007](http://localhost:7007/)** to access the Project app. + +> **Warning:** In this setup, features such as **Sign-Up, Project Certificate, Project Sharing, and Project PDF Report** will not be available because cloud storage credentials have been masked in the environment files for security reasons. + +## Default Forms Creation for Self Creation Portal Configuration + +This step inserts configuration forms into postgres, enabling or disabling features and fields on portal pages. + +#### Insert Forms Data into Database + +``` +curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/dockerized/scripts/scp/ubuntu/import_forms_postgres.sh && chmod +x import_forms_postgres.sh && sudo ./import_forms_postgres.sh postgres://postgres:postgres@citus_master:5432/scp +``` + +## Explore the Self Creation Portal + +Once the services are up and the front-end app bundle is built successfully, navigate to **[localhost:1819](http://localhost:1819/)** to access the Creation app. + +> **Warning:** In this setup, features such as **Sign-Up, Resource Creation** will not be available because cloud storage credentials have been masked in the environment files for security reasons. Before runs the docker compose file please update this with actual cloud credentials + +## Postman Collections + +- [Projects Service](https://github.com/ELEVATE-Project/project-service/tree/main/api-doc) + +- [Survey Project Creation Service](https://github.com/ELEVATE-Project/survey-project-creation-service/tree/release-1.0.0/src/api-doc) + +# Team + + + + + +# Open Source Dependencies + +Several open source dependencies that have aided Projects's development: + +![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) +![Apache Kafka](https://img.shields.io/badge/Apache%20Kafka-000?style=for-the-badge&logo=apachekafka) +![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge&logo=redis&logoColor=white) +![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white) +![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/scp/ubuntu/README.md b/documentation/3.4.0/setup/docker/scp/ubuntu/README.md new file mode 100644 index 00000000..195c5250 --- /dev/null +++ b/documentation/3.4.0/setup/docker/scp/ubuntu/README.md @@ -0,0 +1,250 @@ +
+ +# Projects Service + + + + + +![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + + + + +
+The Project building block facilitates the creation and engagement with micro-improvement projects. + +
+
+ +## Supported Operating Systems + +- **Ubuntu (Recommended: Version 20 and above)** + +## Dockerized Services & Dependencies + +Expectation: By diligently following the outlined steps, you will successfully establish a fully operational Project application setup, including both the portal and backend services. + +## Prerequisites + +To set up the Project application, ensure you have Docker and Docker Compose installed on your system. For Ubuntu users, detailed installation instructions for both can be found in the documentation here: [How To Install and Use Docker Compose on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04). To install and use Nodejs in Ubuntu machine, you can follow instructions here: [How To Install Nodejs in Ubuntu](https://nodejs.org/en/download/package-manager). + +## Installation + +**Create project Directory:** Establish a directory titled **project**. + +Example Command: +``` +mkdir project && cd project/ +``` + +> Note: All commands are run from the project directory. + +## Operating Systems: Linux + +> **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this + +``` +for port in 3000 3001 3002 6000 5001 4000 9092 5432 7007 2181 2707 3569 6001 27017; do + if ss -tuln | grep ":$port " > /dev/null; then + echo "Port $port is in use" + else + echo "Port $port is available" + fi +done +``` + +1. **Download and execute main setup script:** Execute the following command in your terminal from the project directory. + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/dockerized/scripts/scp/ubuntu/setup_project.sh && chmod +x setup_project.sh && sudo ./setup_project.sh + ``` + +> Note : The script will download all the essential files and launch the services in Docker. Once all services are successfully up and running, you can proceed to the next steps. + +> **General Instructions :** + +1. All containers which are part of the docker-compose can be gracefully stopped by pressing Ctrl + c in the same terminal where the services are running. + +2. All docker containers can be stopped and removed by using below command. + +``` +sudo ./docker-compose-down.sh +``` + +3. All services and dependencies can be started using below command. + +``` +sudo ./docker-compose-up.sh +``` + +**Keep the current terminal session active, and kindly open a new terminal window within the project directory.** + +**After successfully completing this, please move to the next section: [Enable Citus Extension](#enable-citus-extension-optional)** + +## Enable Citus Extension (Optional) + +User management service comes with this bundle relies on PostgreSQL as its core database system. To boost performance and scalability, users can opt to enable the Citus extension. This transforms PostgreSQL into a distributed database, spreading data across multiple nodes to handle large datasets more efficiently as demand grows. + +For more information, refer **[Citus Data](https://www.citusdata.com/)**. + +To enable the Citus extension for user services, follow these steps. + +1. Create a sub-directory named `user` and download `distributionColumns.sql` into it. (Skip this for linux) + ``` + mkdir user && curl -o ./user/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/distribution-columns/user/distributionColumns.sql + ``` +2. Create a sub-directory named `survey-project-creation` and download `distributionColumns.sql` into it. (Skip this for linux) + ``` + mkdir survey-project-creation && curl -o ./survey-project-creation/distributionColumns.sql -JL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/distribution-columns/survey-project-creation/distributionColumns.sql +3. Set up the citus_setup file by following the steps given below. + + 1. Enable Citus and set distribution columns for `user` database by running the `citus_setup.sh`with the following arguments. + + ``` + sudo ./citus_setup.sh user postgres://postgres:postgres@citus_master:5432/user + ``` +4. Set up the citus_setup file by following the steps given below. + + 1. Enable Citus and set distribution columns for `survey-project-creation` database by running the `citus_setup.sh`with the following arguments. + + ``` + sudo ./citus_setup.sh survey-project-creation postgres://postgres:postgres@citus_master:5432/scp + ``` +## Persistence Of Database Data In Docker Container (Optional) + +To ensure the persistence of database data when running `docker compose down`, it is necessary to modify the `docker-compose-project.yml` file according to the steps given below: + +1. **Modification Of The `docker-compose-project.yml` File:** + + Begin by opening the `docker-compose-project.yml` file. Locate the section pertaining to the Citus and mongo container and proceed to uncomment the volume specification. This action is demonstrated in the snippet provided below: + + ```yaml + mongo: + image: 'mongo:4.4.14' + restart: 'always' + ports: + - '27017:27017' + networks: + - project_net + volumes: + - mongo-data:/data/db + logging: + driver: none + + citus: + image: citusdata/citus:11.2.0 + container_name: 'citus_master' + ports: + - 5432:5432 + volumes: + - citus-data:/var/lib/postgresql/data + ``` + +2. **Uncommenting Volume Names Under The Volumes Section:** + + Next, navigate to the volumes section of the file and proceed to uncomment the volume names as illustrated in the subsequent snippet: + + ```yaml + networks: + elevate_net: + external: false + + volumes: + citus-data: + mongo-data: + ``` + +By implementing these adjustments, the configuration ensures that when the `docker-compose down` command is executed, the database data is securely stored within the specified volumes. Consequently, this data will be retained and remain accessible, even after the containers are terminated and subsequently reinstated using the `docker-compose up` command. + +## Sample User Accounts Generation + +During the initial setup of Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. + +In such cases, you can generate sample user accounts using the steps below. This allows you to explore the Project services and portal immediately after setup. + +> **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. + +``` +sudo ./insert_sample_data.sh user postgres://postgres:postgres@citus_master:5432/user +``` + +After successfully running the script mentioned above, the following user accounts will be created and available for login: + +| Email ID | Password | Role | +| ---------------------- | ---------- | ----------------------- | +| mallanagouda@gmail.com | Password1@ | State Education Officer | +| prajwal@gmail.com | Password1@ | State Education Officer | +| vishnu@gmail.com | Password1@ | State Education Officer | +| priyanka@gmail.com | Password1@ | Program Designer | +| adithya@gmail.com | Password1@ | Content Creator | +| praveen@gmail.com | Password1@ | Reviewer | + +## Sample Data Creation For Projects + +This step will guide us in implementing a sample project solution following the initial setup of the project service. + +1. **Insert Sample Data To Database:** + + ``` + node insert_sample_solutions.js + ``` + + +## Default Forms Creation for Portal Configuration + +This step inserts configuration forms into MongoDB, enabling or disabling features and fields on portal pages. + +#### Insert Forms Data into Database + +``` +curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/1.0.0/dockerized/scripts/mac-linux/import_forms_mongo.sh && chmod +x import_forms_mongo.sh && sudo ./import_forms_mongo.sh mongodb://mongo:27017/elevate-project +``` + +## Explore the Consumption Portal + +Once the services are up and the front-end app bundle is built successfully, navigate to **[localhost:7007](http://localhost:7007/)** to access the Project app. + +> **Warning:** In this setup, features such as **Sign-Up, Project Certificate, Project Sharing, and Project PDF Report** will not be available because cloud storage credentials have been masked in the environment files for security reasons. + +## Default Forms Creation for Self Creation Portal Configuration + +This step inserts configuration forms into postgres, enabling or disabling features and fields on portal pages. + +#### Insert Forms Data into Database + +``` +curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/3.4.0/dockerized/scripts/scp/ubuntu/import_forms_postgres.sh && chmod +x import_forms_postgres.sh && sudo ./import_forms_postgres.sh postgres://postgres:postgres@citus_master:5432/scp +``` + +## Explore the Self Creation Portal + +Once the services are up and the front-end app bundle is built successfully, navigate to **[localhost:1819](http://localhost:1819/)** to access the Creation app. + +> **Warning:** In this setup, features such as **Sign-Up, Resource Creation** will not be available because cloud storage credentials have been masked in the environment files for security reasons. Before runs the docker compose file please update this with actual cloud credentials + +## Postman Collections + +- [Projects Service](https://github.com/ELEVATE-Project/project-service/tree/main/api-doc) + +- [Surevy Project Creation Service](https://github.com/ELEVATE-Project/survey-project-creation-service/tree/release-1.0.0/src/api-doc) + +# Team + + + + + +# Open Source Dependencies + +Several open source dependencies that have aided Projects's development: + +![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) +![Apache Kafka](https://img.shields.io/badge/Apache%20Kafka-000?style=for-the-badge&logo=apachekafka) +![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge&logo=redis&logoColor=white) +![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white) +![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md b/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md index 3dd852fd..3474c414 100644 --- a/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md +++ b/documentation/3.4.0/setup/docker/stand-alone/mac-os/README.md @@ -38,7 +38,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -212,9 +212,9 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection - +- + Projects Service API Collection + --- @@ -225,13 +225,14 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- + # Team @@ -239,6 +240,7 @@ For a comprehensive guide on setting up and using the SUP, please refer to: --- + # Open Source Dependencies This project uses several open-source tools and dependencies that supported its development @@ -249,4 +251,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md b/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md index 52dfca8a..7e98e06c 100644 --- a/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md +++ b/documentation/3.4.0/setup/docker/stand-alone/ubuntu/README.md @@ -38,7 +38,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -210,9 +210,9 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection - +- + Projects Service API Collection + --- @@ -223,11 +223,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -249,4 +249,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/docker/stand-alone/windows/README.md b/documentation/3.4.0/setup/docker/stand-alone/windows/README.md index 4e3d7b3c..d914ab23 100644 --- a/documentation/3.4.0/setup/docker/stand-alone/windows/README.md +++ b/documentation/3.4.0/setup/docker/stand-alone/windows/README.md @@ -13,7 +13,6 @@ ![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) -
The Project building block facilitates the creation and engagement with micro-improvement projects. @@ -28,7 +27,6 @@ Expectation: By diligently following the outlined steps, you will successfully e To set up the Project application, ensure you have Docker and Docker Compose installed on your system. For Windows users, detailed installation instructions for both can be found in the documentation here: [How To Install and Use Docker Compose on Linux](https://docs.docker.com/desktop/setup/install/windows-install/). To install and use Nodejs in Window machine, you can follow instructions here: [How To Install Nodejs in Linux](https://nodejs.org/en/download/package-manager). - ## Installation **Create project Directory:** Establish a directory titled **project**. @@ -37,7 +35,7 @@ To set up the Project application, ensure you have Docker and Docker Compose ins > Note: All commands are run from the project directory. -## Checking Port Availability +## Checking Port Availability > **Caution:** Before proceeding, please ensure that the ports given here are available and open. It is essential to verify their availability prior to moving forward. You can run below command in your terminal to check this @@ -62,15 +60,15 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569) do @( 2. **Download Environment Files**: Using the OS specific commands given below, download environment files for all the services. - ``` - curl -L ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/interface_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/entity_management_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/project_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/notification_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/scheduler_env ^ - -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/user_env - ``` +``` +curl -L ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/interface_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/entity_management_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/project_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/notification_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/scheduler_env ^ + -O https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/envs/user_env +``` > **Note:** Modify the environment files as necessary for your deployment using any text editor, ensuring that the values are appropriate for your environment. The default values provided in the current files are functional and serve as a good starting point. Refer to the sample env files provided at the [Project](https://github.com/ELEVATE-Project/project-service/blob/main/.env.sample), [User](https://github.com/ELEVATE-Project/user/blob/master/src/.env.sample), [Notification](https://github.com/ELEVATE-Project/notification/blob/master/src/.env.sample), [Scheduler](https://github.com/ELEVATE-Project/scheduler/blob/master/src/.env.sample), [Interface](https://github.com/ELEVATE-Project/interface-service/blob/main/src/.env.sample) and [Entity-management](https://github.com/ELEVATE-Project/entity-management/blob/main/src/.env.sample) repositories for reference. @@ -78,25 +76,25 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569) do @( 3. **Download `docker-compose-up` & `docker-compose-down` Script Files** - ``` - curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/docker-compose-up.bat - ``` - ``` - curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/docker-compose-down.bat - ``` +``` +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/docker-compose-up.bat +``` -4. **Download `Config` File** +``` +curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/dockerized/scripts/stand-alone/windows/docker-compose-down.bat +``` - ``` - curl -L https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/common-files/generics/configFile.json -o config.json - ``` +4. **Download `Config` File** +``` +curl -L https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/common-files/generics/configFile.json -o config.json +``` 5. **Run All Services & Dependencies**:All services and dependencies can be started using the `docker-compose-up` script file. - ``` - docker-compose-up.bat - ``` +``` +docker-compose-up.bat +``` > Double-click the file or run the above command from the terminal. @@ -104,10 +102,10 @@ for %p in (3001 3002 6000 5001 4000 9092 5432 7007 2181 27017 3569) do @( 6. **Remove All Service & Dependency Containers**: All docker containers can be stopped and removed by using the `docker-compose-down` file. - - ``` - docker-compose-down.bat - ``` + +``` +docker-compose-down.bat +``` > **Caution**: As per the default configuration in the `docker-compose-project.yml` file, using the `down` command will lead to data loss since the database container does not persist data. To persist data across `down` commands and subsequent container removals, refer to the "Persistence of Database Data in Docker Containers" section of this documentation. @@ -125,16 +123,15 @@ To enable the Citus extension for user services, follow these steps. ``` 2. Set up the citus_setup file by following the steps given below. - 1. Download the `citus_setup.bat` file. - ``` - curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/1.0.0/dockerized/scripts/windows/citus_setup.bat - ``` - 2. Enable Citus and set distribution columns for `user` database by running the `citus_setup.bat`with the following arguments. - ``` - citus_setup.bat user postgres://postgres:postgres@citus_master:5432/user - ``` - > **Note:** Since the `citus_setup.bat` file requires arguments, it must be run from a terminal. - + 1. Download the `citus_setup.bat` file. + ``` + curl -OJL https://github.com/ELEVATE-Project/project-service/raw/main/documentation/1.0.0/dockerized/scripts/windows/citus_setup.bat + ``` + 2. Enable Citus and set distribution columns for `user` database by running the `citus_setup.bat`with the following arguments. + ``` + citus_setup.bat user postgres://postgres:postgres@citus_master:5432/user + ``` + > **Note:** Since the `citus_setup.bat` file requires arguments, it must be run from a terminal. ## Update Cloud Credentials for Project Service @@ -208,24 +205,25 @@ During the initial setup of Project services with the default configuration, you In such cases, you can generate sample user accounts using the steps below. This allows you to explore the Project services and portal immediately after setup. > **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. - 1. **Download The `sampleData.sql` Files:** - ``` - mkdir sample-data\user 2>nul & ^ - curl -L "https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/sampleData.sql" -o sample-data\user\sampleData.sql - ``` +1. **Download The `sampleData.sql` Files:** + + ``` + mkdir sample-data\user 2>nul & ^ + curl -L "https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/sampleData.sql" -o sample-data\user\sampleData.sql + ``` 2. **Download The `insert_sample_data` Script File:** - ``` - curl -L -o insert_sample_data.bat https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_sample_data.bat - ``` + ``` + curl -L -o insert_sample_data.bat https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_sample_data.bat + ``` 3. **Run The `insert_sample_data` Script File:** - ``` - insert_sample_data.bat user postgres://postgres:postgres@citus_master:5432/user - ``` + ``` + insert_sample_data.bat user postgres://postgres:postgres@citus_master:5432/user + ``` After successfully running the script mentioned above, the following user accounts will be created and available for login: @@ -235,30 +233,30 @@ In such cases, you can generate sample user accounts using the steps below. This | prajwal@gmail.com | Password1@ | State Education Officer | | vishnu@gmail.com | Password1@ | State Education Officer | - ## Sample Data Creation For Projects This step will guide us in implementing a sample project solution following the initial setup of the project service. 1. **Insert Sample Data To Database:** - 1. Download `insert_project_data.bat` Script File: + 1. Download `insert_project_data.bat` Script File: - ``` - curl -L ^ - -O https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_project_data.bat - ``` + ``` + curl -L ^ + -O https://raw.githubusercontent.com/MallanagoudaBiradar/project-service/refs/heads/windowsStandAlone/documentation/3.4.0/dockerized/scripts/stand-alone/windows/insert_project_data.bat + ``` 2. Make the setup file executable by running the following command. - ``` - insert_project_data.bat - ``` + ``` + insert_project_data.bat + ``` + 3. Insert Sample Data To Database. - ``` - node insert_sample_solutions.js - ``` + ``` + node insert_sample_solutions.js + ``` @@ -277,9 +275,9 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection - +- + Projects Service API Collection + --- @@ -290,11 +288,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -305,6 +303,7 @@ For a comprehensive guide on setting up and using the SUP, please refer to: --- + # Open Source Dependencies This project uses several open-source tools and dependencies that supported its development @@ -315,4 +314,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md b/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md index b288d635..5691c6a4 100644 --- a/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md +++ b/documentation/3.4.0/setup/native/project-with-survey/ubuntu/README.md @@ -13,7 +13,6 @@ ![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) -
The Project building block facilitates the creation and engagement with micro-improvement projects. @@ -192,16 +191,14 @@ curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/ To enable full functionality—including certificate generation, attachment uploads, and report storage—you must configure cloud credentials in the environment files for both services. A. Project Service Configuration Path: - ```./ELEVATE-Project/project-service/.env - ``` + `./ELEVATE-Project/project-service/.env + ` B. Samiksha (Survey & Observation) Service Configuration Path: - ```./ELEVATE-Project/samiksha-service/.env - ``` - + `./ELEVATE-Project/samiksha-service/.env + ` - - Add or update the following variables in the .env file, substituting the example values with your actual cloud credentials: + Add or update the following variables in the .env file, substituting the example values with your actual cloud credentials: CLOUD_STORAGE_PROVIDER=gcloud CLOUD_STORAGE_ACCOUNTNAME=your_account_name @@ -214,7 +211,7 @@ curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/ For detailed configuration options, supported cloud providers, and integration guidelines, please refer to the official documentation available in this [ReadMe](https://www.npmjs.com/package/client-cloud-services?activeTab=readme) -11. **Insert Initial Data** +10. **Insert Initial Data** 1. Download `entity-project-sample-data.sh` Script File: @@ -224,7 +221,7 @@ curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/ ./project_entity_sample_data.sh ``` -12. **Start The Services** +11. **Start The Services** Following the steps given below, 2 instances of each ELEVATE-Project backend service will be deployed and be managed by PM2 process manager. @@ -237,7 +234,6 @@ curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/ (cd scheduler/src && pm2 start app.js --name scheduler && cd -) ``` - ## Sample User Accounts Generation During the initial setup of ELEVATE-Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the ELEVATE-Project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. @@ -262,7 +258,6 @@ After successfully running the script mentioned above, the following user accoun --- - ## 🌐 Micro-Frontend (FE) Setup The ELEVATE application uses a micro-frontend architecture. After setting up the backend services, you must configure and run the frontend repositories to access the application via the portal. @@ -277,11 +272,11 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection -- - Samiksha Service API Collection - +- + Projects Service API Collection +- + Samiksha Service API Collection + --- @@ -292,11 +287,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -318,4 +313,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) diff --git a/documentation/3.4.0/setup/native/scp/mac/README.md b/documentation/3.4.0/setup/native/scp/mac/README.md new file mode 100644 index 00000000..12202b50 --- /dev/null +++ b/documentation/3.4.0/setup/native/scp/mac/README.md @@ -0,0 +1,374 @@ +
+ +# Projects Service + + + + + +![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + + + + +
+The Project building block facilitates the creation and engagement with micro-improvement projects. + +
+
+ +# Native Setup - With Self Creation Portal + +## PM2 Managed Services & Natively Installed Dependencies + +### System Requirements + +- **Node.js®:** v20 +- **PostgreSQL:** 16 +- **Apache Kafka®:** 3.5.0 +- **MongoDB:** 4.4.14 +- **Gotenberg:** 8.5.0 +- **Redis:** 7.0.15 + +Expectation: Upon following the prescribed steps, you will achieve a fully operational ELEVATE-Project application setup. Both the portal and backend services are managed using PM2, with all dependencies installed natively on the host system. + +## Prerequisites + +Before setting up the following ELEVATE-Project application, dependencies given below should be installed and verified to be running. Refer to the steps given below to install them and verify. + +1. Download dependency management scripts: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/check-dependencies.sh && \ + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/install-dependencies.sh && \ + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/uninstall-dependencies.sh && \ + chmod +x check-dependencies.sh && \ + chmod +x install-dependencies.sh && \ + chmod +x uninstall-dependencies.sh + ``` + +2. Verify installed dependencies by running `check-dependencies.sh`: + + ``` + ./check-dependencies.sh + ``` + + > Note: Keep note of any missing dependencies. + +3. Install dependencies by running `install-dependencies.sh`: + ``` + ./install-dependencies.sh + ``` + > Note: Install all missing dependencies and use check-dependencies script to ensure everything is installed and running. +4. Uninstall dependencies by running `uninstall-dependencies.sh`: + + ``` + ./uninstall-dependencies.sh + ``` + + > Warning: Due to the destructive nature of the script (without further warnings), it should only be used during the initial setup of the dependencies. For example, Uninstalling PostgreSQL/Citus using script will lead to data loss. USE EXTREME CAUTION. + + > Warning: This script should only be used to uninstall dependencies that were installed via installation script in step 3. If same dependencies were installed using other methods, refrain from using this script. This script is provided in-order to reverse installation in-case issues arise from a bad install. + +## Installation + +1. **Create ELEVATE-Project Directory:** Create a directory named **ELEVATE-Project**. + + Example Command: + + ``` + mkdir ELEVATE-Project && cd ELEVATE-Project/ + ``` + +2. **Git Clone Services And Portal Repositories** + +``` +git clone -b release-1.0.0 https://github.com/ELEVATE-Project/survey-project-creation-service.git && \ +git clone -b develop https://github.com/ELEVATE-Project/project-service.git && \ +git clone -b develop https://github.com/ELEVATE-Project/entity-management.git && \ +git clone -b develop https://github.com/ELEVATE-Project/user.git && \ +git clone -b master https://github.com/ELEVATE-Project/notification.git && \ +git clone -b main https://github.com/ELEVATE-Project/interface-service.git && \ +git clone -b master https://github.com/ELEVATE-Project/scheduler.git && \ +git clone -b release-3.4.0 https://github.com/ELEVATE-Project/observation-survey-projects-pwa && \ +git clone -b releaase-1.1.0 https://github.com/ELEVATE-Project/elevate-portal && \ +git clone -b release-3.4.0 https://github.com/ELEVATE-Project/observation-portal +``` + +3. **Install NPM Packages** + +``` +cd survey-project-creation-service/src && npm install && cd ../.. && \ +cd project-service && npm install && cd ../ && \ +cd entity-management/src && npm install && cd ../.. && \ +cd user/src && npm install && cd ../.. && \ +cd notification/src && npm install && cd ../.. && \ +cd interface-service/src && npm install && cd ../.. && \ +cd scheduler/src && npm install && cd ../.. && \ +cd observation-survey-projects-pwa && npm install --force && cd .. && \ +cd observation-portal && npm install --force && cd .. && \ +cd elevate-portal && npm install --force && cd .. +``` + +4. **Download Environment Files** + +``` +curl -L -o survey-project-creation-service/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/survey_project_creation_env && \ +curl -L -o project-service/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/project_env && \ +curl -L -o entity-management/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/entity_management_env && \ +curl -L -o user/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/user_env && \ +curl -L -o notification/src/.env https://github.com/ELEVATE-Project/project-service/raw/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/notification_env && \ +curl -L -o interface-service/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/interface_env && \ +curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/scheduler_env && \ +curl -L -o observation-survey-projects-pwa/src/assets/env/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/observation_survey_projects_pwa_env && \ +curl -L -o elevate-portal/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/elevate_portal_env && \ +curl -L -o observation-portal/src/assets/env/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/native/envs/scp/observation_portal_env +``` + +> **Note:** Modify the environment files as necessary for your deployment using any text editor, ensuring that the values are appropriate for your environment. The default values provided in the current files are functional and serve as a good starting point. Refer to the sample env files provided at the +> [Survey Project Creation](https://github.com/ELEVATE-Project/survey-project-creation-service/blob/release-1.0.0/src/.env.sample), +> [Project](https://github.com/ELEVATE-Project/project-service/blob/main/.env.sample), [User](https://github.com/ELEVATE-Project/user/blob/master/src/.env.sample), [Notification](https://github.com/ELEVATE-Project/notification/blob/master/src/.env.sample), [Scheduler](https://github.com/ELEVATE-Project/scheduler/blob/master/src/.env.sample), [Interface](https://github.com/ELEVATE-Project/interface-service/blob/main/src/.env.sample) and [Entity-Management](https://github.com/ELEVATE-Project/entity-management/blob/main/src/.env.sample) repositories for reference. + +> **Caution:** While the default values in the downloaded environment files enable the ELEVATE-Project Application to operate, certain features may not function correctly or could be impaired unless the adopter-specific environment variables are properly configured. + +> **Important:** +> +> - The Self Creation Portal heavily depends on the cloud, and most of the data is stored there. So please update the cloud-related environment keys with the actual values before proceeding further. + +- As mentioned in the above linked document, the **User SignUp** functionality may be compromised if key environment variables are not set correctly during deployment. If you opt to skip this setup, consider using the sample user account generator detailed in the `Sample User Accounts Generation` section of this document. + +5. **Attaching Config File** + + ``` + curl -L -o survey-project-creation-service/src/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configSCP.json && \ + curl -L -o project-service/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json && \ + curl -L -o entity-management/src/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json + ``` + +6. **Create Databases** + + 1. Download `create-databases.sh` Script File: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/create-databases.sh + ``` + + 2. Make the executable by running the following command: + + ``` + chmod +x create-databases.sh + ``` + + 3. Run the script file: + + ``` + ./create-databases.sh + ``` + +7. **Run Migrations to Create Tables and Seed Default Values** + + ``` + cd user/src && npx sequelize-cli db:migrate && cd ../.. && \ + cd survey-project-creation-service/src && npx sequelize-cli db:migrate && cd ../.. && \ + cd notification/src && npx sequelize-cli db:migrate && cd ../.. + ``` + + To seed the default values, run the following command: + + ``` + cd user/src && npx sequelize-cli db:seed:all && cd ../../ + ``` + +8. **Enabling Citus And Setting Distribution Columns (Optional)** + + To boost performance and scalability, users can opt to enable the Citus extension. This transforms PostgreSQL into a distributed database, spreading data across multiple nodes to handle large datasets more efficiently as demand grows. + + > NOTE: Currently only available for Linux based operation systems. + + 1. Download user `distributionColumns.sql` file. + + ``` + curl -o ./user/distributionColumns.sql -JL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/user/distributionColumns.sql + + ``` + + 2. Set up the `citus_setup` file by following the steps given below. + + 1. Download the `citus_setup.sh` file: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/1.0.0/native/scripts/linux/citus_setup.sh + ``` + + 2. Make the setup file executable by running the following command: + + ``` + chmod +x citus_setup.sh + ``` + + 3. Enable Citus and set distribution columns for `user` database by running the `citus_setup.sh`with the following arguments. + ``` + ./citus_setup.sh user postgres://postgres:postgres@localhost:9700/users + ``` + + 3. Download survey-project-creation-service `distributionColumns.sql` file. + + ``` + curl -o ./survey-project-creation-service/distributionColumns.sql -JL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/survey-project-creation/distributionColumns.sql + + ``` + + 4. Set up the `citus_setup` file by following the steps given below. + + 1. Download the `citus_setup.sh` file: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/1.0.0/native/scripts/linux/citus_setup.sh + ``` + + 2. Make the setup file executable by running the following command: + + ``` + chmod +x citus_setup.sh + ``` + + 3. Enable Citus and set distribution columns for `scp` database by running the `citus_setup.sh`with the following arguments. + ``` + ./citus_setup.sh survey-project-creation-service postgres://postgres:postgres@localhost:9700/scp + ``` + +9. **Insert Initial Data** + + 1. Once you update the cloud credentials in the survey-project-creation-service environment, please run the script below to upload the certificate base templates to the cloud. + + ``` + cd survey-project-creation-service/src/scripts && node uploadCertificateBaseTemplate.js && cd ../../../ + ``` + + 2. If you are using the Self Creation Portal for the education sector, please run the script below to insert the relevant entities into the survey-project-creation-service database. + + ``` + cd survey-project-creation-service/src/scripts && node addDefaultEntitiesForEducationSector.js && cd ../../../ + ``` + + 3. Download `entity-project-sample-data.sh` Script File: + + ``` + curl -o project_entity_sample_data.sh https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/project_entity_sample_data.sh && \ + chmod +x project_entity_sample_data.sh && \ + ./project_entity_sample_data.sh + ``` + +10. **Insert Forms Data into Database** + + If the `axios` package is not available in the current project directory, install it before running the import script: + + ```bash + npm install axios + ``` + + Then run the import script: + + ```bash + curl -s https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/linux/import_forms.js | node + ``` + +11. **Start The Services** + + Following the steps given below, 2 instances of each ELEVATE-Project backend service will be deployed and be managed by PM2 process manager. + + ``` + (cd survey-project-creation-service/src && pm2 start app.js --name survey-project-creation-service && cd -) && \ + (cd project-service && pm2 start app.js --name project-service && cd -) && \ + (cd entity-management/src && pm2 start app.js --name entity-management && cd -) && \ + (cd user/src && pm2 start app.js --name user && cd -) && \ + (cd notification/src && pm2 start app.js --name notification && cd -) && \ + (cd interface-service/src && pm2 start app.js --name interface && cd -) && \ + (cd scheduler/src && pm2 start app.js --name scheduler && cd -) + ``` + +12. **Start The Portal** + + ELEVATE-Project portal utilizes Ionic for building the browser bundle, follow the steps given below to install them and start the portal. + + 1. Install the Ionic framework: + + ``` + npm install -g ionic + ``` + + 2. Install the Ionic client: + + ``` + npm install -g @ionic/cli + ``` + + 3. Navigate to `observation-survey-projects-pwa` directory: + + ``` + cd observation-survey-projects-pwa + ``` + + 4. Run the project on your local system using the following command: + + ``` + ionic serve + ``` + + Navigate to http://localhost:8100 to access the ELEVATE-Project Portal. + +## Sample User Accounts Generation + +During the initial setup of ELEVATE-Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the ELEVATE-Project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. + +In such cases, you can generate sample user accounts using the steps below. This allows you to explore the ELEVATE-Project services and portal immediately after setup. + +> **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. + +``` +curl -o insert_sample_data.sh https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/insert_sample_data.sh && \ +chmod +x insert_sample_data.sh && \ +./insert_sample_data.sh +``` + +After successfully running the script mentioned above, the following user accounts will be created and available for login: + +| Email ID | Password | Role | +| ---------------------- | ---------- | ----------------------- | +| mallanagouda@gmail.com | Password1@ | State Education Officer | +| prajwal@gmail.com | Password1@ | State Education Officer | +| vishnu@gmail.com | Password1@ | State Education Officer | +| priyanka@gmail.com | Password1@ | Program Designer | +| adithya@gmail.com | Password1@ | Content Creator | +| praveen@gmail.com | Password1@ | Reviewer | + +## Postman Collections + +- [Projects Service](https://github.com/ELEVATE-Project/project-service/tree/main/api-doc) + +- [Surevy Project Creation Service](https://github.com/ELEVATE-Project/survey-project-creation-service/tree/release-1.0.0/src/api-doc) + +## Adding New Projects to the System + +With implementation scripts, you can seamlessly add new projects to the system. Once a project is successfully added, it becomes visible on the portal, ready for use and interaction. For a comprehensive guide on setting up and using the implementation script, please refer to the [documentation here](https://github.com/ELEVATE-Project/project-service/tree/main/Project-Service-implementation-Script). + +# Team + + + + + +# Open Source Dependencies + +Several open source dependencies that have aided Projects's development: + +![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) +![Apache Kafka](https://img.shields.io/badge/Apache%20Kafka-000?style=for-the-badge&logo=apachekafka) +![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge&logo=redis&logoColor=white) +![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white) +![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) diff --git a/documentation/3.4.0/setup/native/scp/ubuntu/README.md b/documentation/3.4.0/setup/native/scp/ubuntu/README.md new file mode 100644 index 00000000..2f6bfc83 --- /dev/null +++ b/documentation/3.4.0/setup/native/scp/ubuntu/README.md @@ -0,0 +1,362 @@ +
+ +# Projects Service + + + + + +![GitHub package.json version (subfolder of monorepo)](https://img.shields.io/github/package-json/v/ELEVATE-Project/mentoring?filename=src%2Fpackage.json) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + + + + +
+The Project building block facilitates the creation and engagement with micro-improvement projects. + +
+
+ +# Native Setup - With Self Creation Portal + +## PM2 Managed Services & Natively Installed Dependencies + +### System Requirements + +- **Node.js®:** v20 +- **PostgreSQL:** 16 +- **Apache Kafka®:** 3.5.0 +- **MongoDB:** 4.4.14 +- **Gotenberg:** 8.5.0 +- **Redis:** 7.0.15 + +Expectation: Upon following the prescribed steps, you will achieve a fully operational ELEVATE-Project application setup. Both the portal and backend services are managed using PM2, with all dependencies installed natively on the host system. + +## Prerequisites + +Before setting up the following ELEVATE-Project application, dependencies given below should be installed and verified to be running. Refer to the steps given below to install them and verify. + +1. Download dependency management scripts: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/check-dependencies.sh && \ + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/install-dependencies.sh && \ + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/uninstall-dependencies.sh && \ + chmod +x check-dependencies.sh && \ + chmod +x install-dependencies.sh && \ + chmod +x uninstall-dependencies.sh + ``` + +2. Verify installed dependencies by running `check-dependencies.sh`: + + ``` + ./check-dependencies.sh + ``` + + > Note: Keep note of any missing dependencies. + +3. Install dependencies by running `install-dependencies.sh`: + ``` + ./install-dependencies.sh + ``` + > Note: Install all missing dependencies and use check-dependencies script to ensure everything is installed and running. +4. Uninstall dependencies by running `uninstall-dependencies.sh`: + + ``` + ./uninstall-dependencies.sh + ``` + + > Warning: Due to the destructive nature of the script (without further warnings), it should only be used during the initial setup of the dependencies. For example, Uninstalling PostgreSQL/Citus using script will lead to data loss. USE EXTREME CAUTION. + + > Warning: This script should only be used to uninstall dependencies that were installed via installation script in step 3. If same dependencies were installed using other methods, refrain from using this script. This script is provided in-order to reverse installation in-case issues arise from a bad install. + +## Installation + +1. **Create ELEVATE-Project Directory:** Create a directory named **ELEVATE-Project**. + + Example Command: + ``` + mkdir ELEVATE-Project && cd ELEVATE-Project/ + ``` + +2. **Git Clone Services And Portal Repositories** + +``` +git clone -b release-1.0.0 https://github.com/ELEVATE-Project/survey-project-creation-service.git && \ +git clone -b develop https://github.com/ELEVATE-Project/project-service.git && \ +git clone -b develop https://github.com/ELEVATE-Project/entity-management.git && \ +git clone -b develop https://github.com/ELEVATE-Project/user.git && \ +git clone -b master https://github.com/ELEVATE-Project/notification.git && \ +git clone -b main https://github.com/ELEVATE-Project/interface-service.git && \ +git clone -b master https://github.com/ELEVATE-Project/scheduler.git && \ +git clone -b release-3.4.0 https://github.com/ELEVATE-Project/observation-survey-projects-pwa && \ +git clone -b releaase-1.1.0 https://github.com/ELEVATE-Project/elevate-portal && \ +git clone -b release-3.4.0 https://github.com/ELEVATE-Project/observation-portal +``` + +3. **Install NPM Packages** + +``` +cd survey-project-creation-service/src && npm install && cd ../.. && \ +cd project-service && npm install && cd ../ && \ +cd entity-management/src && npm install && cd ../.. && \ +cd user/src && npm install && cd ../.. && \ +cd notification/src && npm install && cd ../.. && \ +cd interface-service/src && npm install && cd ../.. && \ +cd scheduler/src && npm install && cd ../.. && \ +cd observation-survey-projects-pwa && npm install --force && cd .. && \ +cd observation-portal && npm install --force && cd .. && \ +cd elevate-portal && npm install --force && cd .. +``` + +4. **Download Environment Files** + +``` +curl -L -o survey-project-creation-service/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/survey_project_creation_env && \ +curl -L -o project-service/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/project_env && \ +curl -L -o entity-management/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/entity_management_env && \ +curl -L -o user/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/user_env && \ +curl -L -o notification/src/.env https://github.com/ELEVATE-Project/project-service/raw/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/notification_env && \ +curl -L -o interface-service/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/interface_env && \ +curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/scheduler_env && \ +curl -L -o observation-survey-projects-pwa/src/assets/env/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/observation_survey_projects_pwa_env && \ +curl -L -o elevate-portal/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/envs/scp/elevate_portal_env && \ +curl -L -o observation-portal/src/assets/env/env.js https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/3.4.0/native/envs/scp/observation_portal_env +``` + +> **Note:** Modify the environment files as necessary for your deployment using any text editor, ensuring that the values are appropriate for your environment. The default values provided in the current files are functional and serve as a good starting point. Refer to the sample env files provided at the +[Survey Project Creation](https://github.com/ELEVATE-Project/survey-project-creation-service/blob/release-1.0.0/src/.env.sample), +[Project](https://github.com/ELEVATE-Project/project-service/blob/main/.env.sample), [User](https://github.com/ELEVATE-Project/user/blob/master/src/.env.sample), [Notification](https://github.com/ELEVATE-Project/notification/blob/master/src/.env.sample), [Scheduler](https://github.com/ELEVATE-Project/scheduler/blob/master/src/.env.sample), [Interface](https://github.com/ELEVATE-Project/interface-service/blob/main/src/.env.sample) and [Entity-Management](https://github.com/ELEVATE-Project/entity-management/blob/main/src/.env.sample) repositories for reference. + +> **Caution:** While the default values in the downloaded environment files enable the ELEVATE-Project Application to operate, certain features may not function correctly or could be impaired unless the adopter-specific environment variables are properly configured. + +> **Important:** +> - The Self Creation Portal heavily depends on the cloud, and most of the data is stored there. So please update the cloud-related environment keys with the actual values before proceeding further. +- As mentioned in the above linked document, the **User SignUp** functionality may be compromised if key environment variables are not set correctly during deployment. If you opt to skip this setup, consider using the sample user account generator detailed in the `Sample User Accounts Generation` section of this document. + +5. **Attaching Config File** + + ``` + curl -L -o survey-project-creation-service/src/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configSCP.json && \ + curl -L -o project-service/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json && \ + curl -L -o entity-management/src/config.json https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/configFile.json + ``` + +6. **Create Databases** + + 1. Download `create-databases.sh` Script File: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/create-databases.sh + ``` + + 2. Make the executable by running the following command: + + ``` + chmod +x create-databases.sh + ``` + + 3. Run the script file: + + ``` + ./create-databases.sh + ``` + +7. **Run Migrations to Create Tables and Seed Default Values** + + ``` + cd user/src && npx sequelize-cli db:migrate && cd ../.. && \ + cd survey-project-creation-service/src && npx sequelize-cli db:migrate && cd ../.. && \ + cd notification/src && npx sequelize-cli db:migrate && cd ../.. + ``` + + To seed the default values, run the following command: + + ``` + cd user/src && npx sequelize-cli db:seed:all && cd ../../ + ``` + +8. **Enabling Citus And Setting Distribution Columns (Optional)** + + To boost performance and scalability, users can opt to enable the Citus extension. This transforms PostgreSQL into a distributed database, spreading data across multiple nodes to handle large datasets more efficiently as demand grows. + + > NOTE: Currently only available for Linux based operation systems. + + 1. Download user `distributionColumns.sql` file. + + ``` + curl -o ./user/distributionColumns.sql -JL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/user/distributionColumns.sql + + ``` + + 2. Set up the `citus_setup` file by following the steps given below. + + 1. Download the `citus_setup.sh` file: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/1.0.0/native/scripts/linux/citus_setup.sh + ``` + + 2. Make the setup file executable by running the following command: + + ``` + chmod +x citus_setup.sh + ``` + + 3. Enable Citus and set distribution columns for `user` database by running the `citus_setup.sh`with the following arguments. + ``` + ./citus_setup.sh user postgres://postgres:postgres@localhost:9700/users + 3. Download survey-project-creation-service `distributionColumns.sql` file. + + ``` + curl -o ./survey-project-creation-service/distributionColumns.sql -JL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/distribution-columns/survey-project-creation/distributionColumns.sql + + ``` + 2. Set up the `citus_setup` file by following the steps given below. + + 1. Download the `citus_setup.sh` file: + + ``` + curl -OJL https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/main/documentation/1.0.0/native/scripts/linux/citus_setup.sh + ``` + + 2. Make the setup file executable by running the following command: + + ``` + chmod +x citus_setup.sh + ``` + + 3. Enable Citus and set distribution columns for `scp` database by running the `citus_setup.sh`with the following arguments. + ``` + ./citus_setup.sh survey-project-creation-service postgres://postgres:postgres@localhost:9700/scp + +9. **Insert Initial Data** + 1. Once you update the cloud credentials in the survey-project-creation-service environment, please run the script below to upload the certificate base templates to the cloud. + ``` + cd survey-project-creation-service/src/scripts && node uploadCertificateBaseTemplate.js && cd ../../../ + ``` + 2. If you are using the Self Creation Portal for the education sector, please run the script below to insert the relevant entities into the survey-project-creation-service database. + ``` + cd survey-project-creation-service/src/scripts && node addDefaultEntitiesForEducationSector.js && cd ../../../ + ``` + 3. Download `entity-project-sample-data.sh` Script File: + + ``` + curl -o project_entity_sample_data.sh https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/project_entity_sample_data.sh && \ + chmod +x project_entity_sample_data.sh && \ + ./project_entity_sample_data.sh + ``` + +10. **Insert Forms Data into Database** + + If the `axios` package is not available in the current project directory, install it before running the import script: + + ```bash + npm install axios + ``` + + Then run the import script: + + ```bash + curl -s https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/linux/import_forms.js | node + ``` + +11. **Start The Services** + + Following the steps given below, 2 instances of each ELEVATE-Project backend service will be deployed and be managed by PM2 process manager. + + ``` + (cd survey-project-creation-service/src && pm2 start app.js --name survey-project-creation-service && cd -) && \ + (cd project-service && pm2 start app.js --name project-service && cd -) && \ + (cd entity-management/src && pm2 start app.js --name entity-management && cd -) && \ + (cd user/src && pm2 start app.js --name user && cd -) && \ + (cd notification/src && pm2 start app.js --name notification && cd -) && \ + (cd interface-service/src && pm2 start app.js --name interface && cd -) && \ + (cd scheduler/src && pm2 start app.js --name scheduler && cd -) + ``` + +12. **Start The Portal** + + ELEVATE-Project portal utilizes Ionic for building the browser bundle, follow the steps given below to install them and start the portal. + + 1. Install the Ionic framework: + + ``` + npm install -g ionic + ``` + + 2. Install the Ionic client: + + ``` + npm install -g @ionic/cli + ``` + + 3. Navigate to `observation-survey-projects-pwa` directory: + + ``` + cd observation-survey-projects-pwa + ``` + + 4. Run the project on your local system using the following command: + + ``` + ionic serve + ``` + + Navigate to http://localhost:8100 to access the ELEVATE-Project Portal. + +## Sample User Accounts Generation + +During the initial setup of ELEVATE-Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the ELEVATE-Project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. + +In such cases, you can generate sample user accounts using the steps below. This allows you to explore the ELEVATE-Project services and portal immediately after setup. + +> **Warning:** Use this generator only immediately after the initial system setup and before any normal user accounts are created through the portal. It should not be used under any circumstances thereafter. + +``` +curl -o insert_sample_data.sh https://raw.githubusercontent.com/ELEVATE-Project/project-service/refs/heads/setupGuideSCP/documentation/3.4.0/native/scripts/scp/ubuntu/insert_sample_data.sh && \ +chmod +x insert_sample_data.sh && \ +./insert_sample_data.sh +``` + +After successfully running the script mentioned above, the following user accounts will be created and available for login: + +| Email ID | Password | Role | +| ---------------------- | ---------- | ----------------------- | +| mallanagouda@gmail.com | Password1@ | State Education Officer | +| prajwal@gmail.com | Password1@ | State Education Officer | +| vishnu@gmail.com | Password1@ | State Education Officer | +| priyanka@gmail.com | Password1@ | Program Designer | +| adithya@gmail.com | Password1@ | Content Creator | +| praveen@gmail.com | Password1@ | Reviewer | + +## Postman Collections + +- [Projects Service](https://github.com/ELEVATE-Project/project-service/tree/main/api-doc) + +- [Surevy Project Creation Service](https://github.com/ELEVATE-Project/survey-project-creation-service/tree/release-1.0.0/src/api-doc) + +## Adding New Projects to the System + +With implementation scripts, you can seamlessly add new projects to the system. Once a project is successfully added, it becomes visible on the portal, ready for use and interaction. For a comprehensive guide on setting up and using the implementation script, please refer to the [documentation here](https://github.com/ELEVATE-Project/project-service/tree/main/Project-Service-implementation-Script). + +# Team + + + + + +# Open Source Dependencies + +Several open source dependencies that have aided Projects's development: + +![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) +![Apache Kafka](https://img.shields.io/badge/Apache%20Kafka-000?style=for-the-badge&logo=apachekafka) +![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge&logo=redis&logoColor=white) +![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white) +![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) diff --git a/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md b/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md index 3de8666f..a0cef7ac 100644 --- a/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md +++ b/documentation/3.4.0/setup/native/stand-alone/ubuntu/README.md @@ -228,6 +228,15 @@ curl -L -o scheduler/src/.env https://raw.githubusercontent.com/ELEVATE-Project/ (cd scheduler/src && pm2 start app.js --name scheduler && cd -) ``` +## 🌐 Micro-Frontend (FE) Setup + +The ELEVATE application uses a micro-frontend architecture. After setting up the backend services, you must configure and run the frontend repositories to access the application via the portal. + +Follow the setup guides for the frontend repositories: + +- **Login Portal:** [elevate-portal](https://github.com/ELEVATE-Project/elevate-portal/tree/releaase-1.1.0) +- **Projects Program Module (PWA):** [observation-survey-projects-pwa](https://github.com/ELEVATE-Project/observation-survey-projects-pwa/tree/release-3.4.0) + ## Sample User Accounts Generation During the initial setup of ELEVATE-Project services with the default configuration, you may encounter issues creating new accounts through the regular SignUp flow on the ELEVATE-Project portal. This typically occurs because the default SignUp process includes OTP verification to prevent abuse. Until the notification service is configured correctly to send actual emails, you will not be able to create new accounts. @@ -252,7 +261,6 @@ After successfully running the script mentioned above, the following user accoun --- - ## 🌐 Micro-Frontend (FE) Setup The ELEVATE application uses a micro-frontend architecture. After setting up the backend services, you must configure and run the frontend repositories to access the application via the portal. @@ -266,9 +274,9 @@ Follow the setup guides for the frontend repositories: ### 🧪 Postman Collections and API DOC -- - Projects Service API Collection - +- + Projects Service API Collection + --- @@ -279,11 +287,11 @@ Once it's successfully added, it becomes visible on the portal, ready for use an For a comprehensive guide on setting up and using the SUP, please refer to: -- - solution-Upload-Portal-Service -- - solution-Upload-Portal - +- + solution-Upload-Portal-Service +- + solution-Upload-Portal + --- @@ -305,4 +313,4 @@ This project uses several open-source tools and dependencies that supported its ![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white) ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white) -![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white) +![RabbitMQ](https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white)