Backend of the ScholarX project
- Java
- Maven
- PostgreSQL
- Linkedin Social Login App
- Gmail Account with an App Password
- Create a new Linkedin App (help?)
- Click on
Auth
tab and addhttp://localhost:8080/login/oauth2/code/linkedin
as an authorised redirect URL - Make Sure you have properly added the
Sign in with Linkedin product
under products tab
- Create a new gmail account if you don't have one already
- Enable Two Factor Authorisation
- Generate a new
App Password
(help?)
- Fork and clone the repository
git clone https://github.com/<your profile name>/scholarx
- Open the cloned repo, Find and open the
application.yml
file - Replace the
${client-id}
and${client-secret}
with the values from the above linkedin social app
example:
linkedin:
client-id: 324780jdsfg2u4
client-secret: MsdfsdfggsqPFh
client-authentication-method: post
authorization-grant-type: authorization_code
- Replace the mail
username
andpassword
values with the generatedApp Password
and the corresponding gmail address
example:
mail:
host: smtp.gmail.com
port: 587
username: [email protected]
password: jhdfklsdjjadskt
properties:
- Replace the datasource dummy values with your local mysql server instance credentials
example:
datasource:
url: jdbc:postgresql://localhost:5432/scholarx_DB?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: rootuser
password: rootpassword
platform: postgres
- Run the application
mvn spring-boot:run
- Add the
mysql-connector-java
dependency to thepom.xml
file.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
- Replace the
spring.jpa
andspring.datasource
configurations inapplication.yml
with the following configuration.
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