Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #342 from sef-global/development
Browse files Browse the repository at this point in the history
Release ScholarX Backend v1.5
  • Loading branch information
anjula-sack authored Jul 2, 2022
2 parents 1009797 + 7267222 commit e675653
Show file tree
Hide file tree
Showing 60 changed files with 3,132 additions and 1,959 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Frontend Deployment
on:
workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout backend
uses: actions/checkout@v2
with:
ref: deployment
path: backend
- name: Checkout frontend
uses: actions/checkout@v2
with:
repository: sef-global/scholarx-frontend
ref: master
path: frontend
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies and Build Frontend
run: |
cd frontend
npm ci
npm run build
- name: Copy static files
run: |
cp frontend/dist/bundle.js backend/src/main/resources/static/
cp frontend/dist/index.html backend/src/main/resources/static/
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
path: backend
commit-message: '[Bot] Deploy the latest frontend'
title: '[Bot] Deploy the latest frontend'
body: |
Update report
- Auto-generated by [create-pull-request][1]
- Please add the new features/bug fixes list before merging
[1]: https://github.com/peter-evans/create-pull-request
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ development ]
pull_request:
branches: [ development ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Configure build
run: cp src/main/resources/application.yml.example src/main/resources/application.yml
- name: Build and Run Tests with Maven
run: mvn clean install
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

78 changes: 63 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,88 @@

Backend of the ScholarX project

### Setting up the project for development
## Setting up the project for development

**Prerequisites**
### Prerequisites
* Java
* Maven
* MySQL
* PostgreSQL
* Linkedin Social Login App
* Gmail Account with an App Password

**Setup Linkedin Social Login App**
### Setup Linkedin Social Login App

1. Create a new Linkedin App ([help?](https://docs.ultimatemember.com/article/142-social-login-linkedin-app-setup))
2. Click on `Auth` tab and add `http://localhost:8080/login/oauth2/code/linkedin` as an authorised redirect URL
3. Make Sure you have properly added the `Sign in with Linkedin product` under products tab

**Setup a gmail account with an app password**
### Setup a gmail account with an app password
1. Create a new gmail account if you don't have one already
2. Enable Two Factor Authorisation
3. Generate a new `App Password` ([help?](https://support.google.com/mail/answer/185833?hl=en-GB))
3. Generate a new `App Password` ([help?](https://support.google.com/mail/answer/185833?hl=en-GB))

**Steps**
### Run Locally
1. Fork and clone the repository
```
```shell
git clone https://github.com/<your profile name>/scholarx
```
2. Open the cloned repo, Find and open the `application.yml` file
3. Replace the `client-id` and `client-secret` with the values from the above linkedin social app
<img width="592" alt="image" src="https://user-images.githubusercontent.com/45477334/116671426-8a0e3780-a9be-11eb-9b22-3de725ee3107.png">
4. Replace the mail username and password values with the generated `App Password` and the corresponding gmail address
<img width="422" alt="image" src="https://user-images.githubusercontent.com/45477334/116671690-dbb6c200-a9be-11eb-9882-7e4a649729b7.png">
5. Replace the datasource dummy values with your local mysql server instance credentials
<img width="1007" alt="image" src="https://user-images.githubusercontent.com/45477334/116671874-17ea2280-a9bf-11eb-84b4-a21355a9df73.png">
6. Run the application
3. Replace the `${client-id}` and `${client-secret}` with the values from the above linkedin social app
example:
```yaml
linkedin:
client-id: 324780jdsfg2u4
client-secret: MsdfsdfggsqPFh
client-authentication-method: post
authorization-grant-type: authorization_code
```
4. Replace the mail `username` and `password` values with the generated `App Password` and the corresponding gmail address
example:
```yaml
mail:
host: smtp.gmail.com
port: 587
username: [email protected]
password: jhdfklsdjjadskt
properties:
```

5. Replace the datasource dummy values with your local mysql server instance credentials
example:
```yaml
datasource:
url: jdbc:postgresql://localhost:5432/scholarx_DB?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: rootuser
password: rootpassword
platform: postgres
```

6. Run the application
```shell
mvn spring-boot:run
```

### Configuring a MySQL Database (Optional)

1. Add the `mysql-connector-java` dependency to the `pom.xml` file.
```xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
```

2. Replace the `spring.jpa` and `spring.datasource` configurations in `application.yml` with the following configuration.
```yaml
jpa:
database: postgresql
hibernate:
ddl-auto: update
datasource:
url: jdbc:postgresql://${DB_URL}/${DB_NAME}?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: ${DB_USER_NAME}
password: ${DB_USER_PASSWORD}
platform: postgres
```
Loading

0 comments on commit e675653

Please sign in to comment.