ratifire / devrate-service

1 stars 0 forks source link

Project: devRate

Dependencies

Spring Boot Starter Web

Spring Boot Starter Data JPA

Spring Boot Starter Validation

Spring Boot Starter Test

PostgreSQL JDBC Driver

Project Lombok

H2 Database

SpringDoc OpenApi

MapStruct

Spring Boot Mail Starter

Liquibase

Configuration

  1. Configure Spring Boot Application Properties

    Open your application.properties or application.yml file and add the Liquibase configuration:

    spring.liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml

  2. Create Liquibase Changelog File

    Create a db/changelog directory in src/main/resources and add a db.changelog-master.yaml file:

You can now start adding your Liquibase change sets.

Best practices for managing database evolution

  1. Project Structure:

    Create a well-organized project structure that includes directories for changelog files, configurations, and additional resources.

  2. One Changelog per Change Set:

    Organize your changes into small, atomic change sets. Each change set should represent a single logical change to the database schema. This makes it easier to understand and manage changes.

  3. Use Clear and Descriptive ChangeSet IDs:

    Choose meaningful IDs for your change sets to make it easier to identify them. Use a consistent naming convention that includes information about the change.

  4. Use Comment Tags:

    Include comment tags in your changelog files to provide additional context for each change. This can be helpful for understanding the purpose behind it.

  5. Documentation:

    Document each changelog file and change set with details on the purpose of the changes, any special considerations, and potential rollback strategies.

Spring Boot Actuator

Dockerfile. Нow to build and run the container

1. Build the Docker image:

2. Running the Container:

3. Stopping the Container

Docker-compose. Нow to start the project

Getting Started

Stopping the Services

Cleaning Up

Docker-compose-dev. Нow to start the project in dev mode

Getting Started

Profiles

Available Profiles

  1. Default Profile: Common configuration.
  2. Local Profile ('local'): Configuration suitable for local development.
  3. Development Profile ('dev'): Additional configurations for the development environment.

Switching Profiles

Local profile environment variables

  1. PostgreSQL settings:
    • PG_HOST - Host. Default value: 'localhost'
    • PG_PORT - Port number. Default value: '5432'
    • PG_DATABASE - Database name. Default value: 'devrate'
    • PG_USERNAME - User name. Default value: 'devrate'
    • PG_PASSWORD - Password. Default value: 'devrate'
    • PG_SCHEMA - Schema name. Default value: 'devrate'

Dev profile environment variables

  1. PostgreSQL settings:
    • PG_HOST - localhost
    • PG_PORT - 5432
    • PG_DATABASE - devrateDB
    • PG_USERNAME - admin
    • PG_PASSWORD - root
    • PG_SCHEMA - Schema name

Code style check

MailHog

Spring Boot Starter Security

Spring Security Test

New Users for Application Testing

The following accounts have been added for application testing:

  1. User 1

  2. User 2

** These emails and password are also used to log in to the email account.

The following Email addresses are using for users registration (https://proton.me/):

  1. New Email 1

  2. New Email 2

Project Information