Skip to content

malyshevhen/museum-demo-spring-boot-maven

Repository files navigation

Demo spring-boot maven application


Description

Java spring-boot application, written to level up knowledge of maven build tool, spring boot, and some libraries. It is a back-end part of the abstract Museum Website and provides REST endpoints with basic CRUD functionality.


App Architecture

The project has basic 'onion' or three-layer architecture.

app-uml-diagram


Project structure

                  on 2023-08-18
.
├── docker-compose.yml
├── Dockerfile
├── domain
│   ├── domain.iml
│   └── target
│       ├── classes
│       ├── generated-sources
│       │   └── annotations
│       ├── generated-test-sources
│       │   └── test-annotations
│       └── test-classes
├── mvnw
├── mvnw.cmd
├── pom.xml
├── Project-simple-diagram.png
├── README.md
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── example
    │   │           ├── Application.java
    │   │           ├── constants
    │   │           │   └── TestConstants.java
    │   │           ├── constraints
    │   │           │   ├── museum
    │   │           │   │   ├── ArticleConstraints.java
    │   │           │   │   ├── AuthorConstraints.java
    │   │           │   │   └── EventConstraints.java
    │   │           │   ├── SharedConstraints.java
    │   │           │   └── users
    │   │           │       └── UserConstraints.java
    │   │           ├── domain
    │   │           │   ├── museum
    │   │           │   │   ├── Article.java
    │   │           │   │   ├── Author.java
    │   │           │   │   └── Event.java
    │   │           │   └── users
    │   │           │       └── User.java
    │   │           ├── dto
    │   │           │   ├── museum
    │   │           │   │   ├── article
    │   │           │   │   │   ├── ArticlePublishingForm.java
    │   │           │   │   │   ├── ArticleWithContent.java
    │   │           │   │   │   └── ArticleWithoutContent.java
    │   │           │   │   ├── author
    │   │           │   │   │   ├── AuthorRegistrationForm.java
    │   │           │   │   │   └── AuthorShortResponse.java
    │   │           │   │   └── event
    │   │           │   │       ├── EventPublishingForm.java
    │   │           │   │       ├── EventWithContent.java
    │   │           │   │       └── EventWithoutContent.java
    │   │           │   └── users
    │   │           │       ├── UserRegistrationForm.java
    │   │           │       └── UserResponse.java
    │   │           ├── repositories
    │   │           │   ├── museum
    │   │           │   │   ├── ArticleRepository.java
    │   │           │   │   ├── AuthorRepository.java
    │   │           │   │   └── EventRepository.java
    │   │           │   └── users
    │   │           │       └── UserRepository.java
    │   │           ├── services
    │   │           │   ├── museum
    │   │           │   │   ├── ArticleService.java
    │   │           │   │   ├── AuthorService.java
    │   │           │   │   ├── EventService.java
    │   │           │   │   ├── exceptions
    │   │           │   │   │   ├── ArticleNotFoundException.java
    │   │           │   │   │   ├── AuthorAlreadyExistException.java
    │   │           │   │   │   ├── AuthorNotFoundException.java
    │   │           │   │   │   └── EventNotFoundException.java
    │   │           │   │   └── impl
    │   │           │   │       ├── ArticleServiceImpl.java
    │   │           │   │       ├── AuthorServiceImpl.java
    │   │           │   │       └── EventServiceImpl.java
    │   │           │   └── users
    │   │           │       ├── exceptions
    │   │           │       │   ├── UserAlreadyExistsException.java
    │   │           │       │   └── UserNotFoundException.java
    │   │           │       ├── impl
    │   │           │       │   └── UserServiceImpl.java
    │   │           │       └── UserService.java
    │   │           └── web
    │   │               ├── exceptionhandler
    │   │               │   └── RestExceptionHandler.java
    │   │               ├── museum
    │   │               │   └── controllers
    │   │               │       ├── ArticleController.java
    │   │               │       ├── AuthorController.java
    │   │               │       └── EventController.java
    │   │               └── users
    │   │                   └── UserController.java
    │   └── resources
    │       ├── application.yml
    │       └── db
    │           └── migration
    │               ├── V1__initial_schema.sql
    │               └── V2__fake_data.sql
    └── test
        ├── java
        │   └── com
        │       └── example
        │           ├── config
        │           │   ├── AbstractInstancioDomainTest.java
        │           │   ├── AbstractInstancioTest.java
        │           │   ├── AbstractRepositoryIntegrationTest.java
        │           │   └── AbstractServiceIntegrationTest.java
        │           ├── domain
        │           │   ├── museum
        │           │   │   ├── ArticleTest.java
        │           │   │   ├── AuthorTest.java
        │           │   │   └── EventTest.java
        │           │   └── users
        │           │       └── UserTest.java
        │           ├── dto
        │           │   ├── museum
        │           │   │   ├── article
        │           │   │   │   ├── ArticlePublishingFormTest.java
        │           │   │   │   ├── ArticleWithContentTest.java
        │           │   │   │   └── ArticleWithoutContentTest.java
        │           │   │   ├── author
        │           │   │   │   ├── AuthorRegistrationFormInstancioTest.java
        │           │   │   │   └── AuthorShortResponseInstancioTest.java
        │           │   │   └── event
        │           │   │       └── EventPublishingFormTest.java
        │           │   └── users
        │           │       ├── UserRegistrationFormInstancioTest.java
        │           │       └── UserResponseInstancioTest.java
        │           ├── repositories
        │           │   ├── museum
        │           │   │   ├── ArticleRepositoryIntegrationTest.java
        │           │   │   ├── AuthorRepositoryIntegrationTest.java
        │           │   │   └── EventRepositoryIntegrationTest.java
        │           │   └── users
        │           │       └── UserRepositoryIntegrationTest.java
        │           ├── services
        │           │   ├── museum
        │           │   │   └── impl
        │           │   │       ├── ArticleServiceImplIntegrationTest.java
        │           │   │       ├── AuthorServiceIntegrationTest.java
        │           │   │       └── EventServiceImplIntegrationTest.java
        │           │   └── users
        │           │       └── impl
        │           │           └── UserServiceIntegrationTest.java
        │           └── web
        │               ├── museum
        │               │   └── controllers
        │               │       ├── ArticleControllerTest.java
        │               │       └── EventControllerTest.java
        │               └── users
        │                   └── UserControllerTest.java
        └── resources

Features and technology stack

Main properties

  • Language: Java-17
  • Build tool: Apache Maven
  • Main framework: Spring Boot 3.1.2
  • CI: GitHub Actions
  • Deployment: Docker with Docker Compose plugin

WEB

Persistence

  • Spring Data JPA
    • Hibernate as default ORM framework
    • Records DTO projections for retrieving data
    • Transaction management by spring @Transactional
  • Flyway SQL migration, for managing schemes versions
  • PostgreSQL as RDBMS

Tests

Other

How you can try it

Now the project is in development, and not everything should work perfectly fine 😊.
But I fix all issues as soon as possible 😅.

What do you need:

  1. You should have Docker with Docker compose plugin (or Docker desktop) installed on your machine. Link with instructions: Get Docker
  2. Java 17 installed. I recommend using SDK-man for this. It is not so easy on Windows, but it is worth it. (Link on GitHub post: Using SDKMAN! with git for Windows shell (git bash)).
  3. And that`s it 😎.

Installation steps:

  1. Clone this repository.
  2. Run another command: ./mvnw clean install
  3. Run this command in your terminal (on Linux and Mac), Power-Shell or Git-bash (on Windows), but first of all move to the root of the project: docker compose up -d
  4. Open link in your browser: swagger-ui
  5. Test endpoints with the Swagger UI 😀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages