Skip to content

Rviewer-Challenges/skeleton-java-spring-rest

Repository files navigation

Rviewer skeleton: Java, Spring & PostgreSQL

Twitter

Rviewer Discord


This repository is a Java skeleton with Spring & PostgreSQL designed for quickly getting started developing an API. Check the Getting Started for full details.

Technologies

Getting Started

Within the Makefile you can handle the entire flow to get everything up & running:

  1. Install make on your computer, if you do not already have it.
  2. Start the application: make up
  3. Run the application tests: make test

As you could see on the Makefile script and the Docker-Compose File, the whole API is containerized with Docker and the API is using the internal DNS to connect with the PostgreSQL instance.

Go to http://127.0.0.1:8080/ping to see that everything is up & running!

Overview

This skeleton is based on a Clean Architecture approach, so you could find the first basic layers:

You could find here two amazing articles (here and here) explaining the Clean Architecture with Java! (credits to @bertilMuth and @ryanthelin).

Infrastructure

Here you will find the different files to interact with the outside. In this folder you there are two different folders:

  • controllers: Here you will have the classes that handle the REST endpoints and the Request/Response
  • persistence: Here it is the persistence layer, which interact with the PostgreSQL database, decoupling the rest of the application

You can use this as a starting point to continue with this architecture, or adapt it to your preferences.

Domain

Any of your domain Entities, or Services, that models your business logic. These classes should be completely isolated of any external dependency or framework, but interact with them. This layer should follow the Dependency Inversion principle.

Support

If you are having problems or need anything else, please let us know by raising a new issue.

License

This project is licensed with the MIT license.


Made with ❤️ by Rviewer

Releases

No releases published

Packages

No packages published