Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc/27 backend documentation dependency list + purposes #641

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ const vitepressConfig = defineConfig({
],
sidebar: [
{
text: 'Examples',
text: 'Backend',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{text: "Getting Started", link: '/get-started'},
{ text: 'Dependencies', link: '/dependencies' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
Expand Down
163 changes: 163 additions & 0 deletions docs/dependencies.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared with the pom.xml and the following dependencies are still missing:

  • spring-boot-starter-parent (We should mention this is the central place to define Spring Boot version)
  • spring-cloud-dependencies (We should mention this is the central place to define Spring Cloud version)
  • httpclient5 (We should mention this is the chosen client implementation to handle HTTP communication)
  • junit-jupiter (We should mention this is the core library to run and implement junit tests)
  • postgresql (We should mention this is a required dependency to run a local Postgres database via Testcontainers when integration testing)
  • mapstruct-processor (We should mention this is required to provide annotation processors which generate type-safe bean mappers)
  • lombok-mapstruct-binding (We should mention this library is required to bridge between lombok and mapstruct`)
  • itm-java-codeformat (We should mention this is the configuration library which defines the formatting strategy`)
  • refarch-pmd (We should mention this is the configuration library which defines the PMD linting ruleset`)
  • findsecbugs-plugin (We should mention this dependencies extends Spotbugs to scan for security and CVE problems`)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another general idea would be to not only include the package name but also the groupId (Thats because often dependencies often have the same artifactId e.g. org.postgres.postgresql and org.testcontainers.postgresql

Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Dependencies

## Core Spring Boot Dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Core Spring Boot Dependencies
## Core Spring Dependencies

- **spring-boot-starter-web**:
Provides the essential components for building web applications with Spring MVC.
Comment on lines +5 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move all Starter deps to a central Spring Dependencies category or move all dependencies to its concerned cross cutting concept aka. subcategory.


- **spring-boot-starter-data-jpa**:
Simplifies the integration of JPA (Java Persistence API) into Spring applications, making it easier to work with relational databases.

- **spring-boot-starter-data-rest**:
Enables the creation of RESTful APIs from Spring Data repositories, allowing for easy exposure of data as REST endpoints.

- **spring-boot-starter-actuator**:
Adds production-ready features to your application, such as monitoring and management over REST endpoints.

## Caching
- **spring-boot-starter-cache**:
Provides support for caching in Spring applications, facilitating performance improvements by storing frequently accessed data temporarily.

- **caffeine**:
A high-performance caching library that integrates with Spring’s caching abstraction to enhance data retrieval speeds.

## Security
- **spring-boot-starter-security**:
Provides comprehensive security services for your application, including authentication and authorization capabilities.

- **spring-security-oauth2-client**:
Adds support for OAuth 2.0 client functionalities, allowing your application to connect with external OAuth 2.0 providers.

- **spring-security-oauth2-resource-server**:
Enables your application to act as an OAuth 2.0 resource server, protecting your REST APIs.

- **spring-security-oauth2-jose**:
Provides support for JSON Web Tokens (JWT) in OAuth 2.0 flows, facilitating secure token management.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add security configuration notes and best practices.

The security section should include important configuration notes and best practices.

Consider adding:

  1. Basic security configuration examples
  2. Common security pitfalls to avoid
  3. Links to security best practices

Example addition:

## Security

- **spring-boot-starter-security**:  
  Provides comprehensive security services.
  ```yaml
  # Example security configuration
  spring:
    security:
      oauth2:
        client:
          registration:
            # Configuration details...

Important: Never commit sensitive credentials. Use environment variables or secure vaults.


<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.37.0)</summary>

23-23: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

---

24-24: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->

## Data Management
- **postgresql**:
Allows the application to communicate with PostgreSQL databases.

- **hibernate-core**:
The core ORM (Object-Relational Mapping) framework that facilitates database operations via Java objects.

- **hibernate-jpamodelgen**:
Enables JPA model generation at compile time, improving type safety in JPA queries.

- **flyway-core**:
A tool for managing database migrations, ensuring your database schema is always up-to-date.

- **flyway-database-postgresql**:
Provides the necessary PostgreSQL functionality for Flyway migrations.

## JSON Processing
- **spring-hateoas**:
Adds support for Hypermedia as the Engine of Application State (HATEOAS), enhancing REST API responses with links.

- **jackson-databind**:
A powerful library for converting Java objects to and from JSON.

- **jackson-datatype-jsr310**:
Adds support for Java 8 Date and Time API types in Jackson.

- **json-path**:
A library for querying JSON structures, enabling complex data retrieval from JSON objects.

## Validation
- **jakarta.validation-api**:
Provides the necessary API for bean validation, ensuring that data conforms to defined constraints.

- **hibernate-validator**:
The reference implementation of the Jakarta Bean Validation API, used for validating Java objects.

## Testing Dependencies
- **spring-boot-starter-test**:
A comprehensive starter for testing Spring applications, including JUnit, AssertJ, and Mockito.

- **spring-security-test**:
Provides utilities for testing security features in Spring applications.

- **spring-boot-testcontainers**:
Integrates Testcontainers to support integration testing with real databases.

- **junit-jupiter-api**:
The API for writing tests in JUnit 5, supporting modern testing practices.

- **junit-jupiter-engine**:
The engine that runs JUnit 5 tests.

## Monitoring and Metrics
- **micrometer-tracing**:
Adds tracing capabilities to your application, allowing for better observability.

- **micrometer-tracing-bridge-brave**:
Integrates Brave tracing library with Micrometer.

- **logstash-logback-encoder**:
A Logback encoder for sending structured logs to Logstash, enabling better log management.

- **micrometer-registry-prometheus**:
Integrates Prometheus with Micrometer for metrics collection and monitoring.

## Miscellaneous
- **spring-data-rest-hal-explorer**:
Provides an interactive HAL browser for Spring Data REST applications, making it easier to explore API endpoints.

- **commons-collections4**:
Provides additional data structures and algorithms for Java collections.

- **commons-csv**:
A library for reading and writing CSV files, simplifying CSV data manipulation.

- **commons-io**:
Contains utility classes for working with IO operations, enhancing file handling capabilities.

- **commons-lang3**:
Offers helper utilities for the Java core classes, improving development efficiency.

- **commons-text**:
Provides additional text processing capabilities, enhancing string manipulation.

- **commons-validator**:
A library for providing validation routines, ensuring data integrity.
Comment on lines +152 to +153
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this fit better in validation?


- **spring-boot-configuration-processor**:
A processor for generating metadata for application properties, improving IDE support and documentation.

## Code Quality and Annotations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would definitely have a separate section for code quality and remove the category "Annotations" and move those into "miscellaneous"

- **lombok**:
A library that reduces boilerplate code in Java by providing annotations for automatic generation of getters, setters, and more.

- **mapstruct**:
A code generator that simplifies the implementation of bean mapping, improving data transfer between different object models.

- **spotbugs-annotations**:
Provides annotations that help with static analysis of your code, allowing developers to identify potential bugs early.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider adding version information for dependencies.

While the descriptions are informative, adding version information would be valuable for maintainers. This helps track compatibility and security updates.

Consider:

  1. Adding version numbers for each dependency
  2. Including compatibility notes (e.g., "Requires Java 17+")
  3. Mentioning any known version constraints or conflicts

Example format:

- **spring-boot-starter-web** (3.x.x):  
  Provides the essential components for building web applications with Spring MVC.
  - Requires Java 17+
  - Compatible with Spring Boot 3.x
🧰 Tools
🪛 Markdownlint (0.37.0)

3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


16-16: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


23-23: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


36-36: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


52-52: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


65-65: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


72-72: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


88-88: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


101-101: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


126-126: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


4-4: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


17-17: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


24-24: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


37-37: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


53-53: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


66-66: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


73-73: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


89-89: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


102-102: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


127-127: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

## Build Configuration
The build configuration section defines plugins that enhance the Maven build process:

- **spring-boot-maven-plugin**:
Facilitates packaging and running Spring Boot applications, enabling easy creation of executable JARs.

- **maven-compiler-plugin**:
Configures the Java compiler by specifying the source and target Java versions. It also sets up annotation processors for libraries like Lombok and MapStruct, allowing for code generation and enhancements during compilation.

- **maven-surefire-plugin**:
Runs the tests in your project, providing fine control over the test execution environment, including encoding settings.

- **jacoco-maven-plugin**:
Measures code coverage during tests, generating reports that help identify untested parts of the codebase.

- **spotless-maven-plugin**:
Ensures code formatting consistency by applying specified style rules to Java files, using configurations from an Eclipse formatter file.

- **maven-pmd-plugin**:
Executes static code analysis to identify potential issues in your code, applying custom rulesets and providing reports on code quality.

- **spotbugs-maven-plugin**:
Performs static analysis to detect bugs in Java code, integrating security checks with the FindSecBugs plugin for enhanced security assessments.

- **flyway-maven-plugin**:
Manages database migrations, allowing for version control of database schemas and ensuring that the database is always in an expected state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Enhance build configuration documentation with examples.

The build configuration section would benefit from practical examples and configuration snippets.

Consider adding:

  1. Basic configuration examples for critical plugins
  2. Common customization scenarios
  3. Links to detailed configuration guides

Example addition:

- **spring-boot-maven-plugin**:  
  Facilitates packaging and running Spring Boot applications.
  ```xml
  <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
      <excludes>
        <exclude>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
        </exclude>
      </excludes>
    </configuration>
  </plugin>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.37.0)</summary>

136-136: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->

This configuration collectively ensures that the project is built, tested, and maintained efficiently, promoting code quality and adherence to best practices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Improve markdown formatting for better readability.

The document needs consistent formatting around headings and lists to improve readability and comply with markdown best practices.

Apply these formatting changes throughout the document:

  • Add blank lines before and after each heading
  • Add blank lines before and after lists

Example fix for the first few sections:

 # Dependencies

+
 ## Core Spring Boot Dependencies
+
 - **spring-boot-starter-web**:  
   Provides the essential components for building web applications with Spring MVC.

 - **spring-boot-starter-data-jpa**:  
   Simplifies the integration of JPA (Java Persistence API) into Spring applications...
+
 ## Caching
+
 - **spring-boot-starter-cache**:  
   Provides support for caching in Spring applications...

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Markdownlint (0.37.0)

3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


16-16: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


23-23: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


36-36: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


52-52: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


65-65: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


72-72: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


88-88: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


101-101: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


126-126: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


136-136: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


4-4: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


17-17: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


24-24: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


37-37: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


53-53: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


66-66: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


73-73: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


89-89: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


102-102: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


127-127: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

1 change: 1 addition & 0 deletions docs/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Get Started
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

⚠️ Potential issue

Content missing in the Getting Started guide.

The file only contains a header without any actual content. As this PR aims to enhance backend documentation, this guide should include:

  • Overview of the backend architecture
  • Setup instructions
  • Development environment requirements
  • Basic usage examples

Would you like me to help draft a comprehensive getting started guide that aligns with the PR objectives? I can provide a structured template covering the essential aspects of your backend documentation.

3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ hero:
text: "Documentation for the RefArch"
tagline: My great project tagline
actions:
- theme: brand
text: Backend
link: /get-started
- theme: brand
text: Markdown Examples
link: /markdown-examples
Expand Down
Loading