yurkova-anastasia / news-system

0 stars 0 forks source link

Web Application: News Service

Technologies Used

Services

Microservices Architecture

Description

This service provides REST APIs for managing news articles and comments.

Database Initialization with Liquibase

When starting the service, scripts are rolled onto the working database (the necessary tables are generated from one file and the tables are filled with data from another file)

Entities

NewsEntity

CommentEntity

REST API

News Management 8080

News API

Comments API

User Management (via Users Service) - 8081

Configuration File: application.yml

All configurations are externalized to the application.yml file. Spring profiles are utilized for different environments (e.g., test & prod).

Configuration Management with Spring Cloud Config:

This service utilizes Spring Cloud Config as a configuration management solution.The Spring Cloud Config server is hosted on port 8888 and stores the production (prod) configuration.

Deployment

Security

Custom Spring Boot Starters Configuration

Cache Starter

Prefix: cache.type
Type: java.lang.String
Description: The type of cache used.
Default Value: "LRU"
Prefix: cache.size
Type: java.lang.Integer
Description: The size of the used cache.
Default Value: 16

Exception Handling Starter

Prefix: spring.exception-handling.enabled
Type: java.lang.Boolean
Description: Enable exception handling.
Default Value: true

Logging Starter

Prefix: spring.logging.enabled
Type: java.lang.Boolean
Description: Enables custom logging.
Default Value: true

In order to build the jar you should run the following command:

./gradlew clean build -x test

In order to run application you should run the following command(before this you should build the jar):

docker-compose up

To run tests:

./gradlew test