The Samsung Health Stack is build to work with PostgreSQL Database. There are two methods to configure PostgreSQL database. You can edit application.yml or use application.properties
Using application.yml
application.yml file contains configuration settings for a Spring Framework application. To connect your PostgreSQL database, update the following properties in the codeconfig section located at platform/src/main/resources/application.ymlwithin the backend-system's directory:
DB_HOST: Replace with the hostname or IP address of your PostgreSQL server.
DB_PORT: Replace with the port number on which your PostgreSQL server listens (default is 5432).
DB_NAME: Replace with the name of your PostgreSQL database.
DB_SCHEMA: Replace with the schema name (if applicable) you want to use for your application.
DB_USERNAME: Replace with the username for your PostgreSQL database.
DB_PASSWORD: Replace with the password for your PostgreSQL database.
For example, if your PostgreSQL server is listening on localhost and you have a database named mydatabase with a schema named public, and you want to use the username myusername and password mypassword, you would update the config section as follows:
Here, spring.datasource.url is the JDBC URL to connect to your PostgreSQL database, which includes the database server hostname (localhost in this example), the port number (5432 in this example), and the name of the database (mydatabase in this example). You can update these values as per your PostgreSQL configuration.
The spring.datasource.username and spring.datasource.password properties are used to specify the username and password to connect to your PostgreSQL database.
You can also set additional properties such as spring.datasource.driver-class-name to specify the JDBC driver class name if it's not included in your classpath.
Once you have updated the application.properties file, you can start your Spring Boot application and it should be able to connect to your PostgreSQL database using the specified configuration.
Understanding application.yml file
application.yml file contains configuration settings for a Spring Framework application. Let's break it down section by section:
This section defines various configuration properties under the config namespace. It includes:
db: A set of properties defining the URL, host, port, database name, schema, username, and password for a PostgreSQL database.
new-database-config: A set of properties defining a prefix and postfix to use when creating a new database.
jwks: A property defining the URL for a JSON Web Key Set (JWKS) endpoint.
account-service: A property defining the URL for an account service.
codelogging:
level:
root: info
This section sets the logging level for the application to info. This means only messages with a severity of INFO, WARN, ERROR, or FATAL will be logged.
This section defines configuration settings for the Flyway database migration tool, which is a popular tool for managing database schema changes. It includes:
url: The JDBC URL for the PostgreSQL database, using the config.db.url property defined earlier.
user: The username for connecting to the PostgreSQL database, using the config.db.user property defined earlier.
password: The password for connecting to the PostgreSQL database, using the config.db.password property defined earlier.
server:
port: 3030
This section defines the port on which the application will listen for incoming requests. In this case, it will listen on port 3030.
Overall, this application.yml file defines a set of configuration properties for a Spring Framework application, including settings for connecting to a PostgreSQL database and managing database schema changes using the Flyway migration tool.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.