The project aims to create a RESTful API with a backend in Java and Spring Boot.
- Introduction
- Architecture
- Initial Idea
- Domain Model
- Diagrams
- Starting
- Prerequisites
- Installation
- Built With
- Version
- Authors
- License
- References
- Thanks
This project was developed by me, through an event that took place during the month of July 2023, taught by Professor Nelio Alves.
The event calls "Intensivão Java Spring" is a bootcamp aimed at web developing a Backend Spring Boot application with Java.
The project use this layer pattern:
- Frontend
- JSON (HTTP Requests)
- Backend
- Controllers
- DTO
- Services
- Entities
- Repositories
- Projections
With the image bellow you can visualize the layer pattern used, following the design standards of the current development market.
This is the initial idea for the project:
This is the domain model for the project, it was built using the Astah modeling software, in the free version of the community, where through it, it is possible to view the names of the tables, columns, relationships, cardinalities and primary keys.
This is the class diagram of the project, it was generated through the IntelliJ IDE, contains all relationships between classes, data types, methods and attributes, being very useful to visualize the entire operation.
git clone git@github.com:olvericc/dsListV2.git
git clone https://github.com/olvericc/dsListV2.git
- IDE - IntelliJ IDEA Ultimate;
- SGBD - DBeaver Community;
- APIs - Postman;
- VSC - Git;
- SDK - JDK 17 LST (Zulu);
- Compilation Tool - Maven;
- DB - Postgres;
- DB - H2 Database;
To create your development environment, follow these steps
Type following commands in project root folder with yml file
You need to run these commands in terminal, on the docker folder (for example: C:\dev\ws-java\dsListV2\docker), with the docker-compose.yml
docker-compose build
docker-compose up
With your IDE open, launch the Spring Boot application via the build tool.
Here are the basic steps to run a Spring Boot application through the terminal:
- Make sure you have the JDK (Java Development Kit) installed on your system and properly configured in the PATH.
- Build the JAR package of your Spring Boot application using Maven or Gradle. For Maven, you can use the following command in the root of the project (where the pom.xml file is located):
mvn package
This will compile your Spring Boot project, run tests, and generate the JAR file in the "target" folder of your project directory.
- Navigate to the folder where the JAR file was generated, for example:
cd target java -jar filename.jar
- Replace "filename.jar" with the actual name of the JAR file generated by your application.
If you follow these steps correctly and your Spring Boot application is configured properly, it will start up and be accessible at http://localhost:8080 or another configured port, as mentioned earlier.
Follow these steps to set up Postman and test your RESTful API:
- Import the API Collection: https://documenter.getpostman.com/view/21827047/2s946o5VJE
- Test the Endpoints:
- Each request in the collection represents a specific API endpoint with its parameters and expected responses.
For example, to test the GET request for fetching a specific resource, select the corresponding request from the collection.
- Fill in any necessary parameters and click the "Send" button to execute the request.
You'll receive the response from the server, which you can inspect and validate.
With Postman, you can thoroughly test your API, debug any issues, and ensure that it behaves as expected before deploying it to production.
- Java - Programming language used.
- Version: 17 LTS
- Spring Boot - Framework for building the application.
- Version: 3.1 LTS
- Maven - Dependency Manager.
- Spring Data JPA - Spring Framework subproject that supports and facilitates JPA (Java Persistence API) integration.
- H2 Database - In-memory database for testing.zzz
- PostgreSQL - Relational database management system.
- Version: 14
Release 1.0
- Java Backend Developer - Initial part of project - Eric Lopes Oliveira
This project is under my license.
This project was based using this repository as a reference:
https://github.com/devsuperior/dslist-backend
- These project is purely for academic purposes;
- I plan to add more libraries and adding new features in the future;
- I will add a frontend with Angular or React;
- The deployment will be completed in next version;