Skip to content

Java Web Application with PostgreSQL, Docker, OpenAPI and Codefresh

License

Notifications You must be signed in to change notification settings

Akash-Mittal/stadtbucherei

Repository files navigation

Stadtbucherei

Build and Test Quality Gate Status Quality Gate


Java Web Application with PostgreSQL, Docker, OpenAPI, and Codefresh

For more details on the assignment, check the Assignment Document.


Overview

Stadtbucheri is a library management application. This repository contains the backend services for managing loans, books, members, and more. The application is built using Spring Boot and PostgreSQL, and it can be run locally with or without Docker Compose.


Prerequisites:

  • Java 17+ should be installed on your local machine.
  • Gradle for managing dependencies and running the application.
  • Docker and Docker Compose should be installed on your machine. If they are not installed, follow the installation guides here:

How to Start Locally

Without Docker

To run the application without Docker, simply set up the necessary dependencies, and you can access the Swagger UI for the API at: ./gradlew build ./gradlew bootRun -Dspring.profiles.active=h2 Access on http://localhost:9091/swagger-ui/index.html#/

With Springboot and Postgress Docker DB

./gradlew build ./gradlew bootRun -Dspring.profiles.active=postgres (make sure postgres is up, you can do that by starting a docker instance with) docker-compose --profile db up -d Access on http://localhost:9091/swagger-ui/index.html#/


With Docker Compose

To run the application locally using Docker Compose, follow these steps:

Steps to Start:

Assumptions

  • Due to time constraints - no separate DB scripts are provided.
  • The DDL is set to create, hence it will create schema every time.
  • The Controller Integration tests are done with Docker TestContainers.(However full tests are not done due time and memory constraints.)
  • Limited validations, error handling and edge cases testing, all test cases are not provided.
  • Exception chaining from repo to controller is not done.
  • The response entity for each controller is not provided.
  • Test Code Coverage > 80% , the Jacoco is not configured to ignore the pojos and repos.
  • Code coverage report can be accessed in build/lib
  • Code quality is done via sonarqube on the cloud - please click the banner to see the open issues.
  • The code is also built via github actions (there is further scope to deploy the whole docker, its not delivered)
  • The documentation has more focus on code as documentations with Swagger api documentation.
  • no env file created, and many properties are not externalized.
  • No cascading in related entities

Key technologies

  • Spring data
  • JPA
  • Test Containers for IT testing - full stack testing
  • H2 database for testing.
  • SonarQube for Code Quality.
  • Jacoco for Code Quality.
  • OPEN API/ Swagger.
  • Docker

References

About

Java Web Application with PostgreSQL, Docker, OpenAPI and Codefresh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published