Template-Java-API: Template para o desenvolvimento de APIs com base na linguagem Java.
- Docker
- Java 17
- Jococo
- JUnit
- JWT for REST API
- Maven
- Model Mapper
- Mokito
- PostgreSQL
- Swagger
- Surfire
- Scheduling Tasks
- Spring Boot
- Spring Statemachine
- Testes Unitários e de Integração
The API also was developed to run with an jar
. In order to generate this jar
, you should run:
mvn package
It will clean, compile and generate a jar
at target directory, e.g. Template-API-java-1.0-SNAPSHOT.jar
You need to have PostgreSQL 9.4.xx or above installed on your machine to run the API on dev
profile. After installed, on the pgAdmin
create a database named travels
. If you don't have pgAdmin
installed you can run on the psql
console the follow command:
CREATE database db-desenv;
After creating the API database, you need to add your Postgres root username
and password
in the application.properties
file on src/main/resource
. The lines that must be modified are as follows:
spring.datasource.username=
spring.datasource.password=
- For unit test phase, you can run:
mvn test
In order to run the API, run the jar simply as following:
java -jar Template-API-java-1.0-SNAPSHOT.jar --spring.profiles.active=dev
or
mvn spring-boot:run -Dspring.profiles.active=dev
By default, the API will be available at http://localhost:8080/api
- Swagger (development environment): http://localhost:8080/swagger-ui/index.html
$ MAVEN_PROFILE=prod docker compose up -d
- Author - Cledson Francisco Silva
- E-mail - cledsonfs@gmail.com