Make sure you installed the following programs:
Optional (if you want to use PostgreSQL database engine):
- PostgreSQL 11
- PgAdmin (should get automatically installed when installing PostgreSQL)
- After you installed everything clone this project and open IntelliJ IDEA. If prompted with a
Trust and Open Project
alert, clickTrust Project
- Switch the branch to
iteration/3
- In IntelliJ go to project structure (
File
->Project Structure
). - In the project tab ->
Project SDK
selectJDK 11
. If it is not in the list, press onAdd
->SDK...
and select the path where you installed JDK 11. Should be a folder that containsbin
,lib
and other folders. - After choosing
JDK 11
, wait for the application to get indexed. - Right-click the
pom.xml
file and clickAdd as Maven project
OR clickLoad Maven Project
in the floating window in the bottom right. - Right-click the
FutureUpApplication
file in theProject
pane and clickRun 'FutureUp..
. After this the configuration should appear in the top right of the IDE.
We offer two configuration options for the database engine: H2 is lightweight and easy to set up while PostgresSQL is more powerful but a also a bit more complicated. For the scope of this project both options are perfectly fine but we decided to offer both of the options for the sake of diversity.
The H2 database database engine has the advantage of being fast, small and in-memory thus making it great for quick development without prerequisites.
In order to use this database engine there is no need to download any additional software, the only thing needed for the file resources/application.properties
file to look like this:
#FOR H2
spring.datasource.url=jdbc:h2:mem:futureup
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.defer-datasource-initialization=true
spring.h2.console.enabled=true
#FOR POSTGRESSQL
#spring.datasource.url=jdbc:postgresql://localhost:5432/futureup
#spring.datasource.username=postgres
#spring.datasource.password=root
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
#spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
#spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
#spring.jpa.hibernate.ddl-auto=update
#spring.main.allow-bean-definition-overriding=true
#spring.jackson.default-property-inclusion=non_null
There is no need to download any additional software in order for this config to work
To access H2 database console application go to: http://localhost:8080/h2-console while the Spring server is running
The JDBC URL
should be like the field spring.datasource.url
in application.properties
(in our case jdbc:h2:mem:futureup
)
The User Name
field should be like the field spring.datasource.username
in application.properties
(in our case sa
)
The Password
field should be like the field spring.datasource.password
in application.properties
(in our case password
)
Further optional reading:
Spring Boot With H2 Database via Baeldung
PostgreSQL is an open source database engine and is one of the most powerful database engines available at the moment.
The use of this database requires an few extra steps:
- Install PostgreSQL and PgAdmin
- Create a database called
futureup
in PgAdmin
In order to use this database engine there is no need to download any additional software, the only thing needed for the file resources/application.properties
file to look like this:
#FOR H2
#spring.datasource.url=jdbc:h2:mem:futureup
#spring.datasource.driverClassName=org.h2.Driver
#spring.datasource.username=sa
#spring.datasource.password=password
#spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
#spring.jpa.defer-datasource-initialization=true
#spring.h2.console.enabled=true
#FOR POSTGRESSQL
spring.datasource.url=jdbc:postgresql://localhost:5432/futureup
spring.datasource.username=postgres
spring.datasource.password=root
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.hibernate.ddl-auto=update
spring.main.allow-bean-definition-overriding=true
spring.jackson.default-property-inclusion=non_null
The fields spring.datasource.username
and spring.datasource.password
correspond to the username and password you set during the PostgreSQL installation process. The default user is postgres
- Open
Postman
- Go to
Import
,File
tab and clickUpload Files
- Go to
other_files/FutureUp.postman_collection.json
(on branchiteration/3
) and clickOpen
- In
Postman
, go toCollections
and selectFutureUp