- SpringBoot
- Docker
- PostgreSQL
- Lombok
- Mapstruct
- Spring Data JPA
- H2 in-memory DB
- Mockito
- MockMvc
- Swagger
- How to run this application
- How to access the spring boot restful application
- PostgreSQL version based Tic Tac Toe Application
- Advantages of this application
- Create a new game
- List all games
- Find a game via id
- Find a game via game name
- Perform a move in a game & determine the status of a game & return the winner if there is one
- Navigate the the root folder /tictactoe under the command line
- run the command to build the whole project: gradle clean build
- run the command to start the application: java -jar ./build/libs/tictactoe-0.0.1-SNAPSHOT.jar
http://localhost:8080/swagger-ui.html
When clicking any endpoint, for instance createGame, it will show the details and you can hit it to get the response. Just like the below screenshot.
There is the modal automatically generated by swagger. You may check the detail if you click one of them. the detail of it will be shown as the below screenshot.
- Navigate the the root folder /tictactoe under the command line
- rename application.properties to another name e.g. application_backup.properties
- rename application-postgresql.properties to application.properties
- run the command to docker-compose up
- run the command to build the whole project: gradle clean build
- when the above step is done, run the command java -jar ./build/libs/tictactoe-0.0.1-SNAPSHOT.jar
- Integrated with swagger doc which easily provides with the RESTful API UI and can be easily shared with other developers to use use API
- Hibernate builds the entity layer to connect PostgreSQL database server
- Spring Data JPA builds the repository layer (DAO) & H2 in-mem database used as Unit Test to test this layer
- Mapstruct used to map data between entities and dtos
- All the exceptions can be centrally handled in one place (ControllerExceptionHandler.java)
- Lombok makes our life easierIt automatically generates getter,setter, constructor, hashcode, log etc.