Project Details

A Backend Service API Service

My first job out of college was MEDITECH, and they used a proprietary language called Magic, and it wasn't an acronym for anything. When you start at MEDITECH they ask you to create a CRUD application with this language. You have to create, update, and delete a record. When it comes to finding a record, or records, you had to use the first name only, last name only, partial last name or first name, or a combination of first and last name.

I have found a Contacts System, or PhoneBook, a great tool to try and learn new technologies. Hence, using Google Contacts as a model, I wanted to create a database in MySQL where I could use tools like Java and SpringBoot to create a system like this. The 'PhoneBook' application exists in multiple forms in my GitHub, first with Spring, then Spring Boot, with and without Security, with and without Spring Data JPA, etc.

HTMX Demo Backend Service is based on a previous project , and that is based on a previous project before that.

This is a three-tiered application consisting of:
  • - Data Layer - using Hibernate Entities with Annotations and Spring Data JPA Repositories. This is tested with @DataJpaTest to make sure our database is bullet-proof and cannot be corrupted.
  • - Business Logic - using @Service and @Component, built to be Transactional with small methods that do one thing well. This is also JUnit tested without Mockito. When we test the Business Logic methods, this will exercise the database for real.
  • - RESTful API - Using @RestController to send JSON to calling service. The API's are Junit tested without mocking, and execute the Business Logic methods, and the database.

This application not only has RESTful API's, but also has HTMX API's which return HTML, and we use Thymeleaf for that. Since I haven't done front-end development in quite a while, I figured I would try HTMX as a way of creating a front-end for this application, hence the name: HTMX Demo. I also wanted to add GraphQL endpoints since it seems like a small effort to add these on as well. So, this application has RESTful API's with JSON, HTMX API's that serve HTML, and GraphQL API's that also serve JSON, but in a different way than the RESTful API's.

So, having a reliable back-end allows me to create multiple UI (front-end) web-apps that will run in a separate Docker Image and then can be deployed independently. We could now create a front-end IO in React, Vue, Angular, or something like SmartGWT, etc.