From 8caa3c86200a42997d4e2f0220a3e8461f01e0ba Mon Sep 17 00:00:00 2001 From: Asp-irin <119241921+Asp-irin@users.noreply.github.com> Date: Sat, 1 Feb 2025 13:37:45 +0530 Subject: [PATCH 1/5] Update software-dependencies.md --- .../software-dependencies.md | 185 +++++++++++------- 1 file changed, 111 insertions(+), 74 deletions(-) diff --git a/developer-guide/development-environment-setup/software-dependencies.md b/developer-guide/development-environment-setup/software-dependencies.md index 8e5888a..03adf4f 100644 --- a/developer-guide/development-environment-setup/software-dependencies.md +++ b/developer-guide/development-environment-setup/software-dependencies.md @@ -1,118 +1,155 @@ -# Software dependencies +## Software Dependencies -**1. Operating System:** +### **1. Operating System:** The development environment for a Spring Boot 3 and Angular 16 application can be set up on any modern operating system. Ensure that your system meets the following requirements: -* **Windows 10/11 (64-bit)**: Suitable for most development setups. -* **macOS (Big Sur or later)**: Offers great compatibility with open-source tooling and a Unix-based system. -* **Linux (Ubuntu 20.04+, Fedora, etc.)**: Popular among developers for its performance, flexibility, and ease of use in programming environments. +- **Windows 10/11 (64-bit)**: Suitable for most development setups. +- **macOS (Big Sur or later)**: Offers great compatibility with open-source tooling and a Unix-based system. +- **Linux (Ubuntu 20.04+, Fedora, etc.)**: Popular among developers for its performance, flexibility, and ease of use in programming environments. -#### **2. Java Development Kit (JDK):** +--- + +### **2. Java Development Kit (JDK):** Spring Boot 3 requires **Java 17** (LTS version) as it offers long-term support and compatibility. -* **Version**: Java 17 (LTS). -* **Installation Guide**: - * [**Oracle JDK**](https://www.oracle.com/java/technologies/javase-downloads.html): Official JDK from Oracle with licensing and support. - * [**OpenJDK**](https://jdk.java.net/17/): Free and open-source implementation. -* **Verify Installation**: Once installed, verify by running the following command: +- **Version**: Java 17 (LTS). +- **Installation Guide**: + - [**Oracle JDK**](https://www.oracle.com/java/technologies/javase-downloads.html): Official JDK from Oracle with licensing and support. + - [**OpenJDK**](https://jdk.java.net/17/): Free and open-source implementation. +- **Verify Installation**: Once installed, verify by running the following command: + ```bash + java -version + ``` + It should display Java 17. - ```bash - java -version - ``` +--- - It should display Java 17. - -#### **3. Node.js and npm (for Angular 16):** +### **3. Node.js and npm (for Angular 16):** Node.js is essential for Angular development, as it powers the Angular CLI, package management, and builds. -* **Version**: Node.js 18+ (for Angular 16+). -* **Installation Guide**: - * [**Node.js Official Downloads**](https://nodejs.org/en/download/): Download the LTS version for the best stability and support. -* **Verify Installation**: After installing, verify by running: +- **Version**: Node.js 18+ (for Angular 16+). +- **Installation Guide**: + - [**Node.js Official Downloads**](https://nodejs.org/en/download/): Download the LTS version for the best stability and support. +- **Verify Installation**: After installing, verify by running: + ```bash + node --version + npm --version + ``` - ```bash - node --version - npm --version - ``` +--- -#### **4. Angular CLI:** +### **4. Angular CLI:** The Angular CLI helps you scaffold and manage Angular applications. -* **Version**: Angular CLI 16.x. -* **Installation Command**: Install Angular CLI globally via npm: +- **Version**: Angular CLI 16.x. +- **Installation Command**: Install Angular CLI globally via npm: + ```bash + npm install -g @angular/cli@16 + ``` +- **Verify Installation**: Run `ng version` to confirm the CLI is properly installed. - ```bash - npm install -g @angular/cli@16 - ``` -* **Verify Installation**: Run `ng version` to confirm the CLI is properly installed. +--- -#### **5. Spring Boot:** +### **5. Spring Boot:** Spring Boot simplifies the development of Java-based enterprise applications by providing pre-configured templates and reducing boilerplate. -* **Version**: Spring Boot 3.x. -* **Build Tool**: Maven (preferred) or Gradle. -* **Installation Command (Maven)**: Maven is a build automation tool used for managing dependencies and packaging your Spring Boot project. - * [**Maven Installation Guide**](https://maven.apache.org/install.html). -* After installing Maven, verify with: +- **Version**: Spring Boot 3.x. +- **Build Tool**: Maven (preferred) or Gradle. +- **Installation Command (Maven)**: Maven is a build automation tool used for managing dependencies and packaging your Spring Boot project. + - [**Maven Installation Guide**](https://maven.apache.org/install.html). +- **Verify Installation**: After installing Maven, verify with: + ```bash + mvn -version + ``` - ```bash - mvn -version - ``` +--- -#### **6. Development Environment:** +### **6. Development Environment:** You’ll need integrated development environments (IDEs) that support Java and TypeScript for backend and frontend development, respectively. -* **IDE for Backend (Spring Boot)**: - * [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/): Great for Java-based development and Spring Boot. It has dedicated support for Spring. - * [**Eclipse IDE**](https://www.eclipse.org/downloads/): A popular open-source IDE with Spring Boot support. - * [**Spring Tool Suite (STS)**](https://spring.io/tools): A specialized IDE tailored for Spring applications. -* **IDE for Frontend (Angular)**: - * [**Visual Studio Code**](https://code.visualstudio.com/download/): A lightweight and highly customizable editor for TypeScript and Angular development. - * [**WebStorm**](https://www.jetbrains.com/webstorm/download/): A feature-rich IDE with built-in Angular support. +- **IDE for Backend (Spring Boot)**: + - [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/): Great for Java-based development and Spring Boot. It has dedicated support for Spring. + - [**Eclipse IDE**](https://www.eclipse.org/downloads/): A popular open-source IDE with Spring Boot support. + - [**Spring Tool Suite (STS)**](https://spring.io/tools): A specialized IDE tailored for Spring applications. +- **IDE for Frontend (Angular)**: + - [**Visual Studio Code**](https://code.visualstudio.com/download/): A lightweight and highly customizable editor for TypeScript and Angular development. + - [**WebStorm**](https://www.jetbrains.com/webstorm/download/): A feature-rich IDE with built-in Angular support. -#### **7. Database:** +--- -AMRIT platform requires a database, we use MySQL, a relational database. +### **7. Docker and Docker Compose (Optional):** -* **MySQL**: - * **Version**: MySQL 8+. - * Download Mysql from [here](https://dev.mysql.com/downloads/installer/) - * After installation, use MySQL Workbench or the command line to manage your database. +Docker and Docker Compose are only required if you want to set up dummy data locally using the `amrit-devops` repository. This setup includes pre-configured databases (MySQL and MongoDB) and Redis, so you **do not need to manually install MySQL, MongoDB, or Redis** (steps 8, 9, and 10) if using Docker. -Configure your Spring Boot application with the required database connection properties in the `application.properties` file. +- **Docker**: + - **Version**: Docker 20.10+. + - [**Install Docker**](https://docs.docker.com/get-docker/). + - **Verify Installation**: + ```bash + docker --version + ``` +- **Docker Compose**: + - **Version**: Docker Compose 2.1+. + - [**Install Docker Compose**](https://docs.docker.com/compose/install/). + - **Verify Installation**: + ```bash + docker-compose --version + ``` + +--- -#### **8. Caching:** +### **8. Database (Optional):** -To improve performance, we use caching solutions. +If you are **not using Docker**, the AMRIT platform requires a database. We use **MySQL** and **MongoDB**. -* **Redis** is a popular in-memory data store used for caching in Spring Boot apps. - * Download Redis from [here](https://redis.io/docs/latest/get-started/) - * Redis is integrated into Spring Boot via the `spring-data-redis` library. +- **MySQL**: + - **Version**: MySQL 8+. + - [**Download MySQL**](https://dev.mysql.com/downloads/). + - After installation, use MySQL Workbench or the command line to manage your database. + - Configure your Spring Boot application with the required database connection properties in the `application.properties` file. +- **MongoDB**: + - **Version**: MongoDB 6.0+. + - [**Download MongoDB**](https://www.mongodb.com/try/download/community). + - After installation, use MongoDB Compass or the command line to manage your database. + - Configure your Spring Boot application with the required MongoDB connection properties in the `application.properties` file. -#### **9. Other Tools:** +--- -* **Git**: Version control system. - * Download Git from [here](https://git-scm.com/downloads) - * After installing, verify by running: +### **9. Caching (Optional):** - ```bash - git --version - ``` -* **NVM (Node Version Manager)**: To manage multiple Node.js versions if needed. - * Download node from [here](https://nodejs.org/en/download/package-manager) -* **Browser**: The latest version of Google Chrome, Firefox, or Microsoft Edge is recommended for testing and debugging Angular apps. +If you are **not using Docker**, Redis is used for caching to improve performance. -#### **10. Additional Recommendations:** +- **Redis**: + - [**Download Redis**](https://redis.io/download). + - Redis is integrated into Spring Boot via the `spring-data-redis` library. -* **Memory Allocation**: Spring Boot applications, especially large ones, may require a substantial amount of memory. Allocate 2 GB or more to the JVM to avoid performance issues during development. +--- +### **10. Other Tools:** + +- **Git**: Version control system. + - [**Download Git**](https://git-scm.com/downloads). + - **Verify Installation**: ```bash - export JAVA_OPTS="-Xms2g -Xmx4g" + git --version ``` +- **NVM (Node Version Manager)**: To manage multiple Node.js versions if needed. + - [**Download NVM**](https://github.com/nvm-sh/nvm). +- **Browser**: The latest version of Google Chrome, Firefox, or Microsoft Edge is recommended for testing and debugging Angular apps. + +--- + +### **11. Additional Recommendations:** + +- **Memory Allocation**: Spring Boot applications, especially large ones, may require a substantial amount of memory. Allocate 2 GB or more to the JVM to avoid performance issues during development. + ```bash + export JAVA_OPTS="-Xms2g -Xmx4g" + ``` +--- From 5d782a1aaaad86e20949e43579a0b86796e859c9 Mon Sep 17 00:00:00 2001 From: Asp-irin <119241921+Asp-irin@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:05:22 +0530 Subject: [PATCH 2/5] Update README.md --- .../installation-instructions/README.md | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/developer-guide/development-environment-setup/installation-instructions/README.md b/developer-guide/development-environment-setup/installation-instructions/README.md index 964e13e..f9ebf97 100644 --- a/developer-guide/development-environment-setup/installation-instructions/README.md +++ b/developer-guide/development-environment-setup/installation-instructions/README.md @@ -1,7 +1,34 @@ # Installation Instructions -* Cloning the repository. -* Installing dependencies. -* Setting up environment variables. -* Configuring the database. -* Running the application locally. +## Development Environment Setup + +### Step 1: Software Dependencies +First, ensure all required software is installed by following the [Software Dependencies Guide](https://piramal-swasthya.gitbook.io/amrit/developer-guide/development-environment-setup/software-dependencies): + +#### Dockerized Path (Recommended) +- Make sure you followed Step 7 in the Software Dependencies Guide to install Docker and Docker Compose +- **Skip** Steps 8 & 9 as you won't need manual database installation + +#### Manual Path +- Make sure you followed Steps 8 & 9 in the Software Dependencies Guide to install: + - MySQL and MongoDB (Step 8) + - Redis for caching (Step 9) +- **Skip** Step 7 as you won't need Docker + +### Step 2: Infrastructure Setup + +#### Dockerized Path (Recommended) +1. Clone the AMRIT DevOps repository +2. Follow the [DevOps Setup Documentation](https://github.com/PSMRI/AMRIT-DevOps/tree/main/amrit-local-setup) + - This will automatically set up your databases with required dummy data + +> 💡 **We strongly recommend the Docker path** as it ensures consistent database setup and eliminates potential conflicts. + +#### Manual Path +1. Refer to the [Database Schema Documentation](https://piramal-swasthya.gitbook.io/amrit/data-management/database-schema) to: + - Set up required database schemas + - Load necessary data + +### Step 3: Application Setup +After completing either path above: +1. Clone the required application repositories From 7a3796aa6a80de1454dc1fe0f39f08a77218c239 Mon Sep 17 00:00:00 2001 From: Asp-irin <119241921+Asp-irin@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:49:48 +0530 Subject: [PATCH 3/5] Update for-ui-repositories.md --- .../installation-instructions/for-ui-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-guide/development-environment-setup/installation-instructions/for-ui-repositories.md b/developer-guide/development-environment-setup/installation-instructions/for-ui-repositories.md index 2cdb4fe..0cb7304 100644 --- a/developer-guide/development-environment-setup/installation-instructions/for-ui-repositories.md +++ b/developer-guide/development-environment-setup/installation-instructions/for-ui-repositories.md @@ -30,4 +30,4 @@ npm start ``` -By default, your application will be available at `http://localhost:4200/`. You can access it in your browser. +Access your application through your browser using `http://localhost:{PORT}`, where PORT is defined in the [AMRIT documentation](https://github.com/PSMRI/AMRIT/blob/main/README.md). From 8f7f261b6b7aa0f37397c437966f8a07446b2e82 Mon Sep 17 00:00:00 2001 From: Asp-irin <119241921+Asp-irin@users.noreply.github.com> Date: Sun, 2 Feb 2025 11:02:26 +0530 Subject: [PATCH 4/5] Update for-api-repositories.md --- .../installation-instructions/for-api-repositories.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md b/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md index 8b3f8e3..b675478 100644 --- a/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md +++ b/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md @@ -12,6 +12,13 @@ The API microservices are built on Java, Spring boot framework and MySQL DB. * Redis * MySQL 8.0 and MySQL Workbench +### Through CLI +To build and run your Maven project, open the CLI. + * Navigate to your project directory using the `cd` command. + * Use the Maven command `mvn clean install` to build your project. + * To run your Java application, use `mvn spring-boot:run -DENV_VAR=local`. Ensure the Redis server is open during the run. + + #### Creating a build configuration in STS / Eclipse * You can copy `common_example.properties` to `common_local.properties` and edit the file accordingly. The file is under `src/main/environment` folder. From d45ae64cac04f61114d21f17fd411a616621cd32 Mon Sep 17 00:00:00 2001 From: Asp-irin <119241921+Asp-irin@users.noreply.github.com> Date: Sun, 2 Feb 2025 11:11:20 +0530 Subject: [PATCH 5/5] Update for-api-repositories.md --- .../installation-instructions/for-api-repositories.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md b/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md index b675478..9583aff 100644 --- a/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md +++ b/developer-guide/development-environment-setup/installation-instructions/for-api-repositories.md @@ -17,6 +17,8 @@ To build and run your Maven project, open the CLI. * Navigate to your project directory using the `cd` command. * Use the Maven command `mvn clean install` to build your project. * To run your Java application, use `mvn spring-boot:run -DENV_VAR=local`. Ensure the Redis server is open during the run. + * Once the run is complete, load `http://localhost:{PORT}/swagger-ui.html#!/`, where PORT is defined in the [AMRIT documentation](https://github.com/PSMRI/AMRIT/blob/main/README.md). + #### Creating a build configuration in STS / Eclipse @@ -42,7 +44,7 @@ To build and run your Maven project, open the CLI. * Double-click on Spring Boot App(in STS) / Java Application(in Eclipse) and give a suitable name for the new configuration. * Select the project and main class and click on Apply. * Click Run to run the configuration. Keep the Redis server open during this run. -* Once the run is complete, load [http://localhost:8080/swagger-ui.html#!/](http://localhost:8080/swagger-ui.html#!/) +* Once the run is complete, load `http://localhost:{PORT}/swagger-ui.html#!/`, where PORT is defined in the [AMRIT documentation](https://github.com/PSMRI/AMRIT/blob/main/README.md). #### How to Import, Build, and Run Maven Code in Visual Studio Code @@ -61,3 +63,4 @@ To build and run your Maven project, open the CLI. * Navigate to your project directory using the `cd` command. * Use the Maven command `mvn clean install` to build your project. * To run your Java application, use `mvn spring-boot:run -DENV_VAR=local`. Ensure the Redis server is open during the run. + * Once the run is complete, load `http://localhost:{PORT}/swagger-ui.html#!/`, where PORT is defined in the [AMRIT documentation](https://github.com/PSMRI/AMRIT/blob/main/README.md).