Skip to content

Commit

Permalink
Merge pull request #51 from beehyv/upstream_sync
Browse files Browse the repository at this point in the history
Upstream Repo sync
  • Loading branch information
roopesh-beehyv authored Dec 11, 2023
2 parents 597dc0f + 3efd333 commit 264da81
Show file tree
Hide file tree
Showing 102 changed files with 2,975 additions and 924 deletions.
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

# Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Documentation
- [ ] Other ( please specify )

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules


42 changes: 42 additions & 0 deletions .github/workflows/package-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Package-prod

on:
push:
branches: [ "master"]
paths-ignore:
- target/**
- dist/**
pull_request:
branches: [ "master" ]
paths-ignore:
- target/**
- dist/**

env:
ENV_VAR: prod

jobs:
Package-prod:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Setup JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'

- name: Build with Maven
run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }}

- name: Create WAR file
run: mvn -B package --file pom.xml

- name: Upload WAR file as artifact
uses: actions/upload-artifact@v2
with:
name: HWC-API
path: target/hwc-facility-service.war
42 changes: 42 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Package

on:
push:
branches: [ "develop"]
paths-ignore:
- target/**
- dist/**
pull_request:
branches: [ "develop" ]
paths-ignore:
- target/**
- dist/**

env:
ENV_VAR: test

jobs:
Package-test:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2

- name: Setup JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'

- name: Build with Maven
run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }}

- name: Build WAR file
run: mvn -B package --file pom.xml

- name: Upload WAR file as artifact
uses: actions/upload-artifact@v2
with:
name: HWC-API
path: target/hwc-facility-service.war
63 changes: 0 additions & 63 deletions .github/workflows/sast-and-package-prod.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/sast-and-package.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/sast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "CodeQL"

on:
push:
branches: [ "develop" ]
paths-ignore:
- target/**

pull_request:
branches: [ "develop" ]
paths-ignore:
- target/**

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Setup JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'

- name: Build with Maven
run: mvn clean install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ Thumbs.db
mvnw.cmd
.sts4-cache
mvnw

src/main/environment/common_local.properties
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
Binary file not shown.
57 changes: 48 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,58 @@ Health and Wellness centre (HWC) is one of the comprehensive applications of AMR
## Building From Source
This microservice is built on Java, Spring boot framework and MySQL DB.

### Prerequisites
### Pre-requisites
* JDK 1.8
* Maven
* Spring Tool Suite 3 / Eclipse(2023-03)
* Maven (if not pre-installed with the editor)
* Redis-x64-3.0.504
* MySQL Workbench 8.0

$ ./mvn clean install
### Creating a build configuration in STS / Eclipse

## Installation
This service has been tested on Wildfly as the application server.
* You can copy `common_example.properties` to `common_local.properties` and edit the file accordingly. The file is under `src/main/environment` folder.
* In your editor, click on Run -> Run configuration.
* Double-click on Maven build and give a suitable name for the new configuration.
* Populate the base directory by clicking on workspace and selecting HWC-API module.
* Set goals to clean install -DENV_VAR=local(your choice of desired environment) and click on Apply.
* It is advisable have a personal environment properties file under src/main/environment filling out all the placeholders to avoid repetitive manual work each time you run locally.
* Click Run to run the build configuration.

### Prerequisites
* Wildfly (or any compatible app server)
* Redis
* MySQL Database
### Creating a run configuration in STS / Eclipse

* In your editor, click on Run -> Run configuration.
* 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#!/

### How to Import, Build, and Run Maven Code in Visual Studio Code

1. **Install Visual Studio Code**: Download and install [Visual Studio Code](https://code.visualstudio.com/) from the official website.

2. **Install Java**: Ensure you have the Java Development Kit (JDK 1.8) installed on your computer. You can download it from the [Oracle website](https://www.oracle.com/java/technologies/javase-downloads.html) or use an open-source JDK like [OpenJDK](https://adoptopenjdk.net/).

3. **Install Maven**: Make sure you have Apache Maven installed on your system. Download it from the [Apache Maven website](https://maven.apache.org/download.cgi).

4. **Install Visual Studio Code Extensions**:
- **Java Extension Pack**: Open Visual Studio Code, go to the Extensions view by clicking on the Extensions icon in the Activity Bar, and search for "Java Extension Pack." Install it to get Java support and Maven integration.

5. **Open the Project in Visual Studio Code**:
- Launch Visual Studio Code.
- Use the **File > Open Folder** option to open your Maven project folder.

6. **Configure Java and Maven**:
- If not already configured, set up your Java Home and Maven Home in Visual Studio Code.
- Go to **File > Preferences > Settings**, search for "Java Home" and "Maven Home," and specify the paths to your JDK and Maven installations.

7. **Build and Run**:
- To build and run your Maven project, open the integrated terminal in Visual Studio Code (**Terminal > New Terminal**).
- Navigate to your project directory using the `cd` command.
- Use Maven commands like `mvn clean install` to build your project.
- To run your Java application, use mvn spring-boot:run. Ensure the redis server is open during run.

##DB restoration
[blank_db_zip](https://psmri.github.io/PSMRI/developer-guides/technical-overview/#db-restoration)

## Integrations
* Video Consultation
Expand Down
Loading

0 comments on commit 264da81

Please sign in to comment.