Spring Boot skeleton to kick-start your new application.
-
Spring Boot
-
Postgres database with Spring Data JPA
-
Preconfigured Spring Security, with session information stored in Redis
-
Lombok
-
OpenAPI 3.0 documentation and Swagger UI
-
Spring Boot Actuator
-
Spring Boot Devtools
-
Spotless with Prettier code formatter
-
Observability with OpenTelemetry + Loki + Prometheus + Tempo + Grafana
OpenAPI documentation is available on the following link: http://localhost:8080/v3/api-docs
💡
|
jq utility can be installed in order to interact with the JSON output directly from the CLI.
For example, the following command will list all available endpoints:
curl http://localhost:8080/v3/api-docs | jq '.paths|keys'
|
Swagger UI is available to visualize and interact with the API’s resources. It is available on the following link: http://localhost:8080/swagger-ui.html
Logs, metrics and tracing are available in Grafana on the following link: http://localhost:3000
Use the following command to connect to the Postgres instance:
docker-compose exec database psql -U postgres
Use the following command to connect to the Redis instance:
docker-compose exec session redis-cli
Pre-commit hook is available in .githooks
directory.
It is configured to run ./gradlew spotlessApply
.
In order to use it, run the following command:
git config core.hooksPath .githooks
The following is an example of registration and login flow using httpie:
-
Get a CSRF token:
http --session=admin --offline --quiet ':8080' \ "X-XSRF-TOKEN: $(http --session=admin ':8080/csrf' | jq --raw-output .token)"
-
Register:
http --session=admin ':8080/users' [email protected] password=Password1
-
Login:
http --session=admin ':8080/login' [email protected] password=Password1
-
Fetch user info
http --session=admin ':8080/users/self'
-
Logout
http --session=admin POST ':8080/logout'
Copyright (C) 2021-2023 Bojan Stipic This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.