Skip to content

Commit

Permalink
Add database setup (#6)
Browse files Browse the repository at this point in the history
Add basic dependencies and configuration for creating a simple database to store the currency exchange rates.
  • Loading branch information
mazenmelouk authored Feb 5, 2024
1 parent 6617675 commit 3923caa
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,31 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>

<!--These libraries are only used for testing purposes, doesn't need to be in the final produced jar-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<!--The library is only used for testing purposes, doesn't need to be in the final produced jar-->
<scope>test</scope>
</dependency>
<!--In memory database for testing-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ spring:
logging:
level:
org.springframework: DEBUG
datasource:
url: jdbc:postgresql://localhost:5432/currency_exchange
username: postgres
password: postgres
jpa.hibernate.ddl-auto: create
jpa.properties.hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
external:
api:
exchange_rate:
uri: http://localhost:8081
token: "dummy-token"


# Configuration for the "production" profile
---
spring:
Expand All @@ -23,6 +30,12 @@ spring:
logging:
level:
org.springframework: INFO
datasource:
url: jdbc:postgresql://localhost:5432/currency_exchange
username: postgres
password: postgres
jpa.hibernate.ddl-auto: create
jpa.properties.hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
external:
api:
exchange_rate:
Expand Down

0 comments on commit 3923caa

Please sign in to comment.