Skip to content

tiagoramirez/portfolio-backend-2025

Repository files navigation

Portfolio Backend 2025

Java Spring Boot Docker This is my Backend Portfolio.

Table of Contents

Introduction

This Spring Boot Backend Portfolio shows modern Java development practices and enterprise-grade architecture patterns. Built to demonstrate scalability and maintainability in real-world scenarios, it implements:

  • Hexagonal Architecture (Ports and Adapters) for flexible and maintainable design
  • Comprehensive testing strategy with 100% code coverage
  • Server-side rendering capabilities using Thymeleaf for hybrid applications

The project serves as both a technical demonstration and a practical template for building robust microservices.

Features

  • Spring Boot application
  • RESTful API endpoints with Swagger documentation
  • Environment-specific configurations
  • Docker containerization
  • Thymeleaf templating engine
  • JUnit test suite with JaCoCo coverage
  • UML diagrams
  • Github Actions

Prerequisites

Development Tools

  • Gradle (wrapper included)
  • IDE with Java support (e.g., IntelliJ IDEA, Eclipse, VS Code)

Java

  • Java Development Kit (JDK) version 21

Infrastructure

  • Docker

Usage

Dev

Follow these steps to get the project up and running locally as developer profile:

  1. Clone the repository
  2. Start the SpringBoot App by running the following command:
./gradlew bootRun
  1. Test the API endpoint using any REST client with the following request:
curl --location --request GET 'http://localhost:8080/api/v1/health'
  1. You can also use the Swagger UI at http://localhost:8080/api/v1/swagger-ui/index.html

Pre-Prod

Follow these steps to get the project up and running locally as pre-prod profile:

  1. Clone the repository
  2. Modify environment variables in the .env file.
  3. Start the Docker Container by running the following command:
docker compose up -d --build
  1. Test the API endpoint using any REST client with the following request:
curl --location --request GET 'http://localhost:8080/api/v1/health'
  1. You can also use the Swagger UI at http://localhost:8080/api/v1/swagger-ui/index.html

Prod

Follow these steps to get the project up with prod profile:

  1. Clone the repository
  2. Setup environment variables from .env file into system environment variables in the server.
  3. Start all the services associated with the application.
  4. Start Docker Container.
  5. Test the API endpoint using any REST client with the following request:
curl --location --request GET '{base_url}/api/v1/health'
  1. You can also use the Swagger UI at {base_url}/api/v1/swagger-ui/index.html

Running Tests

To run the tests for this project, execute the following command:

.\gradlew test

To view the test coverage report, open the index.html file located inside the build\reports\jacoco\test\html folder (generated by the previous command).

Troubleshooting

Common Issues

  1. Port 8080 already in use

    • Solution: Modify the port in application.yml or stop the conflicting service
  2. Docker container fails to start

    • Solution: Check Docker logs using docker logs <container_name>
  3. JDK version mismatch

    • Solution: Ensure JAVA_HOME points to JDK 21
  4. Gradle build fails

    • Solution: Run ./gradlew clean build --refresh-dependencies

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

Portfolio Backend (Working...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published