I recommend this structure for basic projects that are not extensive.
This repo is Spring Boot project in which different technologies such as Swagger, Model Mapper are integrated. Additionally, there are 2 different APIs available for testing.
- Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can " just run".
- MySQL is an open-source relational database management system. Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the abbreviation for Structured Query Language.
- Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.
- Java Persistence API (JPA), part of the larger Spring Data family, makes it easy to easily implement JPA based repositories. This module deals with enhanced support for JPA based data access layers. It makes it easier to build Spring-powered applications that use data access technologies.
- Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.
- Simplify API development for users, teams, and enterprises with the Swagger open source and professional toolset. Find out how Swagger can help you design and document your APIs at scale.
- Retrofit: A type-safe HTTP client for Android and Java.
- The goal of ModelMapper is to make object mapping easy, by automatically determining how one object model maps to another, based on conventions, in the same way that a human would - while providing a simple, refactoring-safe API for handling specific use cases.
First, it needs to create a database named architecture
in the phpMyAdmin console.
You can use XAMPP for work on local server. If you do not make any changes in the configuration, you can access phpMyAdmin from the link below.
The required table can be created using the following SQL query.
CREATE TABLE users (
userId VARCHAR(30) PRIMARY KEY,
name VARCHAR(40),
username VARCHAR(40));
After running Apache and phpMyAdmin correctly in your local, the Swagger UI link will be as follows.
API tests with 200 OK and 404 Not Found (Custom Exception) codes are listed below.
-
Clone or download the application to your computer.
-
Go to the folder where the application is located via terminal.
-
Before testing, please make sure Docker is installed on your local computer.
-
Then run the application with the
make
command. Make sure you have themake
installed on your computer. Ifmake
is not installed on your computer, you can find detailed information here. -
Now you can test the application on your own computer.
make clean
make image
make run
All contributions are welcome! Please fork this repository and contribute back using pull requests.
Don't forget to star ⭐ the repo it motivates me to share more open source