This is a fully functional sample project written in Java that samples a simple Spring Boot backend adhering to REST principles. The application provides a Tree CRUD service, allowing authenticated users to create, read, update, and delete tree data. User authentication is handled through JWT tokens using HTTPS-only cookies for added security.
The project utilizes PostgreSQL for data storage, and pgAdmin4 for database management both are containerized with Docker for easy deployment and scalability. Swagger is integrated to provide interactive API documentation, while Mockito is used for unit testing TO-DO.
Verify API documentation in http://localhost:8080/swagger-ui/index.html when running.
Ensure that you have the following installed:
- Docker: Download and install Docker.
- Java 23: Download and install Java.
- Maven: Install Apache Maven.
First, clone the repository to your local machine:
git clone git@github.com:simaocaixas/3api.git
cd 3apiThe project includes a docker-compose.yml file that automates the setup of PostgreSQL, pgAdmin4, in a Docker container. Run docker and run the following command:
docker-compose upPostgreSQL running on port 5432 Pgadmin running on port 5050
Pgadmin credentials Email: admin@example.com Password: adminpass
In the project foldier, run the following command:
mvn spring-boot:runThis will start the Spring Boot app, running it by default in port 8080.